Conversation
6498b14 to
a8096fa
Compare
djc
left a comment
There was a problem hiding this comment.
I think this makes sense with some tweaks?
djc
left a comment
There was a problem hiding this comment.
Please squash the commits into a single one.
20f6bb9 to
7e099fc
Compare
7e099fc to
0ef545c
Compare
0ef545c to
7d92be0
Compare
|
I'm a bit hesitant about this branch. I don't think we should continue to conflate signature identity with key generation policy, I think they should be modeled separately. Have you looked at what that might involve as a potential alternative? I was giving similar feedback in #448 (comment) |
that's fair. this PR seems to go in the opposite direction of the feedback you gave. we're ultimately just trying to get rid of |
Yup -- sorry for leading you astray. Do you have a chance to implement what @cpu was proposing in #448? |
sure! |
Summary
This PR adds support for having separate
SignatureAlgorithmvalues for different key sizes. It adds a fieldrsa_key_sizeto theSignatureAlgorithmstruct. We create a static SignatureAlgorithm struct for each combination of hash (SHA256, SHA384, SHA512) + key size (2048, 3072, 4096) adding 6 new algorithms. As a side effect, we have to passrsa_key_size: Noneto the other algorithm structs.The reason for this change is in
key_pair.rs, you can now use thegenerate_formethod to generate RSA key pairs of different key sizes by giving differentSignatureAlgorithmarguments. This removes the need forgenerate_rsa_for, so we deprecate it in the same wayRcgenErrorwas. SinceRsaKeySizeis always used now, we removed theaws-lc-rsandcryptogating.The
rsa_key_sizefield is not used it the identity of the key, because it would mess up loading the key, and we don't want to mess with the OID. At load time, like infrom_der_and_sign_algo, the user can give an RSA SigAlg value of any key size since the key size is later retrieved usingrsa_key_pair_public_modulus_len.Tests
We add a test in
lib.rsto verify that RSA algs of different key sizes are equal to each other.