Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh-key: Implement SkEcdsaSha2NistP256 signature validation #169

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

nresare
Copy link
Contributor

@nresare nresare commented Oct 16, 2023

I recently obtained a Yubikey Series 5 hardware token with the ability to generate and use sk-ecdsa type keys with openssh. It seemed like a good addition to the ssh-key crate to implement validation of signatures generated using such keys, as this is not yet supported and depending on firmware version of the hardware token, this is sometimes the only key type it can handle.

The signature is generated with OpenSSH_9.5p1 tools and the resulting signature is captured using my https://github.com/nresare/ssh-agent-client-rs library

I have made some slightly more opinionated changes compared to last time around, breaking out shared functionality into private helper functions in signature.rs. Just let me know what you think, and I'm happy to restructure to match your preferences.

This change implements validation of of sk-ecdsa signatures as
emitted by the openssh ssh-agent. The signature format is
analogous to the sk-ed25519 sinature format already supported
by ssh-key
@nresare
Copy link
Contributor Author

nresare commented Oct 16, 2023

I can confirm that building the pam-ssh-agent against this commit will result in a pam module that can authenticate users using a sk-ecdsa type key on a yubikey gen 5 device

@tarcieri
Copy link
Member

Awesome work, thanks! I can hopefully review this weekend.

@nresare
Copy link
Contributor Author

nresare commented Nov 16, 2023

Just a friendly remind of this :)

@tarcieri
Copy link
Member

Sorry, this has been sitting in my inbox and I meant to get to it

ssh-key/src/signature.rs Outdated Show resolved Hide resolved
Copy link
Member

@tarcieri tarcieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little nit which I fixed but otherwise this looks good

@tarcieri tarcieri merged commit fc0195b into RustCrypto:master Nov 18, 2023
13 checks passed
@tarcieri tarcieri mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants