Skip to content

Commit d3ef30c

Browse files
authored
refactor: Adds tls13 ciphersuites to default/default_fips policy (#5560)
1 parent 5d54c25 commit d3ef30c

File tree

12 files changed

+202
-30
lines changed

12 files changed

+202
-30
lines changed

docs/usage-guide/topics/ch06-security-policies.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ s2n-tls uses pre-made security policies to help avoid common misconfiguration mi
66

77
## Supported TLS Versions
88

9-
Currently TLS 1.2 is our default version, but we recommend TLS 1.3 where possible. To use TLS 1.3 you need a security policy that supports TLS 1.3.
9+
The default security policy supports TLS13 and will negotiate it wherever possible.
1010

1111
## Deprecation of Security Policies
1212

@@ -27,8 +27,8 @@ The following chart maps the security policy version to protocol version and cip
2727

2828
| version | TLS1.0 | TLS1.1 | TLS1.2 | TLS1.3 | AES-CBC | AES-GCM | CHACHAPOLY | 3DES | RC4 | DHE | ECDHE | RSA kx |
2929
|---------------|--------|--------|--------|--------|---------|---------|------------|------|-----|-----|-------|--------|
30-
| default | | | X | | X | X | | | | | X | |
31-
| default_fips | | | X | | X | X | | | | | X | |
30+
| default | | | X | X | X | X | X | | | | X | |
31+
| default_fips | | | X | X | X | X | | | | | X | |
3232
| default_tls13 | | | X | X | X | X | X | | | | X | |
3333
| 20240501 | | | X | | X | X | | | | | X | |
3434
| 20240502 | | | X | | X | X | | | | | X | |
@@ -65,9 +65,7 @@ matching fixed versions are:
6565

6666
| "default" | "default_fips" | "default_tls13" | "rfc9151" |
6767
|-----------|----------------|-----------------|-----------|
68-
| 20240501 | 20240502 | 20240503 | 20251013 |
69-
70-
"default_fips" does not currently support TLS1.3. If you need a policy that supports both FIPS and TLS1.3, choose "20230317". We plan to add TLS1.3 support to both "default" and "default_fips" in the future.
68+
| 20251014 | 20251015 | 20240503 | 20251013 |
7169

7270
"rfc9151" is derived from [Commercial National Security Algorithm (CNSA) Suite Profile for TLS and DTLS 1.2 and 1.3](https://datatracker.ietf.org/doc/html/rfc9151). This policy restricts the algorithms allowed for signatures on certificates in the certificate chain to RSA or ECDSA with sha384, which may require you to update your certificates.
7371
Like the default policies, this policy may also change if the source RFC definition changes.
@@ -155,7 +153,7 @@ s2n-tls usually prefers AES over ChaCha20. However, some clients-- particularly
155153

156154
| Version | "default" | "default_fips" | "default_tls13" | "rfc9151" |
157155
|------------|-----------|----------------|-----------------|-----------|
158-
| v1.5.28 | 20240501 | 20240502 | 20240503 | 20251013 |
156+
| v1.6.0 | 20251014 | 20251015 | 20240503 | 20251013 |
159157
| v1.5.25 | 20240501 | 20240502 | 20240503 | 20250429 |
160158
| v1.4.16 | 20240501 | 20240502 | 20240503 | (*) |
161159
| Older | 20170210 | 20240416 | 20240417 | (*) |
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
min version: TLS1.2
2+
rules:
3+
- Perfect Forward Secrecy: yes
4+
- FIPS 140-3 (2019): no
5+
cipher suites:
6+
- TLS_AES_128_GCM_SHA256
7+
- TLS_AES_256_GCM_SHA384
8+
- TLS_CHACHA20_POLY1305_SHA256
9+
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
10+
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
11+
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
12+
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
13+
signature schemes:
14+
- ecdsa_sha256
15+
- ecdsa_sha384
16+
- ecdsa_sha512
17+
- rsa_pss_pss_sha256
18+
- rsa_pss_pss_sha384
19+
- rsa_pss_pss_sha512
20+
- rsa_pss_rsae_sha256
21+
- rsa_pss_rsae_sha384
22+
- rsa_pss_rsae_sha512
23+
- rsa_pkcs1_sha256
24+
- rsa_pkcs1_sha384
25+
- rsa_pkcs1_sha512
26+
curves:
27+
- secp256r1
28+
- x25519
29+
- secp384r1
30+
- secp521r1
31+
pq:
32+
- revision: 5
33+
- kem groups:
34+
-- X25519MLKEM768
35+
-- SecP256r1MLKEM768
36+
-- SecP384r1MLKEM1024
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
min version: TLS1.2
2+
rules:
3+
- Perfect Forward Secrecy: yes
4+
- FIPS 140-3 (2019): yes
5+
cipher suites:
6+
- TLS_AES_128_GCM_SHA256
7+
- TLS_AES_256_GCM_SHA384
8+
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
9+
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
10+
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
11+
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
12+
signature schemes:
13+
- ecdsa_sha256
14+
- ecdsa_sha384
15+
- ecdsa_sha512
16+
- rsa_pss_pss_sha256
17+
- rsa_pss_pss_sha384
18+
- rsa_pss_pss_sha512
19+
- rsa_pss_rsae_sha256
20+
- rsa_pss_rsae_sha384
21+
- rsa_pss_rsae_sha512
22+
- rsa_pkcs1_sha256
23+
- rsa_pkcs1_sha384
24+
- rsa_pkcs1_sha512
25+
curves:
26+
- secp256r1
27+
- secp384r1
28+
- secp521r1
29+
certificate signature schemes:
30+
- rsa_pss_pss_sha256
31+
- rsa_pss_pss_sha384
32+
- rsa_pss_pss_sha512
33+
- rsa_pss_rsae_sha256
34+
- rsa_pss_rsae_sha384
35+
- rsa_pss_rsae_sha512
36+
- rsa_pkcs1_sha256
37+
- rsa_pkcs1_sha384
38+
- rsa_pkcs1_sha512
39+
- legacy_rsa_sha224
40+
- ecdsa_sha256
41+
- ecdsa_sha384
42+
- ecdsa_sha512
43+
- legacy_ecdsa_sha224
44+
pq:
45+
- revision: 5
46+
- kem groups:
47+
-- X25519MLKEM768
48+
-- SecP256r1MLKEM768
49+
-- SecP384r1MLKEM1024

tests/policy_snapshot/snapshots/default

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ rules:
33
- Perfect Forward Secrecy: yes
44
- FIPS 140-3 (2019): no
55
cipher suites:
6+
- TLS_AES_128_GCM_SHA256
7+
- TLS_AES_256_GCM_SHA384
8+
- TLS_CHACHA20_POLY1305_SHA256
69
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
710
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
8-
- TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
9-
- TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1011
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1112
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
12-
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
13-
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1413
signature schemes:
1514
- ecdsa_sha256
1615
- ecdsa_sha384
@@ -29,3 +28,9 @@ curves:
2928
- x25519
3029
- secp384r1
3130
- secp521r1
31+
pq:
32+
- revision: 5
33+
- kem groups:
34+
-- X25519MLKEM768
35+
-- SecP256r1MLKEM768
36+
-- SecP384r1MLKEM1024

tests/policy_snapshot/snapshots/default_fips

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ rules:
33
- Perfect Forward Secrecy: yes
44
- FIPS 140-3 (2019): yes
55
cipher suites:
6+
- TLS_AES_128_GCM_SHA256
7+
- TLS_AES_256_GCM_SHA384
68
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
79
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
8-
- TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
9-
- TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
1010
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
1111
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
12-
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
13-
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
1412
signature schemes:
1513
- ecdsa_sha256
1614
- ecdsa_sha384
@@ -43,3 +41,9 @@ certificate signature schemes:
4341
- ecdsa_sha384
4442
- ecdsa_sha512
4543
- legacy_ecdsa_sha224
44+
pq:
45+
- revision: 5
46+
- kem groups:
47+
-- X25519MLKEM768
48+
-- SecP256r1MLKEM768
49+
-- SecP384r1MLKEM1024

tests/unit/s2n_choose_supported_group_test.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ int main()
3030
BEGIN_TEST();
3131
EXPECT_SUCCESS(s2n_disable_tls13_in_test());
3232

33-
/* Tests with default KEM preferences (kem_preferences_null) */
33+
/* Tests with 20240501 KEM preferences (kem_preferences_null) */
3434
{
3535
/* If the lists of mutually supported groups are empty, chosen group should be set to null */
3636
{
3737
struct s2n_connection *server_conn = NULL;
3838
EXPECT_NOT_NULL(server_conn = s2n_connection_new(S2N_SERVER));
39+
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "20240501"));
3940

4041
const struct s2n_ecc_preferences *ecc_pref = NULL;
4142
EXPECT_SUCCESS(s2n_connection_get_ecc_preferences(server_conn, &ecc_pref));
@@ -73,6 +74,7 @@ int main()
7374
{
7475
struct s2n_connection *server_conn = NULL;
7576
EXPECT_NOT_NULL(server_conn = s2n_connection_new(S2N_SERVER));
77+
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "20240501"));
7678

7779
const struct s2n_ecc_preferences *ecc_pref = NULL;
7880
EXPECT_SUCCESS(s2n_connection_get_ecc_preferences(server_conn, &ecc_pref));
@@ -111,6 +113,7 @@ int main()
111113
{
112114
struct s2n_connection *server_conn = NULL;
113115
EXPECT_NOT_NULL(server_conn = s2n_connection_new(S2N_SERVER));
116+
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "20240501"));
114117

115118
const struct s2n_ecc_preferences *ecc_pref = NULL;
116119
EXPECT_SUCCESS(s2n_connection_get_ecc_preferences(server_conn, &ecc_pref));

tests/unit/s2n_security_policies_test.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ int main(int argc, char **argv)
217217
EXPECT_FALSE(s2n_pq_kem_is_extension_required(security_policy));
218218
EXPECT_NULL(security_policy->kem_preferences->kems);
219219
EXPECT_EQUAL(0, security_policy->kem_preferences->kem_count);
220-
EXPECT_NULL(security_policy->kem_preferences->tls13_kem_groups);
221-
EXPECT_EQUAL(0, security_policy->kem_preferences->tls13_kem_group_count);
222-
EXPECT_FALSE(s2n_security_policy_supports_tls13(security_policy));
220+
EXPECT_EQUAL(security_policy->kem_preferences, &kem_preferences_pq_tls_1_3_ietf_2025_07);
221+
EXPECT_EQUAL(3, security_policy->kem_preferences->tls13_kem_group_count);
222+
EXPECT_TRUE(s2n_security_policy_supports_tls13(security_policy));
223223

224224
security_policy = NULL;
225225
EXPECT_SUCCESS(s2n_find_security_policy_from_version("default_tls13", &security_policy));
@@ -309,8 +309,6 @@ int main(int argc, char **argv)
309309

310310
{
311311
char tls12_only_security_policy_strings[][255] = {
312-
"default",
313-
"default_fips",
314312
"ELBSecurityPolicy-TLS-1-0-2015-04",
315313
"ELBSecurityPolicy-TLS-1-0-2015-05",
316314
"ELBSecurityPolicy-2016-08",
@@ -364,6 +362,8 @@ int main(int argc, char **argv)
364362
}
365363

366364
char tls13_security_policy_strings[][255] = {
365+
"default",
366+
"default_fips",
367367
"default_tls13",
368368
"test_all",
369369
"test_all_tls13",
@@ -905,6 +905,7 @@ int main(int argc, char **argv)
905905
const struct s2n_security_policy *versioned_policies[] = {
906906
&security_policy_20170210,
907907
&security_policy_20240501,
908+
&security_policy_20251014,
908909
};
909910

910911
DEFER_CLEANUP(struct s2n_test_cert_chain_list cert_chains = { 0 },
@@ -958,6 +959,7 @@ int main(int argc, char **argv)
958959
const struct s2n_security_policy *versioned_policies[] = {
959960
&security_policy_20240416,
960961
&security_policy_20240502,
962+
&security_policy_20251015,
961963
};
962964

963965
DEFER_CLEANUP(struct s2n_test_cert_chain_list cert_chains = { 0 },

tests/unit/s2n_tls13_support_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ int main(int argc, char **argv)
3333
/* TLS 1.3 is not used by default */
3434
EXPECT_FALSE(s2n_use_default_tls13_config());
3535

36-
/* TLS1.3 is not supported or configured by default */
36+
/* TLS1.3 is supported or configured by default */
3737
{
38-
/* Client does not support or configure TLS 1.3 */
38+
/* Client supports and configures TLS 1.3 */
3939
{
4040
struct s2n_connection *conn = NULL;
4141
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_CLIENT));
@@ -44,12 +44,12 @@ int main(int argc, char **argv)
4444

4545
const struct s2n_security_policy *security_policy = NULL;
4646
EXPECT_SUCCESS(s2n_connection_get_security_policy(conn, &security_policy));
47-
EXPECT_FALSE(s2n_security_policy_supports_tls13(security_policy));
47+
EXPECT_TRUE(s2n_security_policy_supports_tls13(security_policy));
4848

4949
EXPECT_SUCCESS(s2n_connection_free(conn));
5050
};
5151

52-
/* Server does not support or configure TLS 1.3 */
52+
/* Server supports and configures TLS 1.3 */
5353
{
5454
struct s2n_connection *conn = NULL;
5555
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER));
@@ -58,7 +58,7 @@ int main(int argc, char **argv)
5858

5959
const struct s2n_security_policy *security_policy = NULL;
6060
EXPECT_SUCCESS(s2n_connection_get_security_policy(conn, &security_policy));
61-
EXPECT_FALSE(s2n_security_policy_supports_tls13(security_policy));
61+
EXPECT_TRUE(s2n_security_policy_supports_tls13(security_policy));
6262

6363
EXPECT_SUCCESS(s2n_connection_free(conn));
6464
};

tls/s2n_cipher_preferences.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,51 @@ const struct s2n_cipher_preferences cipher_preferences_20230317 = {
302302
.allow_chacha20_boosting = false,
303303
};
304304

305+
/*
306+
* TLS1.3 support.
307+
*/
308+
struct s2n_cipher_suite *cipher_suites_20251014[] = {
309+
S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716,
310+
311+
/* TLS1.2 with ECDSA */
312+
&s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256,
313+
&s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384,
314+
315+
/* TLS1.2 with RSA */
316+
&s2n_ecdhe_rsa_with_aes_128_gcm_sha256,
317+
&s2n_ecdhe_rsa_with_aes_256_gcm_sha384,
318+
};
319+
320+
const struct s2n_cipher_preferences cipher_preferences_20251014 = {
321+
.count = s2n_array_len(cipher_suites_20251014),
322+
.suites = cipher_suites_20251014,
323+
.allow_chacha20_boosting = false,
324+
};
325+
326+
/*
327+
* FIPS
328+
* TLS1.3 support.
329+
* Same as 20251014 but without chachapoly
330+
*/
331+
struct s2n_cipher_suite *cipher_suites_20251015[] = {
332+
&s2n_tls13_aes_128_gcm_sha256,
333+
&s2n_tls13_aes_256_gcm_sha384,
334+
335+
/* TLS1.2 with ECDSA */
336+
&s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256,
337+
&s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384,
338+
339+
/* TLS1.2 with RSA */
340+
&s2n_ecdhe_rsa_with_aes_128_gcm_sha256,
341+
&s2n_ecdhe_rsa_with_aes_256_gcm_sha384,
342+
};
343+
344+
const struct s2n_cipher_preferences cipher_preferences_20251015 = {
345+
.count = s2n_array_len(cipher_suites_20251015),
346+
.suites = cipher_suites_20251015,
347+
.allow_chacha20_boosting = false,
348+
};
349+
305350
/*
306351
* No TLS1.3 support.
307352
* FIPS compliant.

tls/s2n_cipher_preferences.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ extern const struct s2n_cipher_preferences cipher_preferences_20241009;
6464
extern const struct s2n_cipher_preferences cipher_preferences_20250211;
6565
extern const struct s2n_cipher_preferences cipher_preferences_20250429;
6666
extern const struct s2n_cipher_preferences cipher_preferences_20251013;
67+
extern const struct s2n_cipher_preferences cipher_preferences_20251014;
68+
extern const struct s2n_cipher_preferences cipher_preferences_20251015;
6769

6870
extern const struct s2n_cipher_preferences cipher_preferences_default_fips;
6971

0 commit comments

Comments
 (0)