Skip to content

Add support for RFC 8998 and draft-yang-tls-hybrid-sm2-mlkem#3014

Merged
drwetter merged 1 commit intotestssl:3.3devfrom
dcooper16:rfc8998
Apr 9, 2026
Merged

Add support for RFC 8998 and draft-yang-tls-hybrid-sm2-mlkem#3014
drwetter merged 1 commit intotestssl:3.3devfrom
dcooper16:rfc8998

Conversation

@dcooper16
Copy link
Copy Markdown
Collaborator

Describe your changes

The PR adds support for RFC 8998 and draft-yang-tls-hybrid-sm2-mlkem. This includes support for the TLS_SM4_GCM_SM3 and TLS_SM4_CCM_SM3 cipher suites, the key exchange groups curveSM2 and curveSM2MLKEM768, and SM2 public keys and signatures.

While this PR adds support to tls_sockets() to decrypt server responses encrypted under SM4 GCM or CCM, OpenSSL does not support performing key derivation using curveSM2. So, tls_sockets() can not decrypt server responses if the key exchange was performed using curveSM2 or curveSM2MLKEM768.

This PR was tested against openssl s_server using OpenSSL-4.0.0-beta1, but I was not able to test against any other servers that support RFC 8998.

What is your pull request about?

  • Bug fix
  • Improvement
  • New feature (adds functionality)
  • Breaking change (bug fix, feature or improvement that would cause existing functionality to not work as expected)
  • Typo fix
  • Documentation update
  • Update of other files

If it's a code change please check the boxes which are applicable

  • For the main program: My edits contain no tabs, indentation is five spaces and any line endings do not contain any blank chars
  • I've read CONTRIBUTING.md and Coding_Convention.md
  • I have tested this fix or improvement against >=2 hosts and I couldn't spot a problem
  • I have tested this new feature against >=2 hosts which show this feature and >=2 host which does not (in order to avoid side effects) . I couldn't spot a problem
  • For the new feature I have made corresponding changes to the documentation and / or to help()
  • If it's a bigger change: I added myself to CREDITS.md (alphabetical order) and the change to CHANGELOG.md

The commit adds support for RFC 8998 and draft-yang-tls-hybrid-sm2-mlkem. This includes support for the TLS_SM4_GCM_SM3 and TLS_SM4_CCM_SM3 cipher suites, the key exchange groups curveSM2 and curveSM2MLKEM768, and SM2 public keys and signatures.

While this commit adds support to tls_sockets() to decrypt server responses encrypted under SM4 GCM or CCM, OpenSSL does not support performing key derivation using curveSM2. So, tls_sockets() can not decrypt server responses if the key exchange was performed using curveSM2 or curveSM2MLKEM768.
@drwetter drwetter merged commit adff28d into testssl:3.3dev Apr 9, 2026
4 of 5 checks passed
@drwetter
Copy link
Copy Markdown
Collaborator

drwetter commented Apr 9, 2026

very cool, @dcooper16 , thanks!

@dcooper16 dcooper16 deleted the rfc8998 branch April 10, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants