1
0

ecc: API changes: verify_message_hash to return bool instead of raising

verify_message_hash and verify_message_for_address now return bool
instead of raising Exceptions on bad signatures.
This commit is contained in:
SomberNight
2022-02-16 17:23:23 +01:00
parent 57583c05cf
commit 4f9e4c520f
5 changed files with 38 additions and 47 deletions

View File

@@ -43,11 +43,7 @@ try:
# verify a signature (65 bytes) over the session key, using the master bip32 node
# - customized to use specific EC library of Electrum.
pubkey = BIP32Node.from_xkey(expect_xpub).eckey
try:
pubkey.verify_message_hash(sig[1:65], self.session_key)
return True
except:
return False
return pubkey.verify_message_hash(sig[1:65], self.session_key)
except ImportError as e:
if not (isinstance(e, ModuleNotFoundError) and e.name == 'ckcc'):