Skip to content

MDEV-26015 ssl: remove insecure fixed DH params (mostly unused) - #5639

Open
xnox wants to merge 1 commit into
MariaDB:mainfrom
xnox:remove-dh
Open

MDEV-26015 ssl: remove insecure fixed DH params (mostly unused)#5639
xnox wants to merge 1 commit into
MariaDB:mainfrom
xnox:remove-dh

Conversation

@xnox

@xnox xnox commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

WolfSSL code path already operates without fixed DH parameters. OpenSSL code path still sets fixed static precomputed DH params, which is now prohibited by IETF.

Also OPENSSL_init_ssl is not required since OpenSSL 1.1.0, for over 10 years now. Also cleaned up at the same time.

https://www.rfc-editor.org/rfc/rfc10015.html#section-2:

Clients MUST NOT offer and servers MUST NOT select non-ephemeral FFDH cipher suites in (D)TLS 1.2 connections.

https://www.rfc-editor.org/rfc/rfc10015.html#section-3:

Clients MUST NOT offer and servers MUST NOT select FFDHE cipher suites in (D)TLS 1.2 connections.

And the depreciated tables include all ciphersuites that can use SSL_CTX_set_tmp_dh as part of the connection.

Also for a very long time OpenSSL was handling these automatically anyway, back when DHE was still recommended.

@xnox

xnox commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@grooverdan @vuvova - please let me know if direct removal is appropriate; note that most OpenSSL are configured to use TLSv1.3/v1.2 with ECDHE and they simply ignore any DH set on the SSL context. However, with these calls still in place one cannot compile and use OpenSSL "no-dh" with a OPENSSL_NO_DH defined. If you want to keep this, I can add the HAVE_DH checks similar to how we used to have HAVE_DES checks in #3198

@xnox xnox changed the title ssl: remove insecure fixed DH params ssl: remove insecure fixed DH params (mostly unused) Sep 6, 2026
@grooverdan

Copy link
Copy Markdown
Member

I'm pretty happy with this going into a latest MariaDB release. Even the openssl-1.0.1 of RHEL 7 supports ECDHE.

Can you put a MDEV-26015 on the commit message title?

@vuvova wdyt - for 11.4, the version that doesn't have a EOM RHEL7 /OpenSSL-1.0.1 builder, supporting checking OPENSSL_NO_DH, and replacing fixed DH with runtime DH_generate_parameters_ex?

@vuvova vuvova changed the title ssl: remove insecure fixed DH params (mostly unused) MDEV-26015 ssl: remove insecure fixed DH params (mostly unused) Sep 7, 2026
@vuvova

vuvova commented Sep 7, 2026

Copy link
Copy Markdown
Member

please add a direct quote to the commit comment. Something like

References:

    https://www.rfc-editor.org/rfc/rfc9325.html
    https://www.rfc-editor.org/rfc/rfc10015.html

"
   ... to avoid the use of non-ephemeral DH, clients SHOULD NOT
   use and servers SHOULD NOT accept certificates with fixed DH
   parameters...
"

and to be precise change "prohibited" to "discouraged" 😇 — it's "SHOULD NOT" and not "MUST NOT".

If it succeeds in CI (on all builders, not only listed above) then it's ok.

@xnox

xnox commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

please add a direct quote to the commit comment. Something like

References:

    https://www.rfc-editor.org/rfc/rfc9325.html
    https://www.rfc-editor.org/rfc/rfc10015.html

"
   ... to avoid the use of non-ephemeral DH, clients SHOULD NOT
   use and servers SHOULD NOT accept certificates with fixed DH
   parameters...
"

and to be precise change "prohibited" to "discouraged" 😇 — it's "SHOULD NOT" and not "MUST NOT".

If it succeeds in CI (on all builders, not only listed above) then it's ok.

The quote you provide is about client certificates, those indeed are "should not" because if existing client cert exist; one has to accept it to for example rotate it.

The code I am changing is server side to negotiate TLS_DH_ or TLS_DHE_ ciphers, all of which are "MUST NOT".

I will update the PR description and the commit message.

…aDB#5639

WolfSSL code path already operates without fixed DH parameters. OpenSSL code path still sets fixed static precomputed DH params, which is now prohibited by IETF.

Also OPENSSL_init_ssl is not required since OpenSSL 1.1.0, for over 10 years now. Also cleaned up at the same time.

https://www.rfc-editor.org/rfc/rfc10015.html#section-2:
> Clients MUST NOT offer and servers MUST NOT select non-ephemeral FFDH cipher suites in (D)TLS 1.2 connections.

https://www.rfc-editor.org/rfc/rfc10015.html#section-3:
> Clients MUST NOT offer and servers MUST NOT select FFDHE cipher suites in (D)TLS 1.2 connections.

And the depreciated tables include all ciphersuites that can use SSL_CTX_set_tmp_dh as part of the connection.

Also for a very long time OpenSSL was handling these automatically anyway, back when DHE was still recommended.
@xnox
xnox force-pushed the remove-dh branch 2 times, most recently from a2d9440 to ee682cb Compare September 7, 2026 09:47
@xnox

xnox commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

I'm pretty happy with this going into a latest MariaDB release. Even the openssl-1.0.1 of RHEL 7 supports ECDHE.

Can you put a MDEV-26015 on the commit message title?

@vuvova wdyt - for 11.4, the version that doesn't have a EOM RHEL7 /OpenSSL-1.0.1 builder, supporting checking OPENSSL_NO_DH, and replacing fixed DH with runtime DH_generate_parameters_ex?

RHEL 7.4 and up have ECDHE - https://access.redhat.com/articles/1462343
RHEL 6.5 and up have ECDHE - https://access.redhat.com/articles/1462223

What systems do not have ECDHE?

@grooverdan grooverdan self-assigned this Sep 8, 2026
@grooverdan

Copy link
Copy Markdown
Member

I'm pretty happy with this going into a latest MariaDB release. Even the openssl-1.0.1 of RHEL 7 supports ECDHE.
Can you put a MDEV-26015 on the commit message title?
@vuvova wdyt - for 11.4, the version that doesn't have a EOM RHEL7 /OpenSSL-1.0.1 builder, supporting checking OPENSSL_NO_DH, and replacing fixed DH with runtime DH_generate_parameters_ex?

RHEL 7.4 and up have ECDHE - https://access.redhat.com/articles/1462343 RHEL 6.5 and up have ECDHE - https://access.redhat.com/articles/1462223

Thanks for references.

What systems do not have ECDHE?

None that I'm aware of. But I'd rather not surprise them in a minor version upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants