Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl: auto DHE, ECDHE #4412

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rmculpepper
Copy link
Collaborator

Enable DHE and ECDHE automatically for all server contexts.

In OpenSSL 1.1.0 and later, ECDHE is enabled by default with automatic selection of the group (curve) used for key-exchange, and DHE can be enabled with auto group selection. In 1.0.2, ECDHE can be manually enabled with auto group selection, and DHE can be enabled using a 2048-bit built-in group. That is, for DHE this PR replaces the external 4096-bit DH group with either auto-selection (recommended by OpenSSL developers) or with an internal 2048-bit group (only for 1.0.2, EOL since 12/2019).

This change simplifies the code and the interface, but it removes some customizability.

Since v1.1.0, ECDH is always enabled with auto curve selection,
and customizing curves is rarely needed or advisable.
For v1.0.2, set auto-selection in server context construction.

See openssl/openssl#8837 (comment)
Recent advice from OpenSSL developers seems to be to just use
`SSL[_CTX]_set_dh_auto`, which picks a common group based on the
certificate's key strength and current security level.  Some
discussions:
- https://www.mail-archive.com/openssl-users@openssl.org/msg90995.html
- https://www.mail-archive.com/openssl-users@openssl.org/msg85573.html
- https://www.spinics.net/lists/openssl-users/msg10099.html

Another reasonable choice is to use one of the dhparams from RFC 7919.

There is an argument for a custom dhparams: to avoid precomputation
attacks on popular groups (see weakdh.org), but the old dhparams file
was copied from openssl, not custom-generated anyway.

Drop SSL_OP_SINGLE_DH_USE; it is ignored since v1.0.2f.

... DH
This makes the procedure a no-op (except possibly logging a warning).
This commit can be reverted if finer control over DHE groups is needed.
@mflatt
Copy link
Member

mflatt commented Aug 25, 2022

Looks good as far as I understand

@sorawee
Copy link
Collaborator

sorawee commented Feb 17, 2024

Is there a reason to hold this back from merging (besides fixing the @history to update the version number)?

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.

None yet

3 participants