Skip to content

Commit

Permalink
style: apply clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kikuomax committed Nov 21, 2023
1 parent 7e7d7e8 commit 6b5666a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/cert_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a> CertificatePolicy<'a> {
Self::Any { qualifiers: None }
} else {
Self::Specific {
oid: oid.into(),
oid,
qualifiers: None,
}
}
Expand All @@ -50,7 +50,7 @@ impl<'a> CertificatePolicy<'a> {
qualifiers: qualifiers.cloned(),
},
Self::Specific { oid, .. } => Self::Specific {
oid: oid.clone(),
oid: *oid,
qualifiers: qualifiers.cloned(),
},
}
Expand Down Expand Up @@ -138,9 +138,9 @@ impl<'a> core::fmt::Display for PolicyOidRef<'a> {
}

/// Reads policy from a given input.
pub(crate) fn read_certificate_policies<'a>(
input: untrusted::Input<'a>,
) -> ReadCertificatePolicies<'a> {
pub(crate) fn read_certificate_policies(
input: untrusted::Input,
) -> ReadCertificatePolicies {
ReadCertificatePolicies {
reader: untrusted::Reader::new(input),
}
Expand Down Expand Up @@ -223,7 +223,7 @@ mod tests {
fn any_policy_oid_ref_should_equal_specific_policy_oid_ref_referencing_any_policy() {
assert_eq!(
PolicyOidRef::Any,
PolicyOidRef::Specific(untrusted::Input::from(&ANY_POLICY_OID)),
PolicyOidRef::Specific(untrusted::Input::from(ANY_POLICY_OID)),
);
}

Expand Down
2 changes: 2 additions & 0 deletions src/end_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl<'a> EndEntityCert<'a> {
&self.inner
}

#[allow(clippy::too_many_arguments)]
fn verify_is_valid_cert(
&self,
supported_sig_algs: &[&SignatureAlgorithm],
Expand Down Expand Up @@ -142,6 +143,7 @@ impl<'a> EndEntityCert<'a> {
/// (RFC 5280 Section 6.1.1 (c)). Verification fails if none of
/// certificate policies in this slice is valid in the policy tree. This
/// method is equivalent to [`verify_for_usage`] if this slice is empty.
#[allow(clippy::too_many_arguments)]
pub fn verify_for_usage_with_policy_check(
&self,
supported_sig_algs: &[&SignatureAlgorithm],
Expand Down
14 changes: 7 additions & 7 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ pub fn win_hello_attest_tpm() {
&anchors,
&[inter],
None,
key_usage.clone(),
key_usage,
&[],
// 1.3.6.1.4.1.311.21.31
&[&[1 * 40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 31]],
&[&[40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 31]],
)
);
assert_eq!(
Expand All @@ -149,10 +149,10 @@ pub fn win_hello_attest_tpm() {
&anchors,
&[inter],
None,
key_usage.clone(),
key_usage,
&[],
// 1.3.6.1.4.1.311.21.32
&[&[1 * 40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 32]],
&[&[40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 32]],
)
);
assert_eq!(
Expand All @@ -162,11 +162,11 @@ pub fn win_hello_attest_tpm() {
&anchors,
&[inter],
None,
key_usage.clone(),
key_usage,
&[],
&[
&[1 * 40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 31],
&[1 * 40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 32],
&[40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 31],
&[40 + 3, 6, 1, 4, 1, 0x82, 55, 21, 32],
],
)
);
Expand Down

0 comments on commit 6b5666a

Please sign in to comment.