Skip to content

Commit 4a2d996

Browse files
authored
Relax root CA AKI field checks (#11462)
* Relax root CA AKI field checks Closes #11461. Signed-off-by: William Woodruff <[email protected]> * CHANGELOG: record changes Signed-off-by: William Woodruff <[email protected]> --------- Signed-off-by: William Woodruff <[email protected]>
1 parent 932b8a3 commit 4a2d996

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Changelog
1212
not be empty.
1313
* Added support for timestamp extraction to the
1414
:class:`~cryptography.fernet.MultiFernet` class.
15+
* Relax the Authority Key Identifier requirements on root CA certificates
16+
during X.509 verification to allow fields permitted by :rfc:`5280` but
17+
forbidden by the CA/Browser BRs.
1518

1619
.. _v43-0-0:
1720

src/rust/cryptography-x509-verification/src/policy/extension.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -412,18 +412,13 @@ pub(crate) mod ca {
412412
));
413413
}
414414

415-
// authorityCertIssuer and authorityCertSerialNumber MUST NOT be present.
416-
if aki.authority_cert_issuer.is_some() {
417-
return Err(ValidationError::Other(
418-
"authorityKeyIdentifier must not contain authorityCertIssuer".to_string(),
419-
));
420-
}
421-
422-
if aki.authority_cert_serial_number.is_some() {
423-
return Err(ValidationError::Other(
424-
"authorityKeyIdentifier must not contain authorityCertSerialNumber".to_string(),
425-
));
426-
}
415+
// NOTE: CABF 7.1.2.1.3 says that Root CAs MUST NOT
416+
// have authorityCertIdentifier or authorityCertSerialNumber,
417+
// but these are present in practice in trust program bundles
418+
// due to older roots that have been grandfathered in.
419+
// Other validators are permissive of these being present,
420+
// so we don't check for them.
421+
// See #11461 for more information.
427422
}
428423

429424
Ok(())

tests/x509/verification/test_limbo.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
# forbidden under CABF. This is consistent with what
6868
# Go's crypto/x509 and Rust's webpki crate do.
6969
"webpki::aki::root-with-aki-ski-mismatch",
70+
# We allow root CAs where the AKI contains fields other than keyIdentifier,
71+
# which is technically forbidden under CABF. No other implementations
72+
# enforce this requirement.
73+
"webpki::aki::root-with-aki-authoritycertissuer",
74+
"webpki::aki::root-with-aki-authoritycertserialnumber",
75+
"webpki::aki::root-with-aki-all-fields",
7076
# We allow RSA keys that aren't divisible by 8, which is technically
7177
# forbidden under CABF. No other implementation checks this either.
7278
"webpki::forbidden-rsa-not-divisable-by-8-in-root",

0 commit comments

Comments
 (0)