Repository navigation
Add piv admin keys with a one-shot default-key check - #26
Merged
Merged
Conversation
List the admin security domain's key table without authenticating. With --check-default, authenticate once to key version 1 with the GlobalPlatform default key: success is a completed authentication and leaves the card's failed-authentication count clear; a wrong key is reported as one counted failure that the next successful `piv admin authenticate` clears. A refused INITIALIZE UPDATE is a new InitializeUpdateRejected error and reported as undetermined. The check is skipped under --dry-run or when the table has no key version 1, and never tries a second key. Co-Authored-By: Claude Fable 5.1 <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.
piv admin keys: the admin security domain's key table (versions, key IDs, types, lengths), read without authenticating. Same read aspiv admin status; the table rendering is shared.--check-default: exactly one authentication to key version 1 with the publicly known GlobalPlatform test key, with a warning first.piv admin authenticateclears.InitializeUpdateRejected, raised fromPivAdmin.open) is reported as undetermined.--dry-runor when the key table has no key version 1. It never tries a second key.ssd.pygainsCUSTOMER_KEY_VERSION = 1andCRYPTNOX_KEY_VERSION = 2for the rotation commands to come.admin statuspayload plusdefault_key_check(null, orperformed,key_version,answers_to_default,failed_authentication_counted,detail).Both outcomes verified on a D600 development card: the default-key success path, and a wrong-key failure through the same
open()call cleared by the following default-key authentication. Ruff, 512 pytest, Sphinx-Wall green.🤖 Generated with Claude Code