Просмотр исходного кода

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

Ian Goldberg 6 лет назад
Родитель
Сommit
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
         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,