tests: expect pset failures on non-psram devices
What changed, and why it matters
This commit only changes test code. It tells the test suite to skip or expect failures for certain large Bitcoin/Liquid transaction tests on devices without extra memory (non-PSRAM). It does not change the actual wallet firmware or fix a security bug in production code.
No security action required for this commit. Treat as a testing-infrastructure change. If investigating the underlying message-stream desync, track it as a reliability/robustness issue rather than a vulnerability unless further evidence shows exploitable behavior.
Security signals we found
Test-only change
References message-stream desync for oversized messages on non-PSRAM devices
No production/firmware code modified
Evidence from the diff
The diff modifies test_jade.py so that test_sign_psbt accepts a has_psram flag. For non-PSRAM devices, it skips PSBT inputs larger than the MAX_INPUT_MSG_SIZE limit and skips/expects failure for PSET (Liquid) cases. This is a test-harness adjustment to avoid false failures caused by message-stream desync on memory-constrained hardware; no runtime code is patched.
Changed components
test_jade.pyInspect captured patch +23 / −6
diff --git a/test_jade.py b/test_jade.py
index 885fda7..381e846 100644
--- a/test_jade.py
+++ b/test_jade.py
@@ -3024,11 +3024,28 @@ def test_liquid_blinded_commitments(jadeapi):
assert rslt == ledger_commitments[1]
-def test_sign_psbt(jadeapi, cases):
+def test_sign_psbt(jadeapi, cases, has_psram):
for txn_data in _get_test_cases(cases):
+ # Expect PSET test cases to fail for non-PSRAM devices
+ psbt_bin = txn_data['input']['psbt']
+
+ expect_pset_failure = False
+ if not has_psram:
+ # Max message size from main/process.h
+ # 69 bytes of overhead for a sign_psbt request
+ MAX_INPUT_MSG_SIZE = 1024 * 17 + 69
+ if len(psbt_bin) + 69 > MAX_INPUT_MSG_SIZE:
+ logger.warning(f'Skipping {txn_data["filename"]} large PSBT on non-psram device')
+ continue
+ if psbt_bin[2] == ord('e'):
+ expect_pset_failure = True
+ continue
+
try:
- rslt = jadeapi.sign_psbt(txn_data['input']['network'], txn_data['input']['psbt'])
+ rslt = jadeapi.sign_psbt(txn_data['input']['network'], psbt_bin)
except JadeError as err:
+ if expect_pset_failure:
+ continue # Trying to parse a PSET on an unsupported device
if 'expected_output' in txn_data:
# We expected this test to pass
assert False, f'FAILED: {err.message}: {txn_data}'
@@ -3737,8 +3754,8 @@ def run_api_tests(jadeapi, isble, qemu, authuser=False):
test_sign_tx(jadeapi, SIGN_LIQUID_TXN_TESTS, has_psram)
# Test sign psbts (app-generated cases)
- test_sign_psbt(jadeapi, SIGN_PSBT_TESTS)
- test_sign_psbt(jadeapi, SIGN_PSET_TESTS)
+ test_sign_psbt(jadeapi, SIGN_PSBT_TESTS, has_psram)
+ test_sign_psbt(jadeapi, SIGN_PSET_TESTS, has_psram)
# Short sanity-test of 12-word mnemonic
test_12word_mnemonic(jadeapi)
@@ -3772,9 +3789,9 @@ def run_api_tests(jadeapi, isble, qemu, authuser=False):
# - Mixed wallet and non-wallet inputs
# - Unusual input and change paths
# - Negative test cases (invalid PSBTs)
- test_sign_psbt(jadeapi, SIGN_PSBT_SS_TESTS)
+ test_sign_psbt(jadeapi, SIGN_PSBT_SS_TESTS, has_psram)
# Singlesig Liquid (PSET) tests
- test_sign_psbt(jadeapi, SIGN_PSET_SS_TESTS)
+ test_sign_psbt(jadeapi, SIGN_PSET_SS_TESTS, has_psram)
# Sign identity (ssh & gpg) tests require a specific mnemonic
rslt = jadeapi.set_mnemonic(TEST_MNEMONIC_12_IDENTITY)
Why this scored 11/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.