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
This is slightly beyond a good first issue I suspect.
The place I'd start would be the ARIA GCM code in providers/implementations/ciphers.
Copy the three files, and change ARIA to SM4 throughout.
Then add the appropriate lines to providers/defltprov.c.
Assuming that the cipher suite numbers have been officially allocated, adding SM4-GCM cipher suites to TLS would again be following the ARIA example. Edit: the numbers are allocated but adding them will be quite different to ARIA since they are for TLS 1.3.
Assuming that the cipher suite numbers have been officially allocated, adding SM4-GCM cipher suites to TLS would again be following the ARIA example.
SM4 with GCM ciphersuite numbers have been allocated for TLSv1.3 (https://datatracker.ietf.org/doc/draft-yang-tls-tls13-sm-suites/) but not for TLSv1.2. With ARIA its the other way around: there are no ARIA TLSv1.3 ciphersuites to copy from unfortunately (although there are some TLSv1.2 ones).
There never will be an evp_sm4_gcm() function. Instead you should call EVP_CIPHER_fetch(NULL, "sm4-gcm", NULL) to access the cipher. Or something similar if you've got a library context or want a property query included.
Activity
paulidale commentedon Dec 12, 2020
This is slightly beyond a good first issue I suspect.
The place I'd start would be the ARIA GCM code in
providers/implementations/ciphers.Copy the three files, and change ARIA to SM4 throughout.
Then add the appropriate lines to
providers/defltprov.c.Assuming that the cipher suite numbers have been officially allocated, adding SM4-GCM cipher suites to TLS would again be following the ARIA example. Edit: the numbers are allocated but adding them will be quite different to ARIA since they are for TLS 1.3.mattcaswell commentedon Dec 12, 2020
SM4 with GCM ciphersuite numbers have been allocated for TLSv1.3 (https://datatracker.ietf.org/doc/draft-yang-tls-tls13-sm-suites/) but not for TLSv1.2. With ARIA its the other way around: there are no ARIA TLSv1.3 ciphersuites to copy from unfortunately (although there are some TLSv1.2 ones).
paulidale commentedon Dec 12, 2020
Thanks @mattcaswell, I knew about the TLS 1.3 draft but wasn't sure about 1.2. I'll edit my response's part about TLS.
jim-rowan commentedon Aug 10, 2021
Is there line of sight on implementing this feature? I am looking for Python Cryptography support for SM4 GCM and that relies on OpenSSL.
t8m commentedon Aug 10, 2021
There are no current plans to do this by the team members but if external contributor submitted a PR it would be welcome.
paulidale commentedon Feb 10, 2022
There never will be an evp_sm4_gcm() function. Instead you should call EVP_CIPHER_fetch(NULL, "sm4-gcm", NULL) to access the cipher. Or something similar if you've got a library context or want a property query included.
paulidale commentedon Feb 10, 2022
Closing this because SM4-GCM is present.
braveryHuang commentedon May 18, 2022
Hi, i using EVP_CIPHER_fetch(NULL, "sm4-gcm", NULL), but didn't work, i was using version 3.0.3.
Did sm4-gcm really existed ?
t8m commentedon May 18, 2022
sm4-gcm is implemented only in the master branch and will be in 3.1 release.
braveryHuang commentedon May 18, 2022
Thank you for your prompt reply.
jackxiaoer commentedon Jun 13, 2023
@paulidale thank you, EVP_CIPHER_fetch(NULL, "sm4-gcm", NULL), it work.
Add support for SM4-GCM cipher
Add support for GCM mode of SM4 cipher (#10072)