Skip to content

Commit

Permalink
Appease the newest stable Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Dec 14, 2021
1 parent 18cda8a commit 97507d4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/end_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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 the signature `signature` of message `msg` using the
Expand Down
2 changes: 1 addition & 1 deletion src/name/dns_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl<'a> DnsNameRef<'a> {
pub fn to_owned(&self) -> DnsName {
// DnsNameRef is already guaranteed to be valid ASCII, which is a
// subset of UTF-8.
let s: &str = self.clone().into();
let s: &str = (*self).into();
DnsName(s.to_ascii_lowercase())
}
}
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 97507d4

Please sign in to comment.