Hybrid (PQ) TLS#8097
Open
eddyashton wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates CCF’s TLS configuration to prefer hybrid post-quantum (PQ) key exchange groups when supported by the linked OpenSSL build, while keeping the current classical ECDHE groups as fallbacks. This aligns with the goal of enabling hybrid secret exchange (per #8061) without hard-failing on OpenSSL builds/providers that don’t recognize PQ group names.
Changes:
- Switch TLS group configuration from
SSL_CTX_set1_curves_listtoSSL_CTX_set1_groups_list, adding?-prefixed hybrid PQ group names ahead of existing P-521/P-384/P-256. - Refactor TLS test handshake logic and add a test asserting that a hybrid PQ group is negotiated when OpenSSL supports them.
- Add a CHANGELOG entry describing the behavior change.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md.github/instructions/changelog.instructions.md
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/tls/context.h |
Prefer hybrid PQ TLS groups via SSL_CTX_set1_groups_list with ?-prefixed optional group names, retaining classical fallbacks. |
src/tls/test/main.cpp |
Extract handshake helper and add a test checking negotiation prefers a hybrid PQ group when supported. |
CHANGELOG.md |
Document the TLS group preference change. |
Comment on lines
+484
to
+494
| std::string negotiated_group_name() | ||
| { | ||
| const auto nid = SSL_get_negotiated_group(get_ssl()); | ||
| if (nid == NID_undef) | ||
| { | ||
| return {}; | ||
| } | ||
|
|
||
| const auto* name = OBJ_nid2sn(nid); | ||
| return name == nullptr ? std::to_string(nid) : name; | ||
| } |
|
|
||
| ### Changed | ||
|
|
||
| - TLS handshakes now prefer OpenSSL hybrid post-quantum key exchange groups when the linked OpenSSL version supports them, while retaining the existing P-521/P-384/P-256 groups as fallbacks (#0000). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While looking at alternatives to #8076, following @achamayou's proposed design:
I spotted that
[SSL_CTX_set1_curves](https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/)has a?syntax that handles this detection automagically.I think this is exactly what we want? And may even resolve #8061? But looking for input from @maxtropets.