Uh oh!
There was an error while loading. Please reload this page.
pkcs1v15: use AssociatedOID for getting the RSA prefix - #183
Conversation
lumag
commented
Sep 9, 2022
This depends on RustCrypto/traits#1098 and RustCrypto/hashes#405 to be merged first. |
4dcee07 to
6c62f69CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Add tests using RSA-SHA1 and RSA-SHA3-256 signature schemes. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Bump digest, sha1 and sha2 crates versions to resolve the OID/AssociatedOId implementations. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Drop internal implementation of AssociatedHash and use AssociatedOID trait to get the OID corresponding to the Digest and to format the ASN.1 prefix. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fully replace rsa::Hash with AssociatedOid usage. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
@tarcieri@newpavlov Note, this pull request contains breaking change, it drops |
tarcieri
commented
Sep 16, 2022
@lumag breaking changes are fine as there are already ones merged ( |
newpavlov
commented
Sep 16, 2022
It would be nice to update the changelog. It's easier to edit "unreleased" section, than to collect all changes introduced since previous release. |
tarcieri
commented
Sep 16, 2022
@newpavlov unfortunately there is no changelog! (#151) But I'm happy to add one and document all of the changes in this (upcoming) release. |
tarcieri
commented
Sep 16, 2022
I'm going to go ahead and merge this as there are several people asking for an RC. Can wait for feedback from @dignifiedquire before cutting a final release. And in the meantime, I can get a changelog added. |
newpavlov
commented
Sep 16, 2022
Ah, true. I think the next breaking release is a good opportunity to add one then. |
dignifiedquire
commented
Sep 18, 2022
Uhm, I am not sure I can support this, but from first glance this means I can't change the hash function at runtime, which is functionality I need. Or am I missing something? |
| ]; | ||
| let pub_key: RsaPublicKey = priv_key.into(); | ||
| let verifying_key = VerifyingKey::<Sha256>::new_with_prefix(pub_key); | ||
| let verifying_key = VerifyingKey::<Sha1>::new_with_prefix(pub_key); |
There was a problem hiding this comment.
It was a revert of previous commit which changed Sha1 to Sha256.
lumag
commented
Sep 18, 2022
Unfortunately changing the hash function at runtime doesn't match the |
@dignifiedquire we could ensure the low-level APIs (defined in terms of Re: An enum could be used to select the concrete |
lumag
commented
Sep 18, 2022
@dignifiedquire The |
dignifiedquire
commented
Sep 21, 2022
This is the code that I need to support: https://github.com/rpgp/rpgp/blob/master/src/crypto/rsa.rs#L67-L82 |
dignifiedquire
commented
Sep 21, 2022
This specifically needs to support prehashed input. The linked api usage is 80% of the reason that I originally wrote this library. 😅 |
lumag
commented
Sep 21, 2022
@dignifiedquire ack, I see the issue. I'll send a pull request in one of the forthcoming days. |
dignifiedquire
commented
Sep 21, 2022
thanks @lumag! |
lumag
commented
Sep 21, 2022
@dignifiedquire I've sketched rpgp/rpgp#193. However it might be easier to just restore the rsa::Hash struct and use old API as you have been using it up to now. |
) Drop internal implementation of `AssociatedHash` and use `AssociatedOid` trait from `const_oid` to get the OID corresponding to the `Digest` and to format the ASN.1 prefix. Also removes the previous `Hash` enum as it was used for looking up OIDs. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Drop internal implementation of AssociatedHash and use AssociatedOID
trait to get the OID corresponding to the Digest and to format the ASN.1
prefix.