From c31157fea104ff1e86fc39d03336a6d302cdc6cb Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 2 Jul 2014 22:57:55 +0200 Subject: [PATCH] print firmware fingerprint on upload --- trezorlib/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trezorlib/client.py b/trezorlib/client.py index 495a6a1..1e6edbe 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -729,7 +729,11 @@ class ProtocolMixin(object): if isinstance(resp, proto.Failure) and resp.code == types.Failure_FirmwareError: return False - resp = self.call(proto.FirmwareUpload(payload=fp.read())) + data = fp.read() + fingerprint = hashlib.sha256(data[256:]).hexdigest() + log("Firmware fingerprint: " + fingerprint) + resp = self.call(proto.FirmwareUpload(payload=data)) + if isinstance(resp, proto.Success): return True