Skip to content

Commit

Permalink
Upgrade to latest webpki alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Nov 23, 2023
1 parent 54c63b9 commit 4965ffe
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ ring = "0.17.0"
rustls-pemfile = "1"
serde = { version = "1.0.183", features = ["derive"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.3" }
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.6" }
x509-parser = "0.15.1"
yasna = "0.5.2"
44 changes: 23 additions & 21 deletions tests/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,23 @@ fn name_constraints() {
time,
KeyUsage::server_auth(),
None,
None,
)
.unwrap();
}

// Each forbidden EE should fail to verify with the expected name constraint error.
for forbidden_ee in test_case.forbidden_certs {
let result = webpki::EndEntityCert::try_from(&forbidden_ee)
.unwrap()
.verify_for_usage(
ALL_ALGORITHMS,
trust_anchors,
&[],
time,
KeyUsage::server_auth(),
None,
);
let ee = EndEntityCert::try_from(&forbidden_ee).unwrap();
let result = ee.verify_for_usage(
ALL_ALGORITHMS,
trust_anchors,
&[],
time,
KeyUsage::server_auth(),
None,
None,
);
assert!(matches!(result, Err(Error::NameConstraintViolation)));
}
}
Expand Down Expand Up @@ -174,6 +175,7 @@ fn tubitak_name_constraint_works() {
now,
KeyUsage::server_auth(),
None,
None,
)
.unwrap();

Expand All @@ -182,15 +184,15 @@ fn tubitak_name_constraint_works() {
}

static ALL_ALGORITHMS: &[&dyn SignatureVerificationAlgorithm] = &[
webpki::ECDSA_P256_SHA256,
webpki::ECDSA_P256_SHA384,
webpki::ECDSA_P384_SHA256,
webpki::ECDSA_P384_SHA384,
webpki::RSA_PKCS1_2048_8192_SHA256,
webpki::RSA_PKCS1_2048_8192_SHA384,
webpki::RSA_PKCS1_2048_8192_SHA512,
webpki::RSA_PKCS1_3072_8192_SHA384,
webpki::RSA_PSS_2048_8192_SHA256_LEGACY_KEY,
webpki::RSA_PSS_2048_8192_SHA384_LEGACY_KEY,
webpki::RSA_PSS_2048_8192_SHA512_LEGACY_KEY,
webpki::ring::ECDSA_P256_SHA256,
webpki::ring::ECDSA_P256_SHA384,
webpki::ring::ECDSA_P384_SHA256,
webpki::ring::ECDSA_P384_SHA384,
webpki::ring::RSA_PKCS1_2048_8192_SHA256,
webpki::ring::RSA_PKCS1_2048_8192_SHA384,
webpki::ring::RSA_PKCS1_2048_8192_SHA512,
webpki::ring::RSA_PKCS1_3072_8192_SHA384,
webpki::ring::RSA_PSS_2048_8192_SHA256_LEGACY_KEY,
webpki::ring::RSA_PSS_2048_8192_SHA384_LEGACY_KEY,
webpki::ring::RSA_PSS_2048_8192_SHA512_LEGACY_KEY,
];

0 comments on commit 4965ffe

Please sign in to comment.