From b8c6e8e18a2a2e95af68f64cc2023396e23b2161 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 12 Dec 2024 14:51:20 +0000 Subject: [PATCH] Linting --- src/definitions/x509/extensions.rs | 8 ++++---- src/definitions/x509/mod.rs | 2 +- src/presentation/device.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/definitions/x509/extensions.rs b/src/definitions/x509/extensions.rs index e33fbe2..dd453ad 100644 --- a/src/definitions/x509/extensions.rs +++ b/src/definitions/x509/extensions.rs @@ -187,7 +187,7 @@ impl ExtensionValidator for ExtendedKeyUsageValidator { but no other key usages are allowed */ fn validate(&self, extension: &Extension) -> Vec { let bytes = extension.extn_value.as_bytes(); - let extended_key_usage = ExtendedKeyUsage::from_der(&bytes); + let extended_key_usage = ExtendedKeyUsage::from_der(bytes); if !extension.critical { tracing::warn!( @@ -230,7 +230,7 @@ impl ExtensionValidator for SignerKeyUsageValidator { fn validate(&self, extension: &Extension) -> Vec { let bytes = extension.extn_value.as_bytes(); let mut errors: Vec = vec![]; - let key_usage = KeyUsage::from_der(&bytes); + let key_usage = KeyUsage::from_der(bytes); if !extension.critical { tracing::warn!("expected KeyUsage extension to be critical on signer certificate",) @@ -344,7 +344,7 @@ impl ExtensionValidator for BasicConstraintsValidator { } let bytes = extension.extn_value.as_bytes(); - let basic_constraints = BasicConstraints::from_der(&bytes); + let basic_constraints = BasicConstraints::from_der(bytes); match basic_constraints { Ok(bc) => { if let Some(e) = Self::check(bc) { @@ -376,7 +376,7 @@ impl ExtensionValidator for CrlDistributionPointsValidator { fn validate(&self, extension: &Extension) -> Vec { let bytes = extension.extn_value.as_bytes(); let mut errors: Vec = vec![]; - let crl_distribution_point = CrlDistributionPoints::from_der(&bytes); + let crl_distribution_point = CrlDistributionPoints::from_der(bytes); match crl_distribution_point { Ok(crl_dp) => { if crl_dp.0.is_empty() { diff --git a/src/definitions/x509/mod.rs b/src/definitions/x509/mod.rs index f6e2817..f0d723d 100644 --- a/src/definitions/x509/mod.rs +++ b/src/definitions/x509/mod.rs @@ -30,7 +30,7 @@ mod test { Certificate, }; - fn prepare_root_certificate<'s, S>(root_key: &'s S, issuer: Name) -> CertificateBuilder<'s, S> + fn prepare_root_certificate(root_key: &S, issuer: Name) -> CertificateBuilder<'_, S> where S: KeypairRef + DynSignatureAlgorithmIdentifier, S::VerifyingKey: EncodePublicKey, diff --git a/src/presentation/device.rs b/src/presentation/device.rs index 0d3a290..9771635 100644 --- a/src/presentation/device.rs +++ b/src/presentation/device.rs @@ -591,7 +591,7 @@ impl SessionManager { match x5chain { Ok(x5c) => { if let Some(trusted_verifiers) = &self.trusted_verifiers { - validation_errors.append(&mut x5c.validate(Some(&trusted_verifiers))); + validation_errors.append(&mut x5c.validate(Some(trusted_verifiers))); } } Err(e) => {