Conversation
|
Note: it's only a skeleton at current stage and I will add real content later ;-) |
|
I added the SM2 key generation by specifying a new EC flag into the EC_KEY object and thus the |
I had the same idea. Considering how little they differ otherwise, I think this is the sane way to do it. |
|
|
mattcaswell
left a comment
There was a problem hiding this comment.
How does this work without the equivalent exchange/signature implementations? Or does it fallback to legacy somehow???
Are our current tests actually hitting these codepaths? From code inspection it looks to me like ec_generate_key will crash in the SM2 codepath - which makes we wonder whether we ever actually get there....or am I wrong about the crash?
Actually this PR should base on PR #11248 , so it will fail from my understandings. |
Anything I need to do to include this in to our tests? |
|
For testing, I would remove these lines and see what happens: Lines 23 to 25 in 378b163 |
|
After I tried to remove the macro @levitte suggested, it seems no changes on the testing side. But I investigate a bit on other test case failure and fixed the |
|
I noticed one test failure on |
Well, it works with the legacy SM2 implementation, because this: openssl/crypto/sm2/sm2_pmeth.c Lines 204 to 225 in 04cb5ec and this: openssl/crypto/sm2/sm2_pmeth.c Lines 267 to 280 in 04cb5ec What you need to do is to convert that macro to something that handles OSSL_PARAM, and you need to be able to handle that in the SM2 signature implementation. You can have a look at what we already do for EC for inspiration (the reason I point at UKM stuff is the use of octet_string, which is what I recommend for the ID): Lines 351 to 422 in 04cb5ec Other places to touch are: (to "translate" EVP_PKEY_CTRL_SET1_ID and EVP_PKEY_CTRL_GET1_ID to the new functions) openssl/crypto/evp/pmeth_lib.c Line 828 in 04cb5ec (to "translate" 'distid' to whatever OSSL_PARAM name you come up with) openssl/crypto/evp/pmeth_lib.c Line 1016 in 04cb5ec |
|
(.. and now backing away to do more vacation ..) |
|
Makes sense to me |
27cbedc to
948695b
Compare
948695b to
5aa4ac7
Compare
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
2332f35 to
1057c55
Compare
Done rebasing. |
|
Was the rebase trivial? If so then I don't see a need to reset the 24hr timer. |
Yes, only 2 build.info files |
|
To my judgement, there's no need to delay a merge further. |
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
Reviewed-by: Richard Levitte <[email protected]> Reviewed-by: Matt Caswell <[email protected]> (Merged from #12536)
|
Repo is frozen due to the release today - but this is master only so I pushed. |
Add support for SM2 key management in provider. This is mainly based on #11248 (comment)
Checklist