mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 20:19:23 +00:00
Check if all signatures has been provided correctly
This commit is contained in:
parent
72753fa914
commit
de1bef9533
@ -490,6 +490,8 @@ class ProtocolMixin(object):
|
||||
serialized_tx += res.serialized.serialized_tx
|
||||
|
||||
if res.HasField('serialized') and res.serialized.HasField('signature_index'):
|
||||
if signatures[res.serialized.signature_index] != None:
|
||||
raise Exception("Signature for index %d already filled" % res.serialized.signature_index)
|
||||
signatures[res.serialized.signature_index] = res.serialized.signature
|
||||
|
||||
if res.request_type == types.TXFINISHED:
|
||||
@ -529,6 +531,9 @@ class ProtocolMixin(object):
|
||||
finally:
|
||||
self.transport.session_end()
|
||||
|
||||
if None in signatures:
|
||||
raise Exception("Some signatures are missing!")
|
||||
|
||||
print "SIGNED IN %.03f SECONDS, CALLED %d MESSAGES, %d BYTES" % \
|
||||
(time.time() - start, counter, len(serialized_tx))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user