Skip to content

Conversation

obelisk
Copy link
Owner

@obelisk obelisk commented Apr 16, 2025

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.

[0u8; 20],
None,
&[RelativeDistinguishedName::common_name(common_name)],
SerialNumber::new(&[0; 8]).unwrap(),
Copy link
Owner Author

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>(
Copy link
Owner Author

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();
Copy link
Owner Author

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant