What changed, and why it matters
This commit removes a line that made a Bitcoin PSBT (Partially Signed Bitcoin Transaction) safety check always return success before doing any real verification. The title says 'add mfp check' (master fingerprint check), but the actual code change mostly re-enables an existing check that had been short-circuited. A master fingerprint check helps ensure the transaction was built for this specific hardware wallet, reducing the risk of signing a transaction meant for someone else's wallet. The commit also contains unrelated build and simulator tweaks.
Review the full utxo_check_psbt_extend function and its callers to confirm the master fingerprint is compared against the device's actual fingerprint, not just checked for length. Verify the change is present in release firmware and that the simulator debug macro is not enabled in production builds. Consider adding regression tests to ensure the early-return bypass cannot be reintroduced.
Security signals we found
Removal of an early unconditional success return that bypassed validation
Re-enabling of master fingerprint length validation in a Bitcoin transaction signing path
Title 'add mfp check' suggests the intent was to enforce master fingerprint verification
Evidence from the diff
In rust/rust_c/src/bitcoin/psbt.rs, the function utxo_check_psbt_extend previously began with return TransactionCheckResult::new().c_ptr();, causing it to return a success result immediately and skip the master-fingerprint length validation and subsequent PSBT checks. The patch deletes that early return, so the function now validates length != 4 and presumably continues with the intended checks. The other changed files are incidental: build.bat switches py to python, Cargo.lock changes git URL formatting, and ui_simulator/simulator_model.c toggles a debug macro for reading QR data from the screen.
Changed components
rust/rust_c/src/bitcoin/psbt.rs::utxo_check_psbt_extendBitcoin PSBT signing/validation flowui_simulator/simulator_model.c (debug QR capture macro, not production firmware)Inspect captured patch +4 / −5
diff --git a/build.bat b/build.bat
index b2cfe49..f0dd0af 100644
--- a/build.bat
+++ b/build.bat
@@ -72,7 +72,7 @@ IF "%build_simulator%"=="true" (
) ELSE (
make -j16 -O
)
- py padding_bin_file.py mh1903.bin
+ python padding_bin_file.py mh1903.bin
popd
)
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 9d931d9..4368d3f 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -4789,7 +4789,7 @@ dependencies = [
[[package]]
name = "ur-parse-lib"
version = "0.2.0"
-source = "git+https://github.com/KeystoneHQ/keystone-sdk-rust.git?branch=support_crypto_extend#414ecb6cc3730d780067dc52754b5c2f61a6cc7b"
+source = "git+https://git@github.com/KeystoneHQ/keystone-sdk-rust.git?branch=support_crypto_extend#414ecb6cc3730d780067dc52754b5c2f61a6cc7b"
dependencies = [
"hex",
"ur",
@@ -4799,7 +4799,7 @@ dependencies = [
[[package]]
name = "ur-registry"
version = "0.1.1"
-source = "git+https://github.com/KeystoneHQ/keystone-sdk-rust.git?branch=support_crypto_extend#414ecb6cc3730d780067dc52754b5c2f61a6cc7b"
+source = "git+https://git@github.com/KeystoneHQ/keystone-sdk-rust.git?branch=support_crypto_extend#414ecb6cc3730d780067dc52754b5c2f61a6cc7b"
dependencies = [
"bs58 0.5.1",
"core2",
diff --git a/rust/rust_c/src/bitcoin/psbt.rs b/rust/rust_c/src/bitcoin/psbt.rs
index 4728df0..3848ad5 100644
--- a/rust/rust_c/src/bitcoin/psbt.rs
+++ b/rust/rust_c/src/bitcoin/psbt.rs
@@ -396,7 +396,6 @@ pub extern "C" fn utxo_check_psbt_extend(
verify_code: PtrString,
multisig_wallet_config: PtrString,
) -> PtrT<TransactionCheckResult> {
- return TransactionCheckResult::new().c_ptr();
if length != 4 {
return TransactionCheckResult::from(RustCError::InvalidMasterFingerprint).c_ptr();
}
diff --git a/ui_simulator/simulator_model.c b/ui_simulator/simulator_model.c
index fcb2be4..0f293b0 100644
--- a/ui_simulator/simulator_model.c
+++ b/ui_simulator/simulator_model.c
@@ -21,7 +21,7 @@ bool g_reboot = false;
bool g_otpProtect = false;
// Comment out this macro if you need to retrieve data from the file
-// #define GET_QR_DATA_FROM_SCREEN
+#define GET_QR_DATA_FROM_SCREEN
void OTP_PowerOn(void)
{
Why this scored 57/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.