Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudy committed Nov 29, 2023
1 parent ae9b360 commit 7c07fe4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/dyn-key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let hdr = token.header();
let jwk = hdr.key().unwrap();
let key: rsa::pkcs1v15::VerifyingKey<Sha256> =
rsa::pkcs1v15::VerifyingKey::new(rsa::RsaPublicKey::from_jwk(&jwk).unwrap());
rsa::pkcs1v15::VerifyingKey::new(rsa::RsaPublicKey::from_jwk(jwk).unwrap());

println!("=== Verification === ");
// Check it against the verified key
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ mod test {
let signature: ::ecdsa::Signature<NistP256> = key.sign_token(&header, &payload);
eprintln!("sig: {:?}", signature.to_bytes().as_slice());

let verify = key.verifying_key().clone();
let verify = *key.verifying_key();
assert_eq!(ecpkey.to_public_key().unwrap(), (&verify).into());

TokenVerifier::<ecdsa::Signature<NistP256>>::verify_token(
Expand Down
3 changes: 1 addition & 2 deletions src/jose/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ impl<H> Header<H, UnsignedHeader> {
}

/// Construct the JOSE header from the builder and signing key.
pub(crate) fn into_signed_header<A, S>(
pub(crate) fn into_signed_header<A>(
self,
key: &A,
) -> Result<Header<H, SignedHeader>, signature::Error>
where
A: DynJsonWebAlgorithm + SerializePublicJWK + ?Sized,
S: SignatureEncoding,
{
let state = SignedHeader {
algorithm: key.identifier(),
Expand Down
5 changes: 3 additions & 2 deletions src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ where
A: crate::algorithms::TokenSigner<S> + ?Sized,
S: SignatureEncoding,
{
let header = self.state.header.into_signed_header::<A, S>(algorithm)?;
let header = self.state.header.into_signed_header(algorithm)?;
let headers = Base64JSON(&header).serialized_value()?;
let payload = self.payload.serialized_value()?;
let signature = algorithm
Expand All @@ -450,6 +450,7 @@ where
}

/// Sign this token using the given algorithm, and a random number generator.
#[allow(clippy::type_complexity)]
pub fn sign_randomized<A, S>(
self,
algorithm: &A,
Expand All @@ -459,7 +460,7 @@ where
A: crate::algorithms::RandomizedTokenSigner<S> + ?Sized,
S: SignatureEncoding,
{
let header = self.state.header.into_signed_header::<A, S>(algorithm)?;
let header = self.state.header.into_signed_header(algorithm)?;
let headers = Base64JSON(&header).serialized_value()?;
let payload = self.payload.serialized_value()?;
let signature = algorithm
Expand Down

0 comments on commit 7c07fe4

Please sign in to comment.