From 8213fee15b1740ecb2b60edf604577474bc138af Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Mon, 26 Nov 2018 16:28:23 +0100 Subject: [PATCH] eth: replace fw error with data error in verify function closes #422 --- src/apps/ethereum/verify_message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/ethereum/verify_message.py b/src/apps/ethereum/verify_message.py index 41a09418b..b99085898 100644 --- a/src/apps/ethereum/verify_message.py +++ b/src/apps/ethereum/verify_message.py @@ -1,5 +1,6 @@ from ubinascii import hexlify +from trezor import wire from trezor.crypto.curve import secp256k1 from trezor.crypto.hashlib import sha3_256 from trezor.messages.Success import Success @@ -22,12 +23,12 @@ async def verify_message(ctx, msg): pubkey = secp256k1.verify_recover(sig, digest) if not pubkey: - raise ValueError("Invalid signature") + raise wire.DataError("Invalid signature") pkh = sha3_256(pubkey[1:], keccak=True).digest()[-20:] if msg.address != pkh: - raise ValueError("Invalid signature") + raise wire.DataError("Invalid signature") address = "0x" + hexlify(msg.address).decode()