mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 11:21:11 +00:00
use FirmwareErase.length field
This commit is contained in:
parent
c1fae7d19f
commit
564e6590c2
@ -957,12 +957,12 @@ class ProtocolMixin(object):
|
|||||||
if self.features.bootloader_mode == False:
|
if self.features.bootloader_mode == False:
|
||||||
raise Exception("Device must be in bootloader mode")
|
raise Exception("Device must be in bootloader mode")
|
||||||
|
|
||||||
resp = self.call(proto.FirmwareErase())
|
data = fp.read()
|
||||||
|
|
||||||
|
resp = self.call(proto.FirmwareErase(length=len(data)))
|
||||||
if isinstance(resp, proto.Failure) and resp.code == types.Failure_FirmwareError:
|
if isinstance(resp, proto.Failure) and resp.code == types.Failure_FirmwareError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
data = fp.read()
|
|
||||||
|
|
||||||
# TREZORv1 method
|
# TREZORv1 method
|
||||||
if isinstance(resp, proto.Success):
|
if isinstance(resp, proto.Success):
|
||||||
fingerprint = hashlib.sha256(data[256:]).hexdigest()
|
fingerprint = hashlib.sha256(data[256:]).hexdigest()
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user