What changed, and why it matters
This commit only changes test code for the COLDCARD firmware. It adjusts how a test sets up a 'hobbled' Teleport signing scenario by importing wallet data before hobbled mode is enabled, and removes an unused test parameter. There is no change to the actual firmware or wallet behavior, and no security issue is present in the diff.
No action required; this is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies two test files: testing/test_multisig.py and testing/test_teleport.py. In test_multisig.py, select_wallet() gains an optional no_import flag. In test_teleport.py, the test_teleport_ms_sign test removes the incl_xpubs parameter, always imports the multisig config via do_import=True, and in hobbled mode pre-imports wallets before enabling hobbling. This is a test-only refactor/fixture adjustment with no production code changes.
Changed components
testing/test_multisig.pytesting/test_teleport.pyInspect captured patch +17 / −11
diff --git a/testing/test_multisig.py b/testing/test_multisig.py
index 190c597..a2a49d3 100644
--- a/testing/test_multisig.py
+++ b/testing/test_multisig.py
@@ -1256,18 +1256,18 @@ def make_myself_wallet(dev, set_bip39_pw, offer_ms_import, press_select, clear_m
time.sleep(.1)
press_select()
- def select_wallet(idx):
+ def select_wallet(idx, no_import=False):
# select to specific pw
print(f"--- switch to another leg of MS: {idx} ---")
xfp = set_bip39_pw(passwords[idx])
- if do_import:
+ if do_import and not no_import:
offer_ms_import(config)
time.sleep(.1)
press_select()
assert xfp == keys[idx][0]
return xfp
- return (keys, select_wallet)
+ return keys, select_wallet
yield doit
diff --git a/testing/test_teleport.py b/testing/test_teleport.py
index 320e846..601265a 100644
--- a/testing/test_teleport.py
+++ b/testing/test_teleport.py
@@ -420,13 +420,12 @@ def test_tx_wrong_pub(rx_start, tx_start, cap_menu, enter_complex, pick_menu_ite
@pytest.mark.parametrize('num_ins', [ 15 ])
@pytest.mark.parametrize('M', [4])
@pytest.mark.parametrize('hobbled', [True, False])
-@pytest.mark.parametrize('incl_xpubs', [ False ])
def test_teleport_ms_sign(M, use_regtest, make_myself_wallet, num_ins, dev, clear_ms, hobbled,
- fake_ms_txn, try_sign, incl_xpubs, bitcoind, cap_story, need_keypress,
+ fake_ms_txn, try_sign, bitcoind, cap_story, need_keypress,
cap_menu, pick_menu_item, grab_payload, rx_complete, press_select,
ndef_parse_txn_psbt, press_nfc, nfc_read, settings_get, settings_set,
txid_from_export_prompt, sim_root_dir, set_hobble, readback_bbqr,
- nfc_is_enabled, goto_home):
+ nfc_is_enabled, goto_home, restore_main_seed):
# IMPORTANT: won't work if you start simulator with --ms flag. Use no args
all_out_styles = list(unmap_addr_fmt.keys())
@@ -436,24 +435,31 @@ def test_teleport_ms_sign(M, use_regtest, make_myself_wallet, num_ins, dev, clea
use_regtest()
# create a wallet, with 3 bip39 pw's
- keys, select_wallet = make_myself_wallet(M, addr_fmt="p2wsh", do_import=(not incl_xpubs))
+ keys, select_wallet = make_myself_wallet(M, addr_fmt="p2wsh", do_import=True)
N = len(keys)
assert M<=N
if hobbled:
+ # we need to import before hobbled mode is enabled
+ for i in range(3): # 4th is simulator (ignore)
+ select_wallet(i)
+
+ restore_main_seed(preserve_settings=True)
+ time.sleep(.1)
+
set_hobble(True, {'okeys'})
goto_home()
- psbt = fake_ms_txn(num_ins, num_outs, M, keys, inp_af=AF_P2WSH, incl_xpubs=incl_xpubs,
+ psbt = fake_ms_txn(num_ins, num_outs, M, keys, inp_af=AF_P2WSH,
outstyles=all_out_styles, change_outputs=list(range(1,num_outs)))
with open(f'{sim_root_dir}/debug/myself-before.psbt', 'wb') as f:
f.write(psbt)
cur_wallet = 0
- my_xfp = select_wallet(cur_wallet)
+ my_xfp = select_wallet(cur_wallet, no_import=hobbled)
- _, updated = try_sign(psbt, accept_ms_import=incl_xpubs, exit_export_loop=False)
+ _, updated = try_sign(psbt, accept_ms_import=False, exit_export_loop=False)
with open(f'{sim_root_dir}/debug/myself-after-1.psbt', 'wb') as f:
f.write(updated)
assert updated != psbt
@@ -508,7 +514,7 @@ def test_teleport_ms_sign(M, use_regtest, make_myself_wallet, num_ins, dev, clea
assert msg in story
# switch personalities, and try to read that QR
- new_xfp = select_wallet(idx)
+ new_xfp = select_wallet(idx, no_import=hobbled)
assert new_xfp == next_xfp
my_xfp = next_xfp
assert settings_get('xfp') == my_xfp
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.