Repository navigation
Reset the security state on SELECT - #50
Open
FlorianFranzen wants to merge 1 commit into
Open
FlorianFranzen wants to merge 1 commit into
FlorianFranzen wants to merge 1 commit into
Conversation
FlorianFranzen
added a commit
to FlorianFranzen/piv-authenticator
that referenced
this pull request
Oct 16, 2026
- 7b8aee4 Reset the security state on SELECT
This branch has not been deployed
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.
Selecting the PIV application now resets the security state (PIN verification and management authentication), like a YubiKey does. Both Yubico client libraries rely on this to read the retry counter: libykpiv (
ykpiv_get_pin_retries) and yubikey.rs (get_pin_retries) re-select the application to drop the PIN verification and then send VERIFY without data, and would otherwise mistake a verified session for one with no retries left. A verified PIN surviving a re-select is also wrong on its own: a second host process selecting the application would inherit the first one's verification.Tested in
command_response.ron: after VERIFY and management authentication, a SELECT makes VERIFY with no data report the remaining retries again and makes PUT DATA fail with SecurityStatusNotSatisfied.Found while provisioning the vpicc virtual card end to end with a yubikey.rs based tool.