mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-25 16:08:32 +00:00
fix(python): support all image types in firmware-fingerprint.py
[no changelog]
This commit is contained in:
parent
4cd88e16f7
commit
799c420dda
@ -21,7 +21,7 @@ from typing import BinaryIO, TextIO
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from trezorlib import firmware
|
from trezorlib._internal import firmware_headers
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@ -32,7 +32,7 @@ def firmware_fingerprint(filename: BinaryIO, output: TextIO) -> None:
|
|||||||
data = filename.read()
|
data = filename.read()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
click.echo(firmware.parse(data).digest().hex(), file=output)
|
click.echo(firmware_headers.parse_image(data).digest().hex(), file=output)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
click.echo(e, err=True)
|
click.echo(e, err=True)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
Loading…
Reference in New Issue
Block a user