From e2832afacb46aef353b299204c0aec2a03679a93 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 4 Oct 2019 17:12:07 -0500 Subject: [PATCH] fixed friends --- onionr/onionrusers/contactmanager.py | 2 +- onionr/onionrutils/mnemonickeys.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/onionr/onionrusers/contactmanager.py b/onionr/onionrusers/contactmanager.py index 25343efb..0fbd2de9 100755 --- a/onionr/onionrusers/contactmanager.py +++ b/onionr/onionrusers/contactmanager.py @@ -31,7 +31,7 @@ class ContactManager(onionrusers.OnionrUser): try: if mnemonickeys.DELIMITER in publicKey: publicKey = mnemonickeys.get_base32(publicKey.split(mnemonickeys.DELIMITER)) - publicKey = unpaddedbase32.b32encode(bytesconverter.str_to_bytes(publicKey)) + #publicKey = unpaddedbase32.b32encode(bytesconverter.str_to_bytes(publicKey)) except ValueError: pass publicKey = bytesconverter.bytes_to_str(unpaddedbase32.repad(bytesconverter.str_to_bytes(publicKey))) diff --git a/onionr/onionrutils/mnemonickeys.py b/onionr/onionrutils/mnemonickeys.py index 792cf8cd..d1384571 100644 --- a/onionr/onionrutils/mnemonickeys.py +++ b/onionr/onionrutils/mnemonickeys.py @@ -40,4 +40,8 @@ def get_human_readable_ID(pub=''): def get_base32(words): '''converts mnemonic to base32''' - return unpaddedbase32.b32encode(niceware.passphrase_to_bytes(words.split(DELIMITER))) + try: + return unpaddedbase32.b32encode(niceware.passphrase_to_bytes(words.split(DELIMITER))) + except AttributeError: + ret = unpaddedbase32.b32encode(niceware.passphrase_to_bytes(words)) + return ret