Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ license = "ISC"
name = "rustls-webpki"
readme = "README.md"
repository = "https://github.com/rustls/webpki"
version = "0.101.5"
version = "0.101.6"

include = [
"Cargo.toml",
Expand Down
7 changes: 2 additions & 5 deletions src/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub trait CertRevocationList: Sealed {
&self,
supported_sig_algs: &[&SignatureAlgorithm],
issuer_spki: &[u8],
budget: &mut Budget,
) -> Result<(), Error>;
}

Expand Down Expand Up @@ -87,13 +86,12 @@ impl CertRevocationList for OwnedCertRevocationList {
&self,
supported_sig_algs: &[&SignatureAlgorithm],
issuer_spki: &[u8],
budget: &mut Budget,
) -> Result<(), Error> {
signed_data::verify_signed_data(
supported_sig_algs,
untrusted::Input::from(issuer_spki),
&self.signed_data.borrow(),
budget,
&mut Budget::default(),
)
}
}
Expand Down Expand Up @@ -333,13 +331,12 @@ impl CertRevocationList for BorrowedCertRevocationList<'_> {
&self,
supported_sig_algs: &[&SignatureAlgorithm],
issuer_spki: &[u8],
budget: &mut Budget,
) -> Result<(), Error> {
signed_data::verify_signed_data(
supported_sig_algs,
untrusted::Input::from(issuer_spki),
&self.signed_data,
budget,
&mut Budget::default(),
)
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/verify_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn check_signed_chain_name_constraints(
Ok(())
}

pub struct Budget {
pub(crate) struct Budget {
signatures: usize,
build_chain_calls: usize,
name_constraint_comparisons: usize,
Expand Down Expand Up @@ -294,7 +294,11 @@ fn check_crls(
// TODO(XXX): consider whether we can refactor so this happens once up-front, instead
// of per-lookup.
// https://github.com/rustls/webpki/issues/81
crl.verify_signature(supported_sig_algs, issuer_spki.as_slice_less_safe(), budget)
// Note: The `verify_signature` method is part of a public trait in the exported API.
// We can't add a budget argument to that fn in a semver compatible way and so must
// consume signature budget here before calling verify_signature.
budget.consume_signature()?;
crl.verify_signature(supported_sig_algs, issuer_spki.as_slice_less_safe())
.map_err(crl_signature_err)?;

// Verify that if the issuer has a KeyUsage bitstring it asserts cRLSign.
Expand Down