Skip to content

Restore applet-selected bit after authenticatorReset - #66

Open
hibari-tech wants to merge 1 commit into
BryanJacobs:mainfrom
hibari-tech:claude/thai-id-card-project-664387
Open

Restore applet-selected bit after authenticatorReset#66
hibari-tech wants to merge 1 commit into
BryanJacobs:mainfrom
hibari-tech:claude/thai-id-card-project-664387

Conversation

@hibari-tech

Copy link
Copy Markdown

Summary

Fixes #65.

authenticatorReset() calls transientStorage.fullyReset(), which zeroes the entire transient bitfield including the BOOL_IDX_APPLET_SELECTED bit added for extended-length SELECT support (42d16ba / a656edc). Nothing restored it, so after a CTAP2 reset every subsequent command was rejected with SW_INS_NOT_SUPPORTED (0x6D00) until the next SELECT. A CTAP2 reset does not deselect the applet, so the bit must remain set.

Change

One line in authenticatorReset, immediately after fullyReset():

transientStorage.setAppletSelected();

Testing

Bundled Python suite (jCardSim), before: 248 tests, 217 pass, 7 fail, 22 error, 4 skip. Every failure traced to this bug — the classes that issue a CTAP2 reset and then keep using the card (test_ctap_resets, test_auth_config, test_ctap_pins). Classes using softResetCard() (which re-SELECTs) were unaffected.

After: 248 tests, 244 pass, 4 skip, 0 fail / 0 error.

🤖 Generated with Claude Code

authenticatorReset() calls transientStorage.fullyReset(), which zeroes
the whole transient bitfield including the applet-selected bit added for
extended-length SELECT support (42d16ba / a656edc). Nothing restored it,
so after a CTAP2 reset every subsequent command was rejected with
SW_INS_NOT_SUPPORTED (0x6D00) until the next SELECT.

Re-set the bit after fullyReset(). The full Python suite now passes:
248 tests, 244 pass, 4 skip, 0 fail / 0 error.

Refs BryanJacobs#65

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

authenticatorReset clears the applet-selected bit, breaking all commands until re-SELECT (regression)

1 participant