You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 3.0.2 15 Mar 2022
OpenSSL Header Version => OpenSSL 3.0.2 15 Mar 2022
Openssl default config => /usr/lib/ssl/openssl.cnf
Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value
I think the actual SM2 support would be more a feature as it has got some difference compare to standard EC (as documented in https://www.openssl.org/docs/manmaster/man7/EVP_PKEY-SM2.html ) . There's potentially one bug though as it seems not right to return DH so that might need a separate look and could be treated as a bug fix potentially (it should probably return false in such case).
I have done some debugging of this as I was getting different result with OpenSSL 1.1.1 (getting the actual SM2 with some missing parameters) and OpenSSL 3.0 where I actually got a different result and PKEY type ended up to be -1. That triggered incorrect assertion that I needed to fix by #10194 . After some digging I came across this issue that seems to be the reason for the behavior change: openssl/openssl#14411 .
What's strange that you are getting dh in the result. I might need to check it on prod build to see if I'm able to reproduce.
@xywf221 You could use openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:SM2 -out sm2-key.pem and openssl pkey -in sm2-key.pem -pubout -out sm2pubkey.pem instead.
There would be a wrong on OpenSSL 3.x. Details see openssl/openssl#20973
Activity
cmb69 commentedon Aug 25, 2022
Indeed, there is no support for
EVP_PKEY_SM2yet. Looks more like a feature request than a bug. @bukka, thoughts?bukka commentedon Aug 28, 2022
I think the actual SM2 support would be more a feature as it has got some difference compare to standard EC (as documented in https://www.openssl.org/docs/manmaster/man7/EVP_PKEY-SM2.html ) . There's potentially one bug though as it seems not right to return DH so that might need a separate look and could be treated as a bug fix potentially (it should probably return false in such case).
bukka commentedon Dec 31, 2022
I have done some debugging of this as I was getting different result with OpenSSL 1.1.1 (getting the actual SM2 with some missing parameters) and OpenSSL 3.0 where I actually got a different result and PKEY type ended up to be -1. That triggered incorrect assertion that I needed to fix by #10194 . After some digging I came across this issue that seems to be the reason for the behavior change: openssl/openssl#14411 .
What's strange that you are getting
dhin the result. I might need to check it on prod build to see if I'm able to reproduce.xywf221 commentedon Dec 31, 2022
Thank you for your continued attention to this issue @bukka
Eno-CN commentedon Jun 20, 2023
@xywf221 You could use
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:SM2 -out sm2-key.pemandopenssl pkey -in sm2-key.pem -pubout -out sm2pubkey.peminstead.There would be a wrong on OpenSSL 3.x. Details see openssl/openssl#20973