signmessage: also accept Trezor-type sigs for p2wpkh and p2wpkh-p2sh addrs
The signatures we create are unchanged but we now also accept signatures created by Trezor and others. see https://github.com/spesmilo/electrum/issues/3861
This commit is contained in:
@@ -491,7 +491,7 @@ class DigitalBitbox_KeyStore(Hardware_KeyStore):
|
||||
sig_string = binascii.unhexlify(reply['sign'][0]['sig'])
|
||||
recid = int(reply['sign'][0]['recid'], 16)
|
||||
sig = ecc.construct_sig65(sig_string, recid, True)
|
||||
pubkey, compressed = ecc.ECPubkey.from_signature65(sig, msg_hash)
|
||||
pubkey, compressed, txin_type_guess = ecc.ECPubkey.from_signature65(sig, msg_hash)
|
||||
addr = public_key_to_p2pkh(pubkey.get_public_key_bytes(compressed=compressed))
|
||||
if ecc.verify_message_with_address(addr, sig, message) is False:
|
||||
raise Exception(_("Could not sign message"))
|
||||
|
||||
Reference in New Issue
Block a user