Skip to content

Preserve card nonce after invalid signature - #73

Merged
reez merged 1 commit into
bitcoindevkit:masterfrom
bitcoinppl:more-hardening
Aug 10, 2026
Merged

Preserve card nonce after invalid signature#73
reez merged 1 commit into
bitcoindevkit:masterfrom
bitcoinppl:more-hardening

Conversation

@praveenperera

Copy link
Copy Markdown
Contributor

Summary

  • store the next card nonce before parsing the check response signature
  • add a test for a malformed signature response

Why

A successful check command changes the nonce on the card. If signature parsing
fails before the library stores the returned nonce, the card object keeps the
old value. Later authenticated commands can then fail.

This is a follow-up to #72.

Validation

  • cargo fmt --all --check
  • cargo test -p rust-cktap
  • cargo clippy --all-features --all-targets -- -D warnings

Store the response nonce before parsing the certificate check signature
so later authenticated commands use the current card nonce.

Add a transport-level test for malformed signatures.
@praveenperera
praveenperera marked this pull request as ready for review August 10, 2026 20:05

@reez reez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 1e1d0bc

+Regression test covers the malformed signature early return path

@reez
reez merged commit b4cfcc2 into bitcoindevkit:master Aug 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants