Skip to content

Commit

Permalink
tests: add LE chain test to verification_real_world
Browse files Browse the repository at this point in the history
In particular this testcase ensures that we can validate a chain from
EE->intermediate->trust anchor for a chain where one or more
certificates (in this case, the intermediate) are missing an authority
information access (AIA) extension that specifies an OCSP access method
and URI.
  • Loading branch information
cpu committed Nov 17, 2023
1 parent 3a052e0 commit 57a2d16
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions src/tests/verification_real_world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ const VALID_UNRELATED_CHAIN: &[&[u8]] = &[
include_bytes!("agilebits_com_valid_4.crt"),
];

const LETSENCRYPT_ORG: &str = "letsencrypt.org";

const VALID_LETSENCRYPT_ORG_CHAIN: &[&[u8]] = &[
include_bytes!("letsencrypt_org_valid_1.crt"),
include_bytes!("letsencrypt_org_valid_2.crt"),
include_bytes!("letsencrypt_org_valid_3.crt"),
];

macro_rules! real_world_test_cases {
{ $( $name:ident => $test_case:expr ),+ , } => {
real_world_test_cases!(@ $($name => $test_case),+,);
Expand Down Expand Up @@ -202,6 +210,13 @@ real_world_test_cases! {
expected_result: Err(TlsError::InvalidCertificate(CertificateError::NotValidForName)),
other_error: no_error!(),
},
letsencrypt => TestCase {
reference_id: LETSENCRYPT_ORG,
chain: VALID_LETSENCRYPT_ORG_CHAIN,
stapled_ocsp: None,
expected_result: Ok(()),
other_error: no_error!(),
},

// OCSP stapling works.
//
Expand Down

0 comments on commit 57a2d16

Please sign in to comment.