Restore applet-selected bit after authenticatorReset - #66
Open
hibari-tech wants to merge 1 commit into
Open
Conversation
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>
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.
Summary
Fixes #65.
authenticatorReset()callstransientStorage.fullyReset(), which zeroes the entire transient bitfield including theBOOL_IDX_APPLET_SELECTEDbit added for extended-lengthSELECTsupport (42d16ba/a656edc). Nothing restored it, so after a CTAP2 reset every subsequent command was rejected withSW_INS_NOT_SUPPORTED(0x6D00) until the nextSELECT. A CTAP2 reset does not deselect the applet, so the bit must remain set.Change
One line in
authenticatorReset, immediately afterfullyReset():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 usingsoftResetCard()(which re-SELECTs) were unaffected.After: 248 tests, 244 pass, 4 skip, 0 fail / 0 error.
🤖 Generated with Claude Code