Skip to content

Commit

Permalink
Address Clippy's concerns.
Browse files Browse the repository at this point in the history
Address the (false positive) complaints of Newer versions of Clippy.
  • Loading branch information
briansmith committed Aug 29, 2023
1 parent ee8b581 commit a27d5ba
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/end_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ impl<'a> EndEntityCert<'a> {

/// Verifies that the certificate is valid for the given DNS host name.
pub fn verify_is_valid_for_dns_name(&self, dns_name: DnsNameRef) -> Result<(), Error> {
name::verify_cert_dns_name(&self, dns_name)
name::verify_cert_dns_name(self, dns_name)
}

/// Verifies that the certificate is valid for at least one of the given DNS
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#![doc(html_root_url = "https://briansmith.org/rustdoc/")]
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(
clippy::derive_partial_eq_without_eq,
clippy::doc_markdown,
clippy::if_not_else,
clippy::inline_always,
Expand Down
4 changes: 2 additions & 2 deletions src/name/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn verify_cert_dns_name(
dns_name: DnsNameRef,
) -> Result<(), Error> {
let cert = cert.inner();
let dns_name = untrusted::Input::from(dns_name.as_ref().as_ref());
let dns_name = untrusted::Input::from(dns_name.as_ref());
iterate_names(
cert.subject,
cert.subject_alt_name,
Expand Down Expand Up @@ -152,7 +152,7 @@ fn check_presented_id_conforms_to_constraints_in_subtree(
input: &mut untrusted::Reader<'b>,
) -> Result<GeneralName<'b>, Error> {
let general_subtree = der::expect_tag_and_get_value(input, der::Tag::Sequence)?;
general_subtree.read_all(Error::BadDer, |subtree| general_name(subtree))
general_subtree.read_all(Error::BadDer, general_name)
}

let base = match general_subtree(&mut constraints) {
Expand Down
2 changes: 1 addition & 1 deletion src/signed_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ mod tests {
if line == end_section {
break;
}
base64.push_str(&line);
base64.push_str(line);
}

base64::decode(&base64).unwrap()
Expand Down
6 changes: 3 additions & 3 deletions src/verify_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn build_chain(
let name_constraints = trust_anchor.name_constraints.map(untrusted::Input::from);

untrusted::read_all_optional(name_constraints, Error::BadDer, |value| {
name::check_name_constraints(value, &cert)
name::check_name_constraints(value, cert)
})?;

let trust_anchor_spki = untrusted::Input::from(trust_anchor.spki);
Expand All @@ -83,7 +83,7 @@ pub fn build_chain(

loop_while_non_fatal_error(intermediate_certs, |cert_der| {
let potential_issuer =
cert::parse_cert(untrusted::Input::from(*cert_der), EndEntityOrCa::Ca(&cert))?;
cert::parse_cert(untrusted::Input::from(cert_der), EndEntityOrCa::Ca(cert))?;

if potential_issuer.subject != cert.issuer {
return Err(Error::UnknownIssuer);
Expand All @@ -108,7 +108,7 @@ pub fn build_chain(
}

untrusted::read_all_optional(potential_issuer.name_constraints, Error::BadDer, |value| {
name::check_name_constraints(value, &cert)
name::check_name_constraints(value, cert)
})?;

let next_sub_ca_count = match used_as_ca {
Expand Down

0 comments on commit a27d5ba

Please sign in to comment.