Skip to content

feat(keygen): enroll and download FIDO security keys - #347

Merged
inureyes merged 1 commit into
mainfrom
feature/issue-337-security-key-enrollment
Oct 22, 2026
Merged

inureyes merged 1 commit into
mainfrom
feature/issue-337-security-key-enrollment

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

Enroll ed25519-sk and ecdsa-sk credentials and download resident keys with bssh-keygen -K, using either the built-in provider or an OpenSSH sk-api library. Add provider selection, PIN entry, supported -O options, OpenSSH key files, and unique portable resident filenames.

The built-in provider implements CTAP2 makeCredential, PIN protocols 1/2 with scoped credential-management tokens, and U2F registration. It verifies packed/U2F registration signatures, accepts unsigned none attestations as OpenSSH does, and enforces requested credential protection. External responses receive bounded validation and zeroizing cleanup.

Built-in resident enrollment requires a PIN and credential management to avoid replacing an existing application/user credential. write-attestation is explicitly unsupported; ssh-key limits serialized handles to 255 bytes. Documentation and CLI help describe these boundaries.

Validation

  • All 132 security-key tests pass, covering protocol flows, native C ABI cleanup, malformed responses, attestations, and real OpenSSH ssh-keygen parsing of both algorithms.
  • Repository gates pass: 1,951 library tests (7 ignored), 105 binary tests, 16 server/CLI integration tests, 14 Python contract tests, all-target clippy with warnings denied, and formatting.
  • Physical-authenticator validation remains pending because no HID device is available. No GitHub CI success is claimed.

Closes #337

Add external sk-api enrollment and resident downloads, internal CTAP2 makeCredential and PIN credential management, and U2F registration. Verify signed attestations and enforce credential protection, bounded parsing, and safe key-file publication.

Expose OpenSSH security-key types and options in bssh-keygen, preserving resident credentials with portable unique filenames. Document unsupported attestation export, credential-management requirements, and the ssh-key handle limit.

Validate with security-key protocol/FFI tests, OpenSSH key-file parsing, CLI tests, and targeted clippy. Physical-authenticator validation remains pending because no device is available.

Closes #337
@inureyes inureyes added type:enhancement New feature or request priority:medium Medium priority issue status:done Completed labels Oct 22, 2026
@inureyes
inureyes merged commit f2d5e05 into main Oct 22, 2026
5 checks passed
@inureyes
inureyes deleted the feature/issue-337-security-key-enrollment branch October 22, 2026 15:04
inureyes added a commit that referenced this pull request Oct 22, 2026
Correct the compatibility ledger after #347: bssh-keygen now enrolls both SK algorithms and downloads resident credentials through either provider. Preserve the remaining WebAuthn and physical-device validation gaps and document the enrollment restrictions.

Validation: compared the ledger with the merged implementation and man page; diff checks pass. Final integrated contract tests passed (31 Rust tests and 14 Python tests).

Refs #337
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:done Completed type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(keygen): enroll FIDO security keys and load resident keys

1 participant