[tor-commits] [stem/master] Fix Python3 bytes type issue using Cryptography.

atagar at torproject.org atagar at torproject.org
Thu Mar 30 04:18:02 UTC 2017


commit 23ab3005664b951af6135f18472cbccb178fc988
Author: Paras Chetal <paras.chetal at gmail.com>
Date:   Sat Mar 4 14:33:50 2017 -0800

    Fix Python3 bytes type issue using Cryptography.
    
    Signed-off-by: Patrick O'Doherty <p at trickod.com>
---
 stem/descriptor/hidden_service_descriptor.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/descriptor/hidden_service_descriptor.py b/stem/descriptor/hidden_service_descriptor.py
index ce3a134..dc42286 100644
--- a/stem/descriptor/hidden_service_descriptor.py
+++ b/stem/descriptor/hidden_service_descriptor.py
@@ -326,7 +326,7 @@ class HiddenServiceDescriptor(Descriptor):
 
       # try decrypting the session key
 
-      cipher = Cipher(algorithms.AES(authentication_cookie), modes.CTR('\x00' * len(iv)), default_backend())
+      cipher = Cipher(algorithms.AES(authentication_cookie), modes.CTR(stem.util.str_tools._to_bytes('\x00' * len(iv))), default_backend())
       decryptor = cipher.decryptor()
       session_key = decryptor.update(encrypted_session_key) + decryptor.finalize()
 





More information about the tor-commits mailing list