-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[configtls] Hybrid key exchange automatically applies in go version >= 1.24.0 #14343
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
Open
Geun-Oh
wants to merge
9
commits into
open-telemetry:main
Choose a base branch
from
Geun-Oh:hybrid-key-exchange
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+138
−6
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4c11ee1
[configtls] Set X25519MLKEM768 as const for backward compat
Geun-Oh 9ee9764
[configtls] Add defaultCurvePreferences for both Fips, NoFips
Geun-Oh c2d390d
[configtls] Use defaultCurvePreferences in default
Geun-Oh 9fbff2c
[docs] Add new configuration guide for setting curve preferences
Geun-Oh 9e110ad
[docs] Add detailed comments for constant X25519MLKEM768
Geun-Oh 9e4cf77
[configtls/test] Change tls.X25519MLKEM768 into new const value
Geun-Oh 71da754
[test] Add test for checking wheter X25519MLKEM768 const matches with…
Geun-Oh 902834e
[configtls] Rename X25519MLKEM768 validation test file from curves_id…
Geun-Oh 16234b8
[configtls/test] Reconfigure test with specified test cases
Geun-Oh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,27 @@ package configtls // import "go.opentelemetry.io/collector/config/configtls" | |
|
|
||
| import "crypto/tls" | ||
|
|
||
| // For backward compatability with older versions before Go 1.24.0 | ||
| // This constant has the same value as tls.X25519MLKEM768 in Go 1.24.0+ | ||
| // Value: 0x11EC (verified against Go 1.24.0 source code) | ||
| const ( | ||
| X25519MLKEM768 tls.CurveID = 0x11EC | ||
| ) | ||
|
|
||
| var tlsCurveTypes = map[string]tls.CurveID{ | ||
| "P256": tls.CurveP256, | ||
| "P384": tls.CurveP384, | ||
| "P521": tls.CurveP521, | ||
| "X25519": tls.X25519, | ||
| "X25519MLKEM768": tls.X25519MLKEM768, | ||
| "X25519MLKEM768": X25519MLKEM768, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you breaking convention? |
||
| } | ||
|
|
||
| // defaultCurvePreferences defines the default order of curve preferences. | ||
| // X25519MLKEM768 is prioritized for post-quantum security when compiled with Go 1.24+. | ||
| var defaultCurvePreferences = []tls.CurveID{ | ||
| X25519MLKEM768, // Post-quantum hybrid key exchange | ||
| tls.X25519, // Modern, fast elliptic curve | ||
| tls.CurveP256, // Widely supported | ||
| tls.CurveP384, // Higher security margin | ||
| tls.CurveP521, // Highest security margin | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| //go:build go1.24 | ||
| // +build go1.24 | ||
|
|
||
| package configtls | ||
|
|
||
| import ( | ||
| "crypto/tls" | ||
| "testing" | ||
| ) | ||
|
|
||
| func TestX25519MLKEM768Value(t *testing.T) { | ||
| if X25519MLKEM768 != tls.X25519MLKEM768 { | ||
| t.Errorf("X25519MLKEM768 constant (%v) does not match tls.X25519MLKEM768 (%v)", | ||
| X25519MLKEM768, tls.X25519MLKEM768) | ||
| } | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the same set as
tlsCurveTypesright above