From 25f821a47508b0af0350b7e060618a8201aa29bb Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sun, 5 Mar 2023 22:05:20 -0700 Subject: [PATCH] pkcs1: fixups for `DecodeRsaPublicKey` blanket impl (#916) Changes the error type to `spki::Error`, which matches the error type used in the `spki::DecodePublicKey` blanket impl: https://docs.rs/spki/0.7.0/spki/trait.DecodePublicKey.html#impl-DecodePublicKey-for-T Also removes the bounds on `DecodePublicKey` in the blanket impl of `DecodeRsaPublicKey`, since they aren't actually used. This is a breaking change but also a bugfix, as with the previous bounds it's not possible to impl PKCS#1 support via these two blanket impls, since the error types don't match. The plan is to merge this, publish it, and yank the v0.7.0 release. --- pkcs1/src/traits.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkcs1/src/traits.rs b/pkcs1/src/traits.rs index 1def64968..f8934ddd1 100644 --- a/pkcs1/src/traits.rs +++ b/pkcs1/src/traits.rs @@ -169,9 +169,9 @@ where } #[cfg(feature = "pkcs8")] -impl DecodeRsaPublicKey for T +impl DecodeRsaPublicKey for T where - T: for<'a> TryFrom, Error = pkcs8::Error>, + T: for<'a> TryFrom, Error = pkcs8::spki::Error>, { fn from_pkcs1_der(public_key: &[u8]) -> Result { Ok(Self::try_from(pkcs8::SubjectPublicKeyInfoRef {