What changed, and why it matters
This commit only changes test code for the COLDCARD firmware. It makes the test suite more stable by letting developers specify a custom Bitcoin daemon path, adding a PSBT2 test flag, fixing a test that checks upload-during-approval behavior, and importing an extra constant for user-interface tests. None of these changes affect the actual firmware that runs on the device, so there is no security risk to users.
No security action needed. Treat as routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is confined to the testing/ directory. Changes: (1) find_bitcoind() now respects CC_TEST_BITCOIND environment variable before falling back to PATH lookup; (2) run_sim_tests.py passes –psbt2 to pytest when args.psbt2 is set; (3) test_sign.py’s test_upload_during_approval is adjusted to upload from offset 0 with real PSBT bytes plus padding and assert offset 0 is returned; (4) test_ux.py adds an import of OUT_CTRL_ADDRESS. No firmware source, protocol implementation, or cryptographic code is modified.
Changed components
testing/api.pytesting/run_sim_tests.pytesting/test_sign.pytesting/test_ux.pyInspect captured patch +11 / −3
### testing/api.py
@@ -11,6 +11,10 @@
def find_bitcoind():
# search for the binary we need
# - should be in the path really
+ env_path = os.environ.get("CC_TEST_BITCOIND", None)
+ if env_path:
+ return env_path
+
easy = shutil.which('bitcoind')
if easy:
return easy
### testing/run_sim_tests.py
@@ -493,6 +493,8 @@ def add_to_queue(module_name, simulator_args, queue):
out_fd = open(out_log_path, "w")
cmd_list = ["pytest", "--cache-clear", "-m", DEFAULT_PYTEST_MARKS, "--sim",
mn, "--sim-socket", sim.socket]
+ if args.psbt2:
+ cmd_list.append("--psbt2")
if k:
cmd_list.extend(["-k", k])
p = subprocess.Popen(cmd_list, preexec_fn=os.setsid, stdout=out_fd, stderr=out_fd)
### testing/test_sign.py
@@ -4168,8 +4168,10 @@ def test_upload_during_approval(dev, fake_txn, start_sign, end_sign, cap_story,
# attacker host rewrites an aligned block mid-approval: allowed at USB
# layer (a new upload may supersede a pending request), but must be
# caught before any signature is produced
- rv = dev.send_recv(CCProtocolPacker.upload(256, len(in_psbt), bytes(256)))
- assert rv == 256
+ rv = dev.send_recv(CCProtocolPacker.upload(
+ 0, len(in_psbt), in_psbt[:256] + bytes(256)
+ ))
+ assert rv == 0
# user approves what was originally displayed; must not sign
need_keypress('y')
### testing/test_ux.py
@@ -3,7 +3,7 @@
import pytest, time, os, re, hashlib, shutil, functools, ndef
from binascii import b2a_hex
from helpers import xfp2str, prandom
-from charcodes import KEY_QR, KEY_NFC, KEY_DELETE, KEY_ENTER
+from charcodes import KEY_QR, KEY_NFC, KEY_DELETE, KEY_ENTER, OUT_CTRL_ADDRESS
from constants import AF_CLASSIC, simulator_fixed_words, simulator_fixed_xfp
from mnemonic import Mnemonic
from bip32 import BIP32NodeWhy 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.