Repository navigation
btc: require verified silent payment outputs - #190
benma-agent wants to merge 2 commits into
Conversation
Repeated literals keep test inputs and expected results readable. Exclude goconst from all _test.go files while retaining it for production code.
BTCSign could return successfully when the device omitted a generated silent payment script or skipped the output exchange entirely. In both cases the host skipped proof verification and left the original PSBT output script unchanged. Require a generated script for each silent payment output exchange, verify it before recording it, and reject completion unless every requested silent payment has a verified output. Reject generated silent payment data on ordinary outputs as well. Add regressions for omitted exchanges, missing or invalid proofs, duplicate output requests, and valid mixed outputs. Keep the shared firmware vectors unchanged and handle older firmware's acceptance of silent payment metadata on owned outputs in the Go runner, expecting the host to reject the missing script. Failed signing must leave PSBT signatures and output scripts unchanged.
4033c84 to
ec282be
Compare
| if next.GeneratedOutputPkscript != nil { | ||
| generatedOutputs[int(outputIndex)] = next.GeneratedOutputPkscript | ||
| if output.SilentPayment != nil { | ||
| if len(next.GeneratedOutputPkscript) == 0 { |
There was a problem hiding this comment.
Nit: could we drop the explicit script-length check and let silentPaymentOutputVerify reject the missing/empty script? Now that verification is triggered by output.SilentPayment != nil, it already covers this case. Unless we specifically want the more precise error message, the extra check seems redundant.
Beerosagos
left a comment
There was a problem hiding this comment.
utACK, with a small nit. See comment
|
[P2] Clear the signing workflow before returning this error For Reproduced with both signing APIs across all six affected simulators; base-revision follow-up requests succeed. The failed follow-up clears the workflow, but unnecessarily costs the caller another request/retry. Please reject conflicting |
BTCSign could succeed when the device omitted a generated silent payment script
or skipped the output exchange entirely. Require a verified generated script for
every requested silent payment before returning signatures, and reject generated
silent payment data on ordinary outputs.
Add regression coverage for omitted exchanges, missing or invalid proofs,
duplicate output requests, and valid mixed outputs. Keep the shared firmware
vectors unchanged and handle older firmware's acceptance of silent payment
metadata on owned outputs in the Go runner. Failed signing must leave PSBT
signatures and output scripts unchanged.
Includes commit ac372fc from #188 before the signing fix to disable goconst for
test files while retaining the rule for production code.