Skip to content

Commit 31ebb30

Browse files
committed
Merge branch 'describe'
2 parents 4d2434f + ee4f14b commit 31ebb30

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

releases/describe_signed_firmware.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,19 @@ def main() -> int:
5454
magic, rest = signed_firmware[:MAGIC_LEN], signed_firmware[MAGIC_LEN:]
5555
sigdata, firmware = rest[:SIGDATA_LEN], rest[SIGDATA_LEN:]
5656

57-
print(
58-
"The following information assumes the provided binary was signed correctly; "
59-
"the signatures are not being verified."
60-
)
6157
if magic == MAGIC_MULTI:
6258
print("This is a Multi-edition firmware.")
6359
elif magic == MAGIC_BTCONLY:
6460
print("This is a Bitcoin-only edition firmware.")
6561
else:
66-
print("Unrecognized firmware edition; magic =", magic.hex())
62+
print(
63+
f"Unrecognized firmware edition; magic = f{magic.hex()}. Maybe you have accidentally invoked this script on an unsigned binary. Make sure to use a signed firmware binary."
64+
)
65+
return 1
66+
print(
67+
"The following information assumes the provided binary was signed correctly; "
68+
"the signatures are not being verified."
69+
)
6770

6871
firmware_padded = firmware + b"\xFF" * (MAX_FIRMWARE_SIZE - len(firmware))
6972

0 commit comments

Comments
 (0)