1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +00:00

python/trezorctl: display embedded v2 image fingerprint (fixes #977)

This commit is contained in:
Serge 2020-05-03 18:47:40 +03:00 committed by matejcik
parent 2424d1ee18
commit 4e25c396d2

View File

@ -70,6 +70,13 @@ def validate_firmware(version, fw, expected_fingerprint=None):
fingerprint = firmware.digest(version, fw).hex()
click.echo("Firmware fingerprint: {}".format(fingerprint))
if version == firmware.FirmwareFormat.TREZOR_ONE and fw.embedded_onev2:
fingerprint_onev2 = firmware.digest(
firmware.FirmwareFormat.TREZOR_ONE_V2, fw.embedded_onev2
).hex()
click.echo(
"Embedded v2 image fingerprint: {}".format(fingerprint_onev2)
)
if expected_fingerprint and fingerprint != expected_fingerprint:
click.echo("Expected fingerprint: {}".format(expected_fingerprint))
click.echo("Fingerprints do not match, aborting.")