-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x509-cert: accept rfc5280-invalid certificates as trustanchor (#1403)
This commit brings the profiles introduced in #987 to `TrustAnchorChoice` and `Crl`. This is intended for the support of invalid certificates in https://github.com/carl-wallace/rust-pki/tree/main/certval
- Loading branch information
Showing
4 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
use der::Decode; | ||
use x509_cert::crl::CertificateList; | ||
use x509_cert::{certificate::Rfc5280, crl::CertificateList}; | ||
|
||
#[test] | ||
fn decode_crl() { | ||
// vanilla CRL from PKITS | ||
let der_encoded_cert = include_bytes!("examples/GoodCACRL.crl"); | ||
let crl = CertificateList::from_der(der_encoded_cert).unwrap(); | ||
let crl = CertificateList::<Rfc5280>::from_der(der_encoded_cert).unwrap(); | ||
assert_eq!(2, crl.tbs_cert_list.crl_extensions.unwrap().len()); | ||
assert_eq!(2, crl.tbs_cert_list.revoked_certificates.unwrap().len()); | ||
|
||
// CRL with an entry with no entry extensions | ||
let der_encoded_cert = include_bytes!("examples/tscpbcasha256.crl"); | ||
let crl = CertificateList::from_der(der_encoded_cert).unwrap(); | ||
let crl = CertificateList::<Rfc5280>::from_der(der_encoded_cert).unwrap(); | ||
assert_eq!(2, crl.tbs_cert_list.crl_extensions.unwrap().len()); | ||
assert_eq!(4, crl.tbs_cert_list.revoked_certificates.unwrap().len()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters