Skip to content

Commit

Permalink
verify: avoid deprecated webpki methods.
Browse files Browse the repository at this point in the history
webpki 0.101.2 deprecated some methods/types that must be updated.
  • Loading branch information
cpu committed Aug 2, 2023
1 parent 2ac3cec commit 2b97c8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rustls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rustversion = { version = "1.0.6", optional = true }
log = { version = "0.4.4", optional = true }
ring = "0.16.20"
sct = "0.7.0"
webpki = { package = "rustls-webpki", version = "0.101.0", features = ["alloc", "std"] }
webpki = { package = "rustls-webpki", version = "0.101.2", features = ["alloc", "std"] }

[features]
default = ["logging", "tls12"]
Expand Down
11 changes: 7 additions & 4 deletions rustls/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,13 @@ pub fn verify_server_cert_signed_by_trust_anchor(
let webpki_now = webpki::Time::try_from(now).map_err(|_| Error::FailedToGetCurrentTime)?;

cert.0
.verify_is_valid_tls_server_cert(
.verify_for_usage(
SUPPORTED_SIG_ALGS,
&webpki::TlsServerTrustAnchors(&trust_roots),
&trust_roots,
&chain,
webpki_now,
webpki::KeyUsage::server_auth(),
&[], // no CRLs
)
.map_err(pki_error)
.map(|_| ())
Expand Down Expand Up @@ -633,11 +635,12 @@ impl ClientCertVerifier for AllowAnyAuthenticatedClient {
.collect::<Vec<_>>();

cert.0
.verify_is_valid_tls_client_cert(
.verify_for_usage(
SUPPORTED_SIG_ALGS,
&webpki::TlsClientTrustAnchors(&trust_roots),
&trust_roots,
&chain,
now,
webpki::KeyUsage::client_auth(),
crls.as_slice(),
)
.map_err(pki_error)
Expand Down

0 comments on commit 2b97c8d

Please sign in to comment.