diff --git a/tls/s2n_cipher_preferences.c b/tls/s2n_cipher_preferences.c index d77f863c443..77299b62f4f 100644 --- a/tls/s2n_cipher_preferences.c +++ b/tls/s2n_cipher_preferences.c @@ -2014,6 +2014,63 @@ const struct s2n_cipher_preferences cipher_preferences_20210816_gcm = { .allow_chacha20_boosting = false, }; +/* Cipher suite options for backwards compatibility with older clients, + * while prioritizing forward secret key exchange and ECDSA certificates. + */ +struct s2n_cipher_suite *cipher_suites_20240603[] = { + /* TLS1.3 suites */ + &s2n_tls13_aes_128_gcm_sha256, + &s2n_tls13_aes_256_gcm_sha384, + &s2n_tls13_chacha20_poly1305_sha256, + + /* Preferred ECDHE + ECDSA suites */ + &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, + &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, + &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, + &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, + &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, + + /* Preferred ECDHE + RSA suites */ + &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, + &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, + &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, + &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, + &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, + + /* Legacy ECDHE suites */ + &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, + &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, + &s2n_ecdhe_rsa_with_aes_128_cbc_sha, + &s2n_ecdhe_rsa_with_aes_256_cbc_sha, + + /* DHE suites */ + &s2n_dhe_rsa_with_aes_128_gcm_sha256, + &s2n_dhe_rsa_with_aes_128_cbc_sha256, + &s2n_dhe_rsa_with_aes_256_gcm_sha384, + &s2n_dhe_rsa_with_aes_256_cbc_sha256, + &s2n_dhe_rsa_with_aes_128_cbc_sha, + &s2n_dhe_rsa_with_aes_256_cbc_sha, + + /* 3DES suites */ + &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, + &s2n_dhe_rsa_with_3des_ede_cbc_sha, + + /* RSA kex suites */ + &s2n_rsa_with_aes_128_gcm_sha256, + &s2n_rsa_with_aes_128_cbc_sha256, + &s2n_rsa_with_aes_256_gcm_sha384, + &s2n_rsa_with_aes_256_cbc_sha256, + &s2n_rsa_with_aes_128_cbc_sha, + &s2n_rsa_with_aes_256_cbc_sha, + &s2n_rsa_with_3des_ede_cbc_sha, +}; + +const struct s2n_cipher_preferences cipher_preferences_20240603 = { + .count = s2n_array_len(cipher_suites_20240603), + .suites = cipher_suites_20240603, + .allow_chacha20_boosting = true, +}; + struct s2n_cipher_suite *cipher_suites_rfc9151[] = { /* TLS1.2 */ &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, diff --git a/tls/s2n_cipher_preferences.h b/tls/s2n_cipher_preferences.h index 4c27b8fc97d..a9e622e320d 100644 --- a/tls/s2n_cipher_preferences.h +++ b/tls/s2n_cipher_preferences.h @@ -58,6 +58,7 @@ extern const struct s2n_cipher_preferences cipher_preferences_20210825_gcm; extern const struct s2n_cipher_preferences cipher_preferences_20210831; extern const struct s2n_cipher_preferences cipher_preferences_20231213; extern const struct s2n_cipher_preferences cipher_preferences_20231214; +extern const struct s2n_cipher_preferences cipher_preferences_20240603; extern const struct s2n_cipher_preferences cipher_preferences_default_fips; diff --git a/tls/s2n_ecc_preferences.c b/tls/s2n_ecc_preferences.c index 139cf6c52cd..07d09798254 100644 --- a/tls/s2n_ecc_preferences.c +++ b/tls/s2n_ecc_preferences.c @@ -70,6 +70,16 @@ const struct s2n_ecc_named_curve *const s2n_ecc_pref_list_20201021[] = { &s2n_ecc_curve_secp521r1, }; +/* Prefer x25519 over p256 for performance */ +const struct s2n_ecc_named_curve *const s2n_ecc_pref_list_20240603[] = { +#if EVP_APIS_SUPPORTED + &s2n_ecc_curve_x25519, +#endif + &s2n_ecc_curve_secp256r1, + &s2n_ecc_curve_secp384r1, + &s2n_ecc_curve_secp521r1, +}; + const struct s2n_ecc_named_curve *const s2n_ecc_pref_list_20210816[] = { &s2n_ecc_curve_secp384r1, }; @@ -118,6 +128,11 @@ const struct s2n_ecc_preferences s2n_ecc_preferences_20210816 = { .ecc_curves = s2n_ecc_pref_list_20210816, }; +const struct s2n_ecc_preferences s2n_ecc_preferences_20240603 = { + .count = s2n_array_len(s2n_ecc_pref_list_20240603), + .ecc_curves = s2n_ecc_pref_list_20240603, +}; + const struct s2n_ecc_preferences s2n_ecc_preferences_test_all = { .count = s2n_array_len(s2n_ecc_pref_list_test_all), .ecc_curves = s2n_ecc_pref_list_test_all, diff --git a/tls/s2n_ecc_preferences.h b/tls/s2n_ecc_preferences.h index ec58eae4ef1..f046157e0ac 100644 --- a/tls/s2n_ecc_preferences.h +++ b/tls/s2n_ecc_preferences.h @@ -33,6 +33,7 @@ extern const struct s2n_ecc_preferences s2n_ecc_preferences_20230623; extern const struct s2n_ecc_preferences s2n_ecc_preferences_default_fips; extern const struct s2n_ecc_preferences s2n_ecc_preferences_20201021; extern const struct s2n_ecc_preferences s2n_ecc_preferences_20210816; +extern const struct s2n_ecc_preferences s2n_ecc_preferences_20240603; extern const struct s2n_ecc_preferences s2n_ecc_preferences_test_all; extern const struct s2n_ecc_preferences s2n_ecc_preferences_null; diff --git a/tls/s2n_security_policies.c b/tls/s2n_security_policies.c index 7290bc554ec..aa6c461d49f 100644 --- a/tls/s2n_security_policies.c +++ b/tls/s2n_security_policies.c @@ -59,6 +59,15 @@ const struct s2n_security_policy security_policy_20240503 = { }, }; +const struct s2n_security_policy security_policy_20240603 = { + .minimum_protocol_version = S2N_TLS12, + .cipher_preferences = &cipher_preferences_20240603, + .kem_preferences = &kem_preferences_null, + .signature_preferences = &s2n_signature_preferences_20240501, + .certificate_signature_preferences = &s2n_certificate_signature_preferences_20201110, + .ecc_preferences = &s2n_ecc_preferences_20240603, +}; + const struct s2n_security_policy security_policy_20170210 = { .minimum_protocol_version = S2N_TLS10, .cipher_preferences = &cipher_preferences_20170210, @@ -1228,6 +1237,7 @@ struct s2n_security_policy_selection security_policy_selection[] = { { .version = "20201021", .security_policy = &security_policy_20201021, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20210816", .security_policy = &security_policy_20210816, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "20210816_GCM", .security_policy = &security_policy_20210816_gcm, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, + { .version = "20240603", .security_policy = &security_policy_20240603, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "rfc9151", .security_policy = &security_policy_rfc9151, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "test_all", .security_policy = &security_policy_test_all, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, { .version = "test_all_fips", .security_policy = &security_policy_test_all_fips, .ecc_extension_required = 0, .pq_kem_extension_required = 0 }, diff --git a/tls/s2n_security_policies.h b/tls/s2n_security_policies.h index 18c20be105a..93a51bc274f 100644 --- a/tls/s2n_security_policies.h +++ b/tls/s2n_security_policies.h @@ -122,6 +122,8 @@ extern const struct s2n_security_policy security_policy_20230317; extern const struct s2n_security_policy security_policy_20240331; extern const struct s2n_security_policy security_policy_20240417; extern const struct s2n_security_policy security_policy_20240416; +extern const struct s2n_security_policy security_policy_20240603; + extern const struct s2n_security_policy security_policy_rfc9151; extern const struct s2n_security_policy security_policy_test_all;