Skip to content

Conversation

@Frauschi
Copy link
Contributor

@Frauschi Frauschi commented Jan 22, 2026

Description

This PR adds support for RFC 8734, allowing ECC Brainpool curves to be used for TLS 1.3 key exchange and peer authentication. Furthermore, Brainpool usage for TLS 1.2 has been improved to more closely match RFC 8422.

Why?

Although IETF initially deprecated Brainpool curves for TLS 1.3 due to little usage, the German BSI (Federal Office for Information Security) still mandates their usage for critical infrastructure and the energy sector (e.g. in BSI TR-03116-3 or BSI TR-03116-4) for both TLS 1.2 and TLS 1.3 in addition to NIST SECP curves (TLS 1.3 itself is optional, but when it is used, the Brainpool curves must be supported to be compliant). Hence, support for these curves was added to TLS 1.3 via RFC 8734, adding new identifiers for key exchange and signatures.

Until now, wolfSSL only formally supports Brainpool curves for TLS 1.2 (although not fully standard conformant, see below). It is technically possible to use Brainpool certificates with TLS 1.3 at the moment, but their usage is fully “hidden” behind the NIST SECP ECDSA signature identifiers instead of the specific ones from RFC 8734, which is actually not allowed by RFC 8446. This fact currently limits users who need compliance with BSI regulations to TLS 1.2. The upgrade to TLS 1.3 is especially important with the transition to PQC in mind, as PQC will only be available for TLS 1.3. Although there are currently no specific regulations from the BSI regarding PQC, their future support is already anticipated.

Currently, only OpenSSL and Bouncy Castle also support the new identifiers of RFC 8734. All other TLS libraries, especially for embedded use, only support the TLS 1.2 identifiers.

TLS 1.3 Support

To make ECC Brainpool curves work in TLS 1.3, new identifiers are added for the key exchange (NamedGroups) as well as for the handshake signatures (SignatureScheme).

For the ECDHE key exchange, the following three new NamedGroups are available:

  • WOLFSSL_ECC_BRAINPOOLP256R1TLS13 (31)
  • WOLFSSL_ECC_BRAINPOOLP384R1TLS13 (32)
  • WOLFSSL_ECC_BRAINPOOLP512R1TLS13 (33)

For the handshake signature, the following three new SignatureSchemes are supported:

  • ECDSA_BRAINPOOLP256R1TLS13_SHA256 (0x081A)
  • ECDSA_BRAINPOOLP384R1TLS13_SHA384 (0x081B)
  • ECDSA_BRAINPOOLP512R1TLS13_SHA512 (0x081C)

When Brainpool curves are enabled (via --enable-brainpool or HAVE_ECC_BRAINPOOL) in addition to TLS 1.3, these identifiers are added automatically to the respective extensions in the handshake. For the handshake, their usage can also be enforced by the user via the existing wolfSSL_CTX_set_groups(), wolfSSL_set_groups() or wolfSSL_UseKeyShare() APIs. When the TLS endpoint uses a Brainpool certificate, the appropriate SignatureScheme is used for the CertificateVerify message during authentication if the peer offered support in the SignatureSchemes extension of the ClientHello or CertificateRequest message. If no support for these is offered, the handshake is aborted properly.

TLS 1.2 changes

In the TLS 1.2 case, the existing behavior when a Brainpool certificate is used has not been fully conformant to RFC 8422. The handshake may only succeed when the client advertises Brainpool support in the elliptic_curves extension in addition to advertising ECDSA support in the signature_algorithms extension. This fact has not been handled properly as of now, with the handshake simply proceeding. This is changed in this PR by checking the advertised curve support for Brainpool curves and aborting the handshake in case the curve used in the certificate is not present in the list.

Testing

Next to thorough internal testing using the client and server examples (both applications have been modified to support the new identifiers; some new tests are also added to the testsuite), interoperability with OpenSSL (>= version 3.2) has been tested successfully.

When both TLS 1.3 and Brainpool curves are enabled, three new groups can
be used for the ECDHE key exchange according to RFC 8734:
* WOLFSSL_ECC_BRAINPOOLP256R1TLS13 (31)
* WOLFSSL_ECC_BRAINPOOLP384R1TLS13 (32)
* WOLFSSL_ECC_BRAINPOOLP512R1TLS13 (33)

Also ensure that the existing TLS 1.2 curves are sent properly.

The TLS client application is updated to support handshakes via
Brainpool curves using the new argument "--bpKs".
This also fixes TLS 1.2 authentication to only succeed in case the
brainpool curve was present in the supported_groups extension.
@Frauschi Frauschi marked this pull request as ready for review January 22, 2026 15:20
@dgarske dgarske requested a review from SparkiDev January 22, 2026 23:06
Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over to @SparkiDev . Thank you @Frauschi

@SparkiDev SparkiDev merged commit 27df554 into wolfSSL:master Jan 23, 2026
381 checks passed
@Frauschi Frauschi deleted the brainpool-tls13 branch January 23, 2026 08:26
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.

4 participants