update to RSA 0.7.0 interfaces#193
Merged
dignifiedquire merged 2 commits intorpgp:masterfrom Nov 4, 2022
Merged
Conversation
Update dependencies and Hash code to use digest v0.10 crate. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
769e949 to
3a4514d
Compare
Contributor
Author
|
@dignifiedquire @tarcieri I noticed a side effect of this conversion. The rpgp starts to accept large RSA keys. E.g. a diff from the @@ -110188,7 +110189,43 @@
}
DEBUG pgp::packet::signature::types > packet: 54696d204d6f726c6579203c74696d4064657277656e742e636f2e756b3e
DEBUG pgp::packet::signature::types > prefix: b40000001e
- WARN key_test > verification failed: public key 6ea0fbcd0c9c1545: RSAError(PublicExponentTooLarge)
+ DEBUG pgp::packet::signature::types > verifying key (revocation): Signature {
+ packet_version: Old,
+ config: SignatureConfig {
+ version: V4,
+ typ: KeyRevocation,
+ pub_alg: RSA,
+ hash_alg: SHA1,
+ created: None,
+ issuer: None,
+ unhashed_subpackets: [
+ Issuer(
+ KeyId(6ea0fbcd0c9c1545),
+ ),
+ ],
+ hashed_subpackets: [
+ SignatureCreationTime(
+ 2016-08-16T05:10:41Z,
+ ),
+ RevocationReason(
+ KeyCompromised,
+ "This key was generated as part of the Evil32 project.\nIt is not owned by the user described in the UID.\nSee https://evil32.com/revoked for more details.",
+ ),
+ ],
+ },
+ signed_hash_value: "6994",
+ signature: ["9874eb7c4e439db3c84c12777c16da7fbc2bc63cc884dbc54e545c787be91dcf022fb7c968c86f7c34b02fe11ccf6ce69b72f0cde8cfabf465e74bf477ecc01313cc6a155faade5ea2edd64c35011430e10553cae9c32c423c7fa316611d8120a9c87664e9b9ac01eda731e400cb8eda343d34ab3bcdab7a220f522c5968aa90"],
+} - PublicKey {
+ packet_version: Old,
+ version: V4,
+ algorithm: RSA,
+ created_at: 2014-07-21T20:49:33Z,
+ expiration: None,
+ public_params: PublicParams::RSA {
+ n: Mpi(aeabf22ebf5c2a537a70711fdba3bcb3ab8be63c7caa9a17a3d03b0b6b9673bb9ba2a95e031751bafffe69e26638f9be08a6229005e92b23a263c276893a263224576d9a03ef1934c58c256b5617728b2b28e5d6ca555900fb7c081317f18dc391debb4c08b4fd76db051b66fcba120ba0bb24c4b95d199f1c3be8c49b178931),
+ e: Mpi(9058273b),
+ },
+}
DEBUG pgp::composed::signed_key::public > primary key: KeyId(05a0a15688995548)
DEBUG pgp::composed::signed_key::public > signatures
DEBUG pgp::packet::many > got packet: Ok(If this is undesired, we'd have to fix the crate. |
Contributor
Author
|
Hmm. Actually no. This is caused by the RSA crate changing max public exponent. |
Looking at this PR it seems like the |
Member
|
This solution looks good to me, thanks @lumag, happy to move forward with the changes on the rsa side based on this |
Contributor
Author
|
Updated the dependency to point to the released 0.7.0 RSA crate. |
6ea108a to
2901da0
Compare
Update the RSA crate to the 0.7.0 version. The parse_dumps expected values are updated to cover the keys, which previously failed with the PublicExponentTooLarge error, but are now accepted by the RSA crate. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This depends on RustCrypto/RSA#195 and needs updated md5 and ripemd crates to provide OIDs
Note: it might be simpler to just restore the rsa::Hash struct in the RSA crate.