Fix two python3 compatibility problems:

We need to explicitly encode the serverID before hashing it
Pass read/binary modes to the file made from socket to avoid encoding problems, fixes #29
This commit is contained in:
Ammar Askar committed 2015-04-17 17:57:34 +05:00
1 parent 9202c4399b
commit 79ee31c44e
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ def encrypt_token_and_secret(pubkey, verification_token, shared_secret):
def generate_verification_hash(server_id, shared_secret, public_key):
verification_hash = sha1()
verification_hash.update(server_id)
verification_hash.update(server_id.encode('utf-8'))
verification_hash.update(shared_secret)
verification_hash.update(public_key)