-
Notifications
You must be signed in to change notification settings - Fork 977
Implement opt-out for PQ TLS #6648
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
base: master
Are you sure you want to change the base?
Changes from all commits
8d4b7e1
d3d1739
a86a2e1
2c652cc
6871bd9
fc68ad3
fc7f64a
05c207e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "type": "bugfix", | ||
| "category": "AWS SDK for Java v2", | ||
| "contributor": "WillChilds-Klein", | ||
| "description": "Java CRT 0.39.3 enables and prefers PQ by default, so `TLS_CIPHER_SYSTEM_DEFAULT` now uses PQ cipher suites. The `postQuantumTlsEnabled` builder option in aws-sdk-java-v2 now becomes an opt-out mechanism; setting it to false explicitly disables PQ by using policy `TLS_CIPHER_PREF_TLSv1_0_2023`." | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,14 +20,11 @@ | |
| import software.amazon.awssdk.annotations.SdkInternalApi; | ||
| import software.amazon.awssdk.crt.io.SocketOptions; | ||
| import software.amazon.awssdk.crt.io.TlsCipherPreference; | ||
| import software.amazon.awssdk.http.crt.AwsCrtAsyncHttpClient; | ||
| import software.amazon.awssdk.http.crt.TcpKeepAliveConfiguration; | ||
| import software.amazon.awssdk.utils.Logger; | ||
| import software.amazon.awssdk.utils.NumericUtils; | ||
|
|
||
| @SdkInternalApi | ||
| public final class AwsCrtConfigurationUtils { | ||
| private static final Logger log = Logger.loggerFor(AwsCrtAsyncHttpClient.class); | ||
|
|
||
| private AwsCrtConfigurationUtils() { | ||
| } | ||
|
|
@@ -55,19 +52,13 @@ public static SocketOptions buildSocketOptions(TcpKeepAliveConfiguration tcpKeep | |
| } | ||
|
|
||
| public static TlsCipherPreference resolveCipherPreference(Boolean postQuantumTlsEnabled) { | ||
| TlsCipherPreference defaultTls = TlsCipherPreference.TLS_CIPHER_SYSTEM_DEFAULT; | ||
| if (postQuantumTlsEnabled == null || !postQuantumTlsEnabled) { | ||
| return defaultTls; | ||
| // As of of v0.39.3, aws-crt-java prefers PQ by default, so only return the pre-PQ-default policy | ||
| // below if the caller explicitly disables PQ by passing in false. | ||
| if (Boolean.FALSE.equals(postQuantumTlsEnabled) | ||
| && TlsCipherPreference.TLS_CIPHER_PREF_TLSv1_0_2023.isSupported()) { | ||
| return TlsCipherPreference.TLS_CIPHER_PREF_TLSv1_0_2023; | ||
|
Contributor
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. It seems this policy may get outdated in the future. Can we create a non-PQTLS default TLS policy that always uses the latest TLS versions?
Author
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. Unfortunately we can't enforce a minimum TLS version higher than this due to some SDKs (IoT, some others) requiring TLS 1.0 support for the foreseeable future.
Contributor
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. That's totally fine. I'm proposing creating a new TlsCipherPreference that always links to the recommended non-PQTLS preference, for now, it's
Author
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. understood, and i agree that's a useful abstraction. does this concern block the current PR? i'd be happy to take this up as a follow-on. it would require an upstream CRT change + release. |
||
| } | ||
|
|
||
| TlsCipherPreference pqTls = TlsCipherPreference.TLS_CIPHER_PQ_DEFAULT; | ||
| if (!pqTls.isSupported()) { | ||
| log.warn(() -> "Hybrid post-quantum cipher suites are not supported on this platform. The SDK will use the system " | ||
| + "default cipher suites instead"); | ||
| return defaultTls; | ||
| } | ||
|
|
||
| return pqTls; | ||
| return TlsCipherPreference.TLS_CIPHER_SYSTEM_DEFAULT; | ||
| } | ||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.