Repository navigation
Conversation
6 of 18 tasks
…s-v2 # Conflicts: # src/seedsigner/models/psbt_parser.py # tests/test_flows_psbt.py # tests/test_psbt_parser.py
Author
|
@newtonick @kdmukai just resolved the merge conflicts again |
Author
|
@newtonick do you want to take another look before we run into merge conflicts again? 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Supersedes #1039, rebased onto the current
dev(after #995 and the OP_RETURN parsing rework).Problem or Issue being addressed
Malformed QR input to the SettingsQR and
signmessageparsers still raises uncaughtIndexError/ValueErrorinstead of being rejected in-band. On the device this shows up as the unhandled-exception screen, or in thesignmessagecase a silent return to the Main Menu with no error shown.A PSBT whose external output pays to a script embit can't render as an address (bare multisig,
OP_TRUE, an empty script, ...) also escapes the parse with a bareValueErrorfromscript_pubkey.address(), whichPSBTOverviewViewdoesn't catch.Solution
Settings.parse_settingsqr(): raiseInvalidSettingsQRDatafor a header with no settings, an emptyname=, and an entry with no=.SignMessageQrDecoder.add(): returnDecodeQRStatus.INVALIDwhen the{derivation_path} {fmt}:{message}part is missing or truncated.DecodeQR.add_data(): when a recognized decoder returnsINVALID, setqr_type = INVALIDsoScanViewroutes toScanInvalidQRTypeViewinstead of falling through to the Main Menu.PSBTParser._parse_outputs(): raise a newPSBTUnsupportedOutputScriptError(aPSBTVerificationError) when an external output has no address representation. It routes to a newPSBTUnsupportedOutputScriptView, a Warning-level discard screen modeled onPSBTMalformedOpReturnView.Additional Information
Compared with #1039, the old
psbt_parser.pychanges were dropped:Nonepolicy type case is now covered by [security] Verify PSBT input amounts before displaying the fee #995: an unrecognized input without anon_witness_utxois refused asPSBTInputAmountVerificationError(seetest_unrecognized_script_type_without_non_witness_utxo_raises). With anon_witness_utxo, it hits theUnsupported policy typecatch-all.What's still missing is the unrecognized output case above.
Sample SeedQR to sign the psbt (set the network to regtest):
model ensure search plunge galaxy firm exclude brain satoshi meadow cable roastSample payload QRs (all fail on current
dev):Screenshots
Before and after:
The SettingsQR cases still land on the generic error screen, which is how
SettingsIngestSettingsQRViewroutes a parse failure today. They now show a readableInvalidSettingsQRDatamessage instead of anIndexError/ValueError.This pull request is categorized as a:
Checklist
I ran
pytestlocallydevwithout compiled translations)I added or updated tests