jade_ota.py: be more helpful when --no-extended-replies is/is not needed
What changed, and why it matters
This commit is a tiny user-experience improvement in a helper script for updating Jade hardware wallet firmware. It changes an internal assertion message to be more helpful when the user has provided the wrong command-line flag for extended replies. There is no security-relevant change.
No security action needed. Treat as a normal non-security code-quality commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In jade_ota.py, the OTA test helper previously asserted that the negotiated extended_reply value matched the –extended-replies/–no-extended-replies flag, with a bare AssertionError. The patch replaces the bare assert with an equivalent conditional that raises AssertionError with a descriptive message telling the user to use or remove –no-extended-replies. The logic and control flow are unchanged; only the error message is improved.
Changed components
jade_ota.pyInspect captured patch +3 / −2
diff --git a/jade_ota.py b/jade_ota.py
index d83c072..024bc53 100755
--- a/jade_ota.py
+++ b/jade_ota.py
@@ -278,9 +278,10 @@ def ota(jade, fwcompressed, fwlength, fwhash, patchlen, extended_replies, pushmn
nonlocal last_written
# For the purposes of this test we usually assume the hw supports
- # extended replies. Use --no-extended-reply if this is not the case
+ # extended replies. Use --no-extended-replies if this is not the case
# (eg. updating from older firmware).
- assert (extended_reply is not None) == (extended_replies is True)
+ if (extended_reply is not None) != (extended_replies is True):
+ assert False, 'Extended replies mismatch. Use (or remove) --no-extended-replies'
current_time = time.time()
secs = current_time - last_time
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.