Browse Source

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

Ian Goldberg 5 years ago
parent
commit
1df690d4b7
1 changed files with 2 additions and 0 deletions
  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
         domain separator is as above.  If is_last is true, don't bother
         creating the new blinding key, since this is the last iteration,
         creating the new blinding key, since this is the last iteration,
         and we won't be using it."""
         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
         reblinded_server_pubkey = server_pubkey
         for blindkey in blindkey_list:
         for blindkey in blindkey_list:
             reblinded_server_pubkey = Sphinx.reblindpubkey(blindkey,
             reblinded_server_pubkey = Sphinx.reblindpubkey(blindkey,