-
Notifications
You must be signed in to change notification settings - Fork 5
Move To Yubikey 8 #27
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
base: main
Are you sure you want to change the base?
Conversation
src/yubikey/piv/management.rs
Outdated
[0u8; 20], | ||
None, | ||
&[RelativeDistinguishedName::common_name(common_name)], | ||
SerialNumber::new(&[0; 8]).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should generate a random serial
/// Provisions the YubiKey with a new certificate generated on the device. | ||
/// Only keys that are generated this way can use the attestation functionality. | ||
pub fn provision( | ||
pub fn provision<KT: yubikey_signer::KeyType>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we hide this away and just provide two non-generic functions for p256 and p384
PublicKeyInfo::Rsa { pubkey: _, .. } => panic!("RSA keys not supported"), | ||
PublicKeyInfo::EcP256(pubkey) => (pubkey.as_bytes().to_vec(), AlgorithmId::EccP256), | ||
PublicKeyInfo::EcP384(pubkey) => (pubkey.as_bytes().to_vec(), AlgorithmId::EccP384), | ||
let cert = yk.configured(&slot).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been tested
New Yubikeys come with AES rather than TDES management keys so we need to support that. Support is forthcoming in a new version of the Yubikey library but that means we must be current to get it. This upgrades us from Yubikey 0.7 to Yubikey 0.8.
This is still a work in progress, it compiles and appears to work but I'm not thrilled with the new API, nor the need to pull in both p256 and p384. Technically we should be able to get rid of those by creating our own types and implementing KeyType for them via
ring
but I don't know how much effort this is going to be.