Loading Data: fall-back to KEF #702
Draft
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.
DRAFT: For a future release AFTER v25.09.0
What is this PR for?
Focus of this PR is to re-prioritize loading of data (scanned or from sd) to be treated as plaintext, within context, instead of first attempting to parse and decrypt a KEF envelope. PSBTs in particular, which are often loaded in binary, form can appear to be KEF, but if they can be parsed as PSBTs first, then user will not have to answer "No". If parsing fails, in this case -- as a PSBT, we could then fall-back to see if it was KEF, and try again after decryption.
Loading of datum-types TO DO:
In some cases, this is not possible, a KEF must be checked first, in cases where data is treated as random bytes
and no other obvious parsing could be done... ie) for mnemonic entropy, passphrases, and for decryption keys we
should check if it's a KEF first (rather than treating 32 bytes as a mnemonic, or base43 text as a passphrase, or a string of bytes as the decryption key when in fact these would normally parse as kef envelopes to prompt decryption... and in the case of a false-KEF the user will know NOT to decrypt.
In most other cases, we could try to parse in plaintext form first, and then fall back to trying KEF if it fails.
Changes made to:
Did you build the code and tested on device?
What is the purpose of this pull request?