1
0

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:
SomberNight
2022-02-16 19:20:51 +01:00
parent 9bbf92b80b
commit 5cdb4471ec
3 changed files with 44 additions and 9 deletions

View File

@@ -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"))