Repository navigation
Support ECC key import in all asymmetric slots - #56
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
force-pushed
the
feat/ecc-import
branch
from
October 8, 2026 23:38
df36b04 to
08ffd56
Compare
FlorianFranzen
added a commit
to FlorianFranzen/piv-authenticator
that referenced
this pull request
Oct 16, 2026
FlorianFranzen
added a commit
to FlorianFranzen/piv-authenticator
that referenced
this pull request
Oct 16, 2026
FlorianFranzen
added a commit
to FlorianFranzen/piv-authenticator
that referenced
this pull request
Oct 16, 2026
…ep one, with the curve25519 arm
|
Hijacking this thread: could anybody tell my why there is an artificial restriction into only allowing importing keys into slot 9D and not e.g. into the retired ones? I couldn't find anything reasoning. Is this maybe, because retired slots got introduced only later into the firmware and this restriction is a remnant? |
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.
The Yubico IMPORT ASYMMETRIC KEY extension only accepted RSA keys, and only into slot 9A. This adds a P-256/P-384 arm that reads the private scalar from DO
0x06(zero-padded to the curve's scalar size, as ykman and yubikey.rs send it), injects it through the existingunsafe_inject_keypath, and accepts every asymmetric key reference including the retired slots. The RSA path is left as it is. The PIN and touch policy DOs those clients append are ignored, as GENERATE ASYMMETRIC ignores them today.The zero scalar is rejected in the app because the software fallback behind the virt platform accepts it while real backends reject it, which keeps behaviour identical across backends; an out-of-range scalar is rejected by the backend.
Tests import into 9A, 9C, 9E and retired slots, exercise the per-slot PIN conditions, verify the resulting ECDSA signatures against verifying keys recomputed from the imported scalars (ECDSA is randomized, so signature bytes cannot be compared directly), and reject truncated, wrong-curve, all-zero and out-of-range scalars.
Refs #16