yubikey 0.5

This commit is contained in:
Jack Grigg
2021-11-21 15:51:54 +00:00
parent b486276421
commit 822a10f8f6
3 changed files with 54 additions and 144 deletions
+2 -2
View File
@@ -110,8 +110,8 @@ impl Metadata {
// using the same certificate extension as PIV attestations.
// https://developers.yubico.com/PIV/Introduction/PIV_attestation.html
let policies = |c: &X509Certificate| {
c.extensions()
.get(&Oid::from(POLICY_EXTENSION_OID).unwrap())
c.tbs_certificate
.find_extension(&Oid::from(POLICY_EXTENSION_OID).unwrap())
// If the encoded extension doesn't have 2 bytes, we assume it is invalid.
.filter(|policy| policy.value.len() >= 2)
.map(|policy| {