Skip to content

SSL: external groups support in $ssl_curve and $ssl_curves. #609

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

pluknet
Copy link
Contributor

@pluknet pluknet commented Apr 4, 2025

Starting with OpenSSL 3.0, groups may be added externally with pluggable KEM providers. Using SSL_get_negotiated_group(), which makes lookup in a static table with known groups, doesn't allow to list such groups by names leaving them in hex. Adding X25519MLKEM768 to the default group list in OpenSSL 3.5 made this problem more visible. SSL_get0_group_name() and, apparently, SSL_group_to_name() allow to resolve such provider-implemented groups, which is also "generally preferred" over SSL_get_negotiated_group() as documented in OpenSSL git commit 93d4f6133f.

This change makes external groups listing by name using SSL_group_to_name() available since OpenSSL 3.0. To preserve "prime256v1" naming for the group 0x0017, and to avoid breaking BoringSSL and older OpenSSL versions support, it is used supplementary for a group that appears to be unknown.

See openssl/openssl#27137 for related discussion.

@pluknet pluknet requested a review from bavshin-f5 April 4, 2025 11:28
@bavshin-f5 bavshin-f5 linked an issue Apr 8, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@bavshin-f5 bavshin-f5 left a comment

Choose a reason for hiding this comment

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

$ssl_curve $ssl_curves output looks correct with OpenSSL 3.5.0 native groups and OpenSSL 3.2 + oqsprovider: SecP256r1MLKEM768 SecP256r1MLKEM768:X25519MLKEM768:prime256v1 in both cases.

LGTM, with one minor nit.

Starting with OpenSSL 3.0, groups may be added externally with pluggable
KEM providers.  Using SSL_get_negotiated_group(), which makes lookup in a
static table with known groups, doesn't allow to list such groups by names
leaving them in hex.  Adding X25519MLKEM768 to the default group list in
OpenSSL 3.5 made this problem more visible.  SSL_get0_group_name() and,
apparently, SSL_group_to_name() allow to resolve such provider-implemented
groups, which is also "generally preferred" over SSL_get_negotiated_group()
as documented in OpenSSL git commit 93d4f6133f.

This change makes external groups listing by name using SSL_group_to_name()
available since OpenSSL 3.0.  To preserve "prime256v1" naming for the group
0x0017, and to avoid breaking BoringSSL and older OpenSSL versions support,
it is used supplementary for a group that appears to be unknown.

See openssl/openssl#27137 for related discussion.
@pluknet pluknet merged commit b6e7eb0 into nginx:master Apr 10, 2025
1 check passed
@pluknet pluknet deleted the ssl_curve branch April 10, 2025 14:51
@Maryna-f5 Maryna-f5 added this to the nginx-1.27.5 milestone Apr 15, 2025
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.

$ssl_curve not logging new OpenSSL 3.5 PQC groups by name
3 participants