Преглед изворни кода

Allow passing a byte representation of a public key to Sphinx.client

Ian Goldberg пре 4 година
родитељ
комит
1df690d4b7
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      relay.py

+ 2 - 0
relay.py

@@ -321,6 +321,8 @@ class Sphinx:
         domain separator is as above.  If is_last is true, don't bother
         creating the new blinding key, since this is the last iteration,
         and we won't be using it."""
+        if type(server_pubkey) is bytes:
+            server_pubkey = nacl.public.PublicKey(server_pubkey)
         reblinded_server_pubkey = server_pubkey
         for blindkey in blindkey_list:
             reblinded_server_pubkey = Sphinx.reblindpubkey(blindkey,