1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 #include "tls/s2n_cipher_preferences.h" 17 #include <s2n.h> 18 #include <stdint.h> 19 #include <strings.h> 20 #include "tls/s2n_config.h" 21 #include "tls/s2n_kem.h" 22 #include "tls/s2n_kex.h" 23 24 #include "error/s2n_errno.h" 25 #include "utils/s2n_safety.h" 26 27 /* clang-format off */ 28 /* TLS 1.3 cipher suites, in order of preference. 29 * Can be added to other ciphers suite lists to enable 30 * TLS1.3 compatibility. */ 31 #define S2N_TLS13_CIPHER_SUITES_20190801 \ 32 &s2n_tls13_aes_256_gcm_sha384, \ 33 &s2n_tls13_aes_128_gcm_sha256, \ 34 &s2n_tls13_chacha20_poly1305_sha256 35 36 #define S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716 \ 37 &s2n_tls13_aes_128_gcm_sha256, \ 38 &s2n_tls13_aes_256_gcm_sha384, \ 39 &s2n_tls13_chacha20_poly1305_sha256 40 41 /* s2n's list of cipher suites, in order of preferences, as of 2019-08-01 */ 42 struct s2n_cipher_suite *cipher_suites_20190801[] = { 43 S2N_TLS13_CIPHER_SUITES_20190801, 44 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 45 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 46 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 47 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 48 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 49 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 50 &s2n_rsa_with_aes_128_gcm_sha256, 51 &s2n_rsa_with_aes_128_cbc_sha256, 52 &s2n_rsa_with_aes_128_cbc_sha 53 }; 54 55 const struct s2n_cipher_preferences cipher_preferences_20190801 = { 56 .count = s2n_array_len(cipher_suites_20190801), 57 .suites = cipher_suites_20190801, 58 }; 59 60 /* Same as 20190801, but with ECDSA for TLS 1.2 added */ 61 struct s2n_cipher_suite *cipher_suites_20210831[] = { 62 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 63 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 64 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 65 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 66 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 67 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 68 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 69 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 70 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 71 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 72 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 73 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 74 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 75 &s2n_rsa_with_aes_128_gcm_sha256, 76 &s2n_rsa_with_aes_128_cbc_sha256, 77 &s2n_rsa_with_aes_128_cbc_sha 78 }; 79 80 const struct s2n_cipher_preferences cipher_preferences_20210831 = { 81 .count = s2n_array_len(cipher_suites_20210831), 82 .suites = cipher_suites_20210831, 83 }; 84 85 /* s2n's list of cipher suites, in order of preference, as of 2014-06-01 */ 86 struct s2n_cipher_suite *cipher_suites_20140601[] = { 87 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 88 &s2n_dhe_rsa_with_aes_128_cbc_sha, 89 &s2n_dhe_rsa_with_3des_ede_cbc_sha, 90 &s2n_rsa_with_aes_128_cbc_sha256, 91 &s2n_rsa_with_aes_128_cbc_sha, 92 &s2n_rsa_with_3des_ede_cbc_sha, 93 &s2n_rsa_with_rc4_128_sha, 94 &s2n_rsa_with_rc4_128_md5 95 }; 96 97 const struct s2n_cipher_preferences cipher_preferences_20140601 = { 98 .count = s2n_array_len(cipher_suites_20140601), 99 .suites = cipher_suites_20140601, 100 }; 101 102 /* Disable SSLv3 due to POODLE */ 103 const struct s2n_cipher_preferences cipher_preferences_20141001 = { 104 .count = s2n_array_len(cipher_suites_20140601), 105 .suites = cipher_suites_20140601, 106 }; 107 108 /* Disable RC4 */ 109 struct s2n_cipher_suite *cipher_suites_20150202[] = { 110 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 111 &s2n_dhe_rsa_with_aes_128_cbc_sha, 112 &s2n_dhe_rsa_with_3des_ede_cbc_sha, 113 &s2n_rsa_with_aes_128_cbc_sha256, 114 &s2n_rsa_with_aes_128_cbc_sha, 115 &s2n_rsa_with_3des_ede_cbc_sha 116 }; 117 118 const struct s2n_cipher_preferences cipher_preferences_20150202 = { 119 .count = s2n_array_len(cipher_suites_20150202), 120 .suites = cipher_suites_20150202, 121 }; 122 123 /* Support AES-GCM modes */ 124 struct s2n_cipher_suite *cipher_suites_20150214[] = { 125 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 126 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 127 &s2n_dhe_rsa_with_aes_128_cbc_sha, 128 &s2n_dhe_rsa_with_3des_ede_cbc_sha, 129 &s2n_rsa_with_aes_128_gcm_sha256, 130 &s2n_rsa_with_aes_128_cbc_sha256, 131 &s2n_rsa_with_aes_128_cbc_sha, 132 &s2n_rsa_with_3des_ede_cbc_sha 133 }; 134 135 const struct s2n_cipher_preferences cipher_preferences_20150214 = { 136 .count = s2n_array_len(cipher_suites_20150214), 137 .suites = cipher_suites_20150214, 138 }; 139 140 /* Make a CBC cipher #1 to avoid negotiating GCM with buggy Java clients */ 141 struct s2n_cipher_suite *cipher_suites_20160411[] = { 142 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 143 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 144 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 145 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 146 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 147 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 148 &s2n_rsa_with_aes_128_cbc_sha, 149 &s2n_rsa_with_aes_128_gcm_sha256, 150 &s2n_rsa_with_aes_256_gcm_sha384, 151 &s2n_rsa_with_aes_128_cbc_sha256, 152 &s2n_rsa_with_aes_256_cbc_sha, 153 &s2n_rsa_with_aes_256_cbc_sha256, 154 &s2n_rsa_with_3des_ede_cbc_sha, 155 }; 156 157 const struct s2n_cipher_preferences cipher_preferences_20160411 = { 158 .count = s2n_array_len(cipher_suites_20160411), 159 .suites = cipher_suites_20160411, 160 }; 161 162 /* Use ECDHE instead of plain DHE. Prioritize ECDHE in favour of non ECDHE; GCM in favour of CBC; AES128 in favour of AES256. */ 163 struct s2n_cipher_suite *cipher_suites_20150306[] = { 164 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 165 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 166 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 167 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 168 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 169 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 170 &s2n_rsa_with_aes_128_gcm_sha256, 171 &s2n_rsa_with_aes_128_cbc_sha256, 172 &s2n_rsa_with_aes_128_cbc_sha, 173 &s2n_rsa_with_3des_ede_cbc_sha 174 }; 175 176 const struct s2n_cipher_preferences cipher_preferences_20150306 = { 177 .count = s2n_array_len(cipher_suites_20150306), 178 .suites = cipher_suites_20150306, 179 }; 180 181 struct s2n_cipher_suite *cipher_suites_20160804[] = { 182 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 183 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 184 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 185 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 186 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 187 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 188 &s2n_rsa_with_aes_128_gcm_sha256, 189 &s2n_rsa_with_aes_256_gcm_sha384, 190 &s2n_rsa_with_aes_128_cbc_sha, 191 &s2n_rsa_with_aes_128_cbc_sha256, 192 &s2n_rsa_with_aes_256_cbc_sha, 193 &s2n_rsa_with_aes_256_cbc_sha256, 194 &s2n_rsa_with_3des_ede_cbc_sha 195 }; 196 197 const struct s2n_cipher_preferences cipher_preferences_20160804 = { 198 .count = s2n_array_len(cipher_suites_20160804), 199 .suites = cipher_suites_20160804, 200 }; 201 202 struct s2n_cipher_suite *cipher_suites_20160824[] = { 203 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 204 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 205 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 206 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 207 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 208 &s2n_rsa_with_aes_128_gcm_sha256, 209 &s2n_rsa_with_aes_128_cbc_sha256, 210 &s2n_rsa_with_aes_128_cbc_sha 211 }; 212 213 const struct s2n_cipher_preferences cipher_preferences_20160824 = { 214 .count = s2n_array_len(cipher_suites_20160824), 215 .suites = cipher_suites_20160824, 216 }; 217 218 /* Add ChaCha20 suite */ 219 struct s2n_cipher_suite *cipher_suites_20170210[] = { 220 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 221 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 222 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 223 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 224 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 225 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 226 &s2n_rsa_with_aes_128_gcm_sha256, 227 &s2n_rsa_with_aes_128_cbc_sha256, 228 &s2n_rsa_with_aes_128_cbc_sha 229 }; 230 231 const struct s2n_cipher_preferences cipher_preferences_20170210 = { 232 .count = s2n_array_len(cipher_suites_20170210), 233 .suites = cipher_suites_20170210, 234 }; 235 236 /* Same as 20160411, but with ChaCha20 added as 1st in Preference List */ 237 struct s2n_cipher_suite *cipher_suites_20190122[] = { 238 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 239 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 240 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 241 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 242 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 243 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 244 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 245 &s2n_rsa_with_aes_128_cbc_sha, 246 &s2n_rsa_with_aes_128_gcm_sha256, 247 &s2n_rsa_with_aes_256_gcm_sha384, 248 &s2n_rsa_with_aes_128_cbc_sha256, 249 &s2n_rsa_with_aes_256_cbc_sha, 250 &s2n_rsa_with_aes_256_cbc_sha256, 251 &s2n_rsa_with_3des_ede_cbc_sha, 252 }; 253 254 const struct s2n_cipher_preferences cipher_preferences_20190122 = { 255 .count = s2n_array_len(cipher_suites_20190122), 256 .suites = cipher_suites_20190122, 257 }; 258 259 /* Same as 20160804, but with ChaCha20 added as 2nd in Preference List */ 260 struct s2n_cipher_suite *cipher_suites_20190121[] = { 261 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 262 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 263 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 264 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 265 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 266 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 267 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 268 &s2n_rsa_with_aes_128_gcm_sha256, 269 &s2n_rsa_with_aes_256_gcm_sha384, 270 &s2n_rsa_with_aes_128_cbc_sha, 271 &s2n_rsa_with_aes_128_cbc_sha256, 272 &s2n_rsa_with_aes_256_cbc_sha, 273 &s2n_rsa_with_aes_256_cbc_sha256, 274 &s2n_rsa_with_3des_ede_cbc_sha 275 }; 276 277 const struct s2n_cipher_preferences cipher_preferences_20190121 = { 278 .count = s2n_array_len(cipher_suites_20190121), 279 .suites = cipher_suites_20190121, 280 }; 281 282 /* Same as 20160411, but with ChaCha20 in 3rd Place after CBC and GCM */ 283 struct s2n_cipher_suite *cipher_suites_20190120[] = { 284 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 285 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 286 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 287 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 288 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 289 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 290 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 291 &s2n_rsa_with_aes_128_cbc_sha, 292 &s2n_rsa_with_aes_128_gcm_sha256, 293 &s2n_rsa_with_aes_256_gcm_sha384, 294 &s2n_rsa_with_aes_128_cbc_sha256, 295 &s2n_rsa_with_aes_256_cbc_sha, 296 &s2n_rsa_with_aes_256_cbc_sha256, 297 &s2n_rsa_with_3des_ede_cbc_sha, 298 }; 299 300 const struct s2n_cipher_preferences cipher_preferences_20190120 = { 301 .count = s2n_array_len(cipher_suites_20190120), 302 .suites = cipher_suites_20190120, 303 }; 304 305 /* Preferences optimized for interop, includes ECDSA priortitized. DHE and 3DES are added(at the lowest preference). */ 306 struct s2n_cipher_suite *cipher_suites_20190214[] = { 307 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 308 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 309 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 310 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 311 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 312 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 313 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 314 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 315 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 316 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 317 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 318 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 319 &s2n_rsa_with_aes_128_cbc_sha, 320 &s2n_rsa_with_aes_128_gcm_sha256, 321 &s2n_rsa_with_aes_256_gcm_sha384, 322 &s2n_rsa_with_aes_128_cbc_sha256, 323 &s2n_rsa_with_aes_256_cbc_sha, 324 &s2n_rsa_with_aes_256_cbc_sha256, 325 &s2n_rsa_with_3des_ede_cbc_sha, 326 &s2n_dhe_rsa_with_aes_128_cbc_sha, 327 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 328 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 329 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 330 &s2n_dhe_rsa_with_aes_256_cbc_sha, 331 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 332 }; 333 334 const struct s2n_cipher_preferences cipher_preferences_20190214 = { 335 .count = s2n_array_len(cipher_suites_20190214), 336 .suites = cipher_suites_20190214, 337 }; 338 339 /* 20190214 with aes-gcm prioritized above aes-cbc */ 340 struct s2n_cipher_suite *cipher_suites_20190214_gcm[] = { 341 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 342 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 343 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 344 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 345 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 346 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 347 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 348 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 349 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 350 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 351 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 352 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 353 &s2n_rsa_with_aes_128_gcm_sha256, 354 &s2n_rsa_with_aes_256_gcm_sha384, 355 &s2n_rsa_with_aes_128_cbc_sha, 356 &s2n_rsa_with_aes_128_cbc_sha256, 357 &s2n_rsa_with_aes_256_cbc_sha, 358 &s2n_rsa_with_aes_256_cbc_sha256, 359 &s2n_rsa_with_3des_ede_cbc_sha, 360 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 361 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 362 &s2n_dhe_rsa_with_aes_128_cbc_sha, 363 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 364 &s2n_dhe_rsa_with_aes_256_cbc_sha, 365 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 366 }; 367 368 const struct s2n_cipher_preferences cipher_preferences_20190214_gcm = { 369 .count = s2n_array_len(cipher_suites_20190214_gcm), 370 .suites = cipher_suites_20190214_gcm, 371 }; 372 373 /* Same as cipher_suites_20190214, but with TLS 1.3 Ciphers */ 374 struct s2n_cipher_suite *cipher_suites_20210825[] = { 375 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 376 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 377 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 378 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 379 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 380 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 381 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 382 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 383 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 384 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 385 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 386 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 387 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 388 &s2n_rsa_with_aes_128_cbc_sha, 389 &s2n_rsa_with_aes_128_gcm_sha256, 390 &s2n_rsa_with_aes_256_gcm_sha384, 391 &s2n_rsa_with_aes_128_cbc_sha256, 392 &s2n_rsa_with_aes_256_cbc_sha, 393 &s2n_rsa_with_aes_256_cbc_sha256, 394 &s2n_rsa_with_3des_ede_cbc_sha, 395 &s2n_dhe_rsa_with_aes_128_cbc_sha, 396 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 397 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 398 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 399 &s2n_dhe_rsa_with_aes_256_cbc_sha, 400 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 401 }; 402 403 const struct s2n_cipher_preferences cipher_preferences_20210825 = { 404 .count = s2n_array_len(cipher_suites_20210825), 405 .suites = cipher_suites_20210825, 406 }; 407 408 /* Same as cipher_suites_20190214_gcm, but with TLS 1.3 Ciphers */ 409 struct s2n_cipher_suite *cipher_suites_20210825_gcm[] = { 410 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 411 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 412 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 413 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 414 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 415 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 416 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 417 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 418 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 419 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 420 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 421 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 422 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 423 &s2n_rsa_with_aes_128_gcm_sha256, 424 &s2n_rsa_with_aes_256_gcm_sha384, 425 &s2n_rsa_with_aes_128_cbc_sha, 426 &s2n_rsa_with_aes_128_cbc_sha256, 427 &s2n_rsa_with_aes_256_cbc_sha, 428 &s2n_rsa_with_aes_256_cbc_sha256, 429 &s2n_rsa_with_3des_ede_cbc_sha, 430 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 431 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 432 &s2n_dhe_rsa_with_aes_128_cbc_sha, 433 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 434 &s2n_dhe_rsa_with_aes_256_cbc_sha, 435 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 436 }; 437 438 const struct s2n_cipher_preferences cipher_preferences_20210825_gcm = { 439 .count = s2n_array_len(cipher_suites_20210825_gcm), 440 .suites = cipher_suites_20210825_gcm, 441 }; 442 443 struct s2n_cipher_suite *cipher_suites_null[] = { 444 &s2n_null_cipher_suite 445 }; 446 447 const struct s2n_cipher_preferences cipher_preferences_null = { 448 .count = s2n_array_len(cipher_suites_null), 449 .suites = cipher_suites_null, 450 }; 451 452 /* Preferences optimized for interop. DHE and 3DES are added(at the lowest preference). */ 453 struct s2n_cipher_suite *cipher_suites_20170328[] = { 454 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 455 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 456 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 457 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 458 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 459 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 460 &s2n_rsa_with_aes_128_cbc_sha, 461 &s2n_rsa_with_aes_128_gcm_sha256, 462 &s2n_rsa_with_aes_256_gcm_sha384, 463 &s2n_rsa_with_aes_128_cbc_sha256, 464 &s2n_rsa_with_aes_256_cbc_sha, 465 &s2n_rsa_with_aes_256_cbc_sha256, 466 &s2n_rsa_with_3des_ede_cbc_sha, 467 &s2n_dhe_rsa_with_aes_128_cbc_sha, 468 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 469 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 470 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 471 &s2n_dhe_rsa_with_aes_256_cbc_sha, 472 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 473 }; 474 475 const struct s2n_cipher_preferences cipher_preferences_20170328 = { 476 .count = s2n_array_len(cipher_suites_20170328), 477 .suites = cipher_suites_20170328, 478 }; 479 480 /* Equivalent to cipher_suites_20170328 with aes-gcm prioritized above aes-cbc */ 481 struct s2n_cipher_suite *cipher_suites_20170328_gcm[] = { 482 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 483 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 484 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 485 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 486 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 487 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 488 &s2n_rsa_with_aes_128_gcm_sha256, 489 &s2n_rsa_with_aes_256_gcm_sha384, 490 &s2n_rsa_with_aes_128_cbc_sha, 491 &s2n_rsa_with_aes_128_cbc_sha256, 492 &s2n_rsa_with_aes_256_cbc_sha, 493 &s2n_rsa_with_aes_256_cbc_sha256, 494 &s2n_rsa_with_3des_ede_cbc_sha, 495 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 496 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 497 &s2n_dhe_rsa_with_aes_128_cbc_sha, 498 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 499 &s2n_dhe_rsa_with_aes_256_cbc_sha, 500 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 501 }; 502 503 const struct s2n_cipher_preferences cipher_preferences_20170328_gcm = { 504 .count = s2n_array_len(cipher_suites_20170328_gcm), 505 .suites = cipher_suites_20170328_gcm, 506 }; 507 508 /* Preferences optimized for FIPS compatibility. */ 509 struct s2n_cipher_suite *cipher_suites_20170405[] = { 510 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 511 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 512 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 513 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 514 &s2n_rsa_with_aes_128_cbc_sha, 515 &s2n_rsa_with_aes_128_gcm_sha256, 516 &s2n_rsa_with_aes_256_gcm_sha384, 517 &s2n_rsa_with_aes_128_cbc_sha256, 518 &s2n_rsa_with_aes_256_cbc_sha, 519 &s2n_rsa_with_aes_256_cbc_sha256, 520 &s2n_rsa_with_3des_ede_cbc_sha, 521 }; 522 523 const struct s2n_cipher_preferences cipher_preferences_20170405 = { 524 .count = s2n_array_len(cipher_suites_20170405), 525 .suites = cipher_suites_20170405, 526 }; 527 528 /* Preferences optimized for FIPS compatibility with GCM prioritized */ 529 struct s2n_cipher_suite *cipher_suites_20170405_gcm[] = { 530 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 531 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 532 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 533 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 534 &s2n_rsa_with_aes_128_gcm_sha256, 535 &s2n_rsa_with_aes_256_gcm_sha384, 536 &s2n_rsa_with_aes_128_cbc_sha, 537 &s2n_rsa_with_aes_128_cbc_sha256, 538 &s2n_rsa_with_aes_256_cbc_sha, 539 &s2n_rsa_with_aes_256_cbc_sha256, 540 &s2n_rsa_with_3des_ede_cbc_sha, 541 }; 542 543 const struct s2n_cipher_preferences cipher_preferences_20170405_gcm = { 544 .count = s2n_array_len(cipher_suites_20170405_gcm), 545 .suites = cipher_suites_20170405_gcm, 546 }; 547 548 /* Equivalent to cipher_suite_20160411 with 3DES removed. 549 * Make a CBC cipher #1 to avoid negotiating GCM with buggy Java clients. */ 550 struct s2n_cipher_suite *cipher_suites_20170718[] = { 551 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 552 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 553 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 554 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 555 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 556 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 557 &s2n_rsa_with_aes_128_cbc_sha, 558 &s2n_rsa_with_aes_128_gcm_sha256, 559 &s2n_rsa_with_aes_256_gcm_sha384, 560 &s2n_rsa_with_aes_128_cbc_sha256, 561 &s2n_rsa_with_aes_256_cbc_sha, 562 &s2n_rsa_with_aes_256_cbc_sha256, 563 }; 564 565 const struct s2n_cipher_preferences cipher_preferences_20170718 = { 566 .count = s2n_array_len(cipher_suites_20170718), 567 .suites = cipher_suites_20170718, 568 }; 569 570 /* Equivalent to cipher_suites_20170718 with aes-gcm prioritized above aes-cbc */ 571 struct s2n_cipher_suite *cipher_suites_20170718_gcm[] = { 572 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 573 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 574 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 575 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 576 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 577 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 578 &s2n_rsa_with_aes_128_gcm_sha256, 579 &s2n_rsa_with_aes_256_gcm_sha384, 580 &s2n_rsa_with_aes_128_cbc_sha, 581 &s2n_rsa_with_aes_128_cbc_sha256, 582 &s2n_rsa_with_aes_256_cbc_sha, 583 &s2n_rsa_with_aes_256_cbc_sha256, 584 }; 585 586 const struct s2n_cipher_preferences cipher_preferences_20170718_gcm = { 587 .count = s2n_array_len(cipher_suites_20170718_gcm), 588 .suites = cipher_suites_20170718_gcm, 589 }; 590 591 struct s2n_cipher_suite *cipher_suites_elb_security_policy_2015_04[] = { 592 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 593 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 594 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 595 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 596 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 597 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 598 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 599 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 600 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 601 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 602 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 603 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 604 &s2n_rsa_with_aes_128_gcm_sha256, 605 &s2n_rsa_with_aes_128_cbc_sha256, 606 &s2n_rsa_with_aes_128_cbc_sha, 607 &s2n_rsa_with_aes_256_gcm_sha384, 608 &s2n_rsa_with_aes_256_cbc_sha256, 609 &s2n_rsa_with_aes_256_cbc_sha, 610 &s2n_rsa_with_3des_ede_cbc_sha, 611 }; 612 613 const struct s2n_cipher_preferences elb_security_policy_2015_04 = { 614 .count = s2n_array_len(cipher_suites_elb_security_policy_2015_04), 615 .suites = cipher_suites_elb_security_policy_2015_04, 616 }; 617 618 struct s2n_cipher_suite *cipher_suites_elb_security_policy_2016_08[] = { 619 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 620 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 621 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 622 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 623 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 624 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 625 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 626 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 627 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 628 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 629 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 630 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 631 &s2n_rsa_with_aes_128_gcm_sha256, 632 &s2n_rsa_with_aes_128_cbc_sha256, 633 &s2n_rsa_with_aes_128_cbc_sha, 634 &s2n_rsa_with_aes_256_gcm_sha384, 635 &s2n_rsa_with_aes_256_cbc_sha256, 636 &s2n_rsa_with_aes_256_cbc_sha, 637 }; 638 639 const struct s2n_cipher_preferences elb_security_policy_2016_08 = { 640 .count = s2n_array_len(cipher_suites_elb_security_policy_2016_08), 641 .suites = cipher_suites_elb_security_policy_2016_08, 642 }; 643 644 struct s2n_cipher_suite *cipher_suites_elb_security_policy_tls_1_2_2017_01[] = { 645 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 646 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 647 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 648 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 649 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 650 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 651 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 652 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 653 &s2n_rsa_with_aes_128_gcm_sha256, 654 &s2n_rsa_with_aes_128_cbc_sha256, 655 &s2n_rsa_with_aes_256_gcm_sha384, 656 &s2n_rsa_with_aes_256_cbc_sha256, 657 }; 658 659 const struct s2n_cipher_preferences elb_security_policy_tls_1_2_2017_01 = { 660 .count = s2n_array_len(cipher_suites_elb_security_policy_tls_1_2_2017_01), 661 .suites = cipher_suites_elb_security_policy_tls_1_2_2017_01, 662 }; 663 664 struct s2n_cipher_suite *cipher_suites_elb_security_policy_tls_1_1_2017_01[] = { 665 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 666 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 667 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 668 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 669 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 670 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 671 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 672 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 673 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 674 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 675 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 676 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 677 &s2n_rsa_with_aes_128_gcm_sha256, 678 &s2n_rsa_with_aes_128_cbc_sha256, 679 &s2n_rsa_with_aes_128_cbc_sha, 680 &s2n_rsa_with_aes_256_gcm_sha384, 681 &s2n_rsa_with_aes_256_cbc_sha256, 682 &s2n_rsa_with_aes_256_cbc_sha, 683 }; 684 685 const struct s2n_cipher_preferences elb_security_policy_tls_1_1_2017_01 = { 686 .count = s2n_array_len(cipher_suites_elb_security_policy_tls_1_1_2017_01), 687 .suites = cipher_suites_elb_security_policy_tls_1_1_2017_01, 688 }; 689 690 struct s2n_cipher_suite *cipher_suites_elb_security_policy_tls_1_2_ext_2018_06[] = { 691 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 692 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 693 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 694 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 695 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 696 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 697 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 698 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 699 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 700 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 701 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 702 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 703 &s2n_rsa_with_aes_128_gcm_sha256, 704 &s2n_rsa_with_aes_128_cbc_sha256, 705 &s2n_rsa_with_aes_128_cbc_sha, 706 &s2n_rsa_with_aes_256_gcm_sha384, 707 &s2n_rsa_with_aes_256_cbc_sha256, 708 &s2n_rsa_with_aes_256_cbc_sha, 709 }; 710 711 const struct s2n_cipher_preferences elb_security_policy_tls_1_2_ext_2018_06 = { 712 .count = s2n_array_len(cipher_suites_elb_security_policy_tls_1_2_ext_2018_06), 713 .suites = cipher_suites_elb_security_policy_tls_1_2_ext_2018_06, 714 }; 715 716 struct s2n_cipher_suite *cipher_suites_elb_security_policy_fs_2018_06[] = { 717 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 718 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 719 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 720 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 721 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 722 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 723 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 724 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 725 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 726 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 727 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 728 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 729 }; 730 731 const struct s2n_cipher_preferences elb_security_policy_fs_2018_06 = { 732 .count = s2n_array_len(cipher_suites_elb_security_policy_fs_2018_06), 733 .suites = cipher_suites_elb_security_policy_fs_2018_06, 734 }; 735 736 struct s2n_cipher_suite *cipher_suites_elb_security_policy_fs_1_2_2019_08[] = { 737 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 738 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 739 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 740 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 741 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 742 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 743 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 744 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 745 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 746 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 747 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 748 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 749 }; 750 751 const struct s2n_cipher_preferences elb_security_policy_fs_1_2_2019_08 = { 752 .count = s2n_array_len(cipher_suites_elb_security_policy_fs_1_2_2019_08), 753 .suites = cipher_suites_elb_security_policy_fs_1_2_2019_08, 754 }; 755 756 struct s2n_cipher_suite *cipher_suites_elb_security_policy_fs_1_1_2019_08[] = { 757 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 758 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 759 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 760 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 761 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 762 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 763 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 764 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 765 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 766 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 767 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 768 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 769 }; 770 771 const struct s2n_cipher_preferences elb_security_policy_fs_1_1_2019_08 = { 772 .count = s2n_array_len(cipher_suites_elb_security_policy_fs_1_1_2019_08), 773 .suites = cipher_suites_elb_security_policy_fs_1_1_2019_08, 774 }; 775 776 struct s2n_cipher_suite *cipher_suites_elb_security_policy_fs_1_2_Res_2019_08[] = { 777 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 778 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 779 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 780 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 781 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 782 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 783 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 784 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 785 }; 786 787 const struct s2n_cipher_preferences elb_security_policy_fs_1_2_Res_2019_08 = { 788 .count = s2n_array_len(cipher_suites_elb_security_policy_fs_1_2_Res_2019_08), 789 .suites = cipher_suites_elb_security_policy_fs_1_2_Res_2019_08, 790 }; 791 792 struct s2n_cipher_suite *cipher_suites_cloudfront_upstream[] = { 793 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 794 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 795 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 796 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 797 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 798 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 799 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 800 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 801 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 802 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 803 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 804 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 805 &s2n_rsa_with_aes_256_gcm_sha384, 806 &s2n_rsa_with_aes_128_gcm_sha256, 807 &s2n_rsa_with_aes_256_cbc_sha, 808 &s2n_rsa_with_aes_128_cbc_sha256, 809 &s2n_rsa_with_aes_128_cbc_sha, 810 &s2n_rsa_with_3des_ede_cbc_sha, 811 &s2n_rsa_with_rc4_128_md5 812 }; 813 814 const struct s2n_cipher_preferences cipher_preferences_cloudfront_upstream = { 815 .count = s2n_array_len(cipher_suites_cloudfront_upstream), 816 .suites = cipher_suites_cloudfront_upstream, 817 }; 818 819 /* CloudFront viewer facing (with TLS 1.3) */ 820 struct s2n_cipher_suite *cipher_suites_cloudfront_ssl_v_3[] = { 821 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 822 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 823 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 824 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 825 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 826 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 827 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 828 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 829 &s2n_rsa_with_aes_128_gcm_sha256, 830 &s2n_rsa_with_aes_256_gcm_sha384, 831 &s2n_rsa_with_aes_128_cbc_sha256, 832 &s2n_rsa_with_aes_256_cbc_sha, 833 &s2n_rsa_with_aes_128_cbc_sha, 834 &s2n_rsa_with_3des_ede_cbc_sha, 835 &s2n_rsa_with_rc4_128_md5 836 }; 837 838 const struct s2n_cipher_preferences cipher_preferences_cloudfront_ssl_v_3 = { 839 .count = s2n_array_len(cipher_suites_cloudfront_ssl_v_3), 840 .suites = cipher_suites_cloudfront_ssl_v_3, 841 }; 842 843 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_0_2014[] = { 844 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 845 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 846 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 847 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 848 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 849 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 850 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 851 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 852 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 853 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 854 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 855 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 856 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 857 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 858 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 859 &s2n_rsa_with_aes_128_gcm_sha256, 860 &s2n_rsa_with_aes_256_gcm_sha384, 861 &s2n_rsa_with_aes_128_cbc_sha256, 862 &s2n_rsa_with_aes_256_cbc_sha, 863 &s2n_rsa_with_aes_128_cbc_sha, 864 &s2n_rsa_with_3des_ede_cbc_sha, 865 }; 866 867 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_0_2014 = { 868 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_0_2014), 869 .suites = cipher_suites_cloudfront_tls_1_0_2014, 870 }; 871 872 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_0_2016[] = { 873 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 874 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 875 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 876 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 877 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 878 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 879 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 880 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 881 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 882 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 883 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 884 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 885 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 886 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 887 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 888 &s2n_rsa_with_aes_128_gcm_sha256, 889 &s2n_rsa_with_aes_256_gcm_sha384, 890 &s2n_rsa_with_aes_128_cbc_sha256, 891 &s2n_rsa_with_aes_256_cbc_sha, 892 &s2n_rsa_with_aes_128_cbc_sha 893 }; 894 895 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_0_2016 = { 896 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_0_2016), 897 .suites = cipher_suites_cloudfront_tls_1_0_2016, 898 }; 899 900 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_1_2016[] = { 901 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 902 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 903 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 904 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 905 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 906 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 907 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 908 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 909 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 910 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 911 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 912 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 913 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 914 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 915 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 916 &s2n_rsa_with_aes_128_gcm_sha256, 917 &s2n_rsa_with_aes_256_gcm_sha384, 918 &s2n_rsa_with_aes_128_cbc_sha256, 919 &s2n_rsa_with_aes_256_cbc_sha, 920 &s2n_rsa_with_aes_128_cbc_sha 921 }; 922 923 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_1_2016 = { 924 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_1_2016), 925 .suites = cipher_suites_cloudfront_tls_1_1_2016, 926 }; 927 928 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_2_2018[] = { 929 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 930 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 931 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 932 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 933 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 934 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 935 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 936 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 937 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 938 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 939 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 940 &s2n_rsa_with_aes_128_gcm_sha256, 941 &s2n_rsa_with_aes_256_gcm_sha384, 942 &s2n_rsa_with_aes_128_cbc_sha256 943 }; 944 945 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_2_2018 = { 946 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_2_2018), 947 .suites = cipher_suites_cloudfront_tls_1_2_2018, 948 }; 949 950 /* CloudFront viewer facing legacy TLS 1.2 policies */ 951 struct s2n_cipher_suite *cipher_suites_cloudfront_ssl_v_3_legacy[] = { 952 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 953 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 954 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 955 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 956 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 957 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 958 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 959 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 960 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 961 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 962 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 963 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 964 &s2n_rsa_with_aes_128_gcm_sha256, 965 &s2n_rsa_with_aes_256_gcm_sha384, 966 &s2n_rsa_with_aes_128_cbc_sha256, 967 &s2n_rsa_with_aes_256_cbc_sha, 968 &s2n_rsa_with_aes_128_cbc_sha, 969 &s2n_rsa_with_3des_ede_cbc_sha, 970 &s2n_rsa_with_rc4_128_md5 971 }; 972 973 const struct s2n_cipher_preferences cipher_preferences_cloudfront_ssl_v_3_legacy = { 974 .count = s2n_array_len(cipher_suites_cloudfront_ssl_v_3_legacy), 975 .suites = cipher_suites_cloudfront_ssl_v_3_legacy, 976 }; 977 978 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_0_2014_legacy[] = { 979 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 980 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 981 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 982 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 983 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 984 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 985 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 986 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 987 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 988 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 989 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 990 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 991 &s2n_rsa_with_aes_128_gcm_sha256, 992 &s2n_rsa_with_aes_256_gcm_sha384, 993 &s2n_rsa_with_aes_128_cbc_sha256, 994 &s2n_rsa_with_aes_256_cbc_sha, 995 &s2n_rsa_with_aes_128_cbc_sha, 996 &s2n_rsa_with_3des_ede_cbc_sha, 997 }; 998 999 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_0_2014_legacy = { 1000 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_0_2014_legacy), 1001 .suites = cipher_suites_cloudfront_tls_1_0_2014_legacy, 1002 }; 1003 1004 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_0_2016_legacy[] = { 1005 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1006 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1007 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1008 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1009 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1010 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1011 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1012 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1013 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1014 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1015 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1016 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1017 &s2n_rsa_with_aes_128_gcm_sha256, 1018 &s2n_rsa_with_aes_256_gcm_sha384, 1019 &s2n_rsa_with_aes_128_cbc_sha256, 1020 &s2n_rsa_with_aes_256_cbc_sha, 1021 &s2n_rsa_with_aes_128_cbc_sha 1022 }; 1023 1024 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_0_2016_legacy = { 1025 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_0_2016_legacy), 1026 .suites = cipher_suites_cloudfront_tls_1_0_2016_legacy, 1027 }; 1028 1029 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_1_2016_legacy[] = { 1030 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1031 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1032 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1033 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1034 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1035 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1036 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1037 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1038 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1039 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1040 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1041 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1042 &s2n_rsa_with_aes_128_gcm_sha256, 1043 &s2n_rsa_with_aes_256_gcm_sha384, 1044 &s2n_rsa_with_aes_128_cbc_sha256, 1045 &s2n_rsa_with_aes_256_cbc_sha, 1046 &s2n_rsa_with_aes_128_cbc_sha 1047 }; 1048 1049 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_1_2016_legacy = { 1050 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_1_2016_legacy), 1051 .suites = cipher_suites_cloudfront_tls_1_1_2016_legacy, 1052 }; 1053 1054 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_2_2018_legacy[] = { 1055 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1056 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1057 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1058 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1059 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1060 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1061 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1062 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1063 &s2n_rsa_with_aes_128_gcm_sha256, 1064 &s2n_rsa_with_aes_256_gcm_sha384, 1065 &s2n_rsa_with_aes_128_cbc_sha256 1066 }; 1067 1068 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_2_2018_legacy = { 1069 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_2_2018_legacy), 1070 .suites = cipher_suites_cloudfront_tls_1_2_2018_legacy, 1071 }; 1072 1073 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_2_2019_legacy[] = { 1074 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1075 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1076 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1077 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1078 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1079 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1080 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1081 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256 1082 }; 1083 1084 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_2_2019_legacy = { 1085 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_2_2019_legacy), 1086 .suites = cipher_suites_cloudfront_tls_1_2_2019_legacy, 1087 }; 1088 1089 /* CloudFront upstream */ 1090 struct s2n_cipher_suite *cipher_suites_cloudfront_upstream_tls10[] = { 1091 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1092 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1093 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1094 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1095 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1096 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1097 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1098 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1099 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1100 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1101 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1102 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1103 &s2n_rsa_with_aes_256_gcm_sha384, 1104 &s2n_rsa_with_aes_128_gcm_sha256, 1105 &s2n_rsa_with_aes_256_cbc_sha, 1106 &s2n_rsa_with_aes_128_cbc_sha256, 1107 &s2n_rsa_with_aes_128_cbc_sha, 1108 &s2n_rsa_with_3des_ede_cbc_sha, 1109 &s2n_rsa_with_rc4_128_md5 1110 }; 1111 1112 const struct s2n_cipher_preferences cipher_preferences_cloudfront_upstream_tls10 = { 1113 .count = s2n_array_len(cipher_suites_cloudfront_upstream_tls10), 1114 .suites = cipher_suites_cloudfront_upstream_tls10, 1115 }; 1116 1117 struct s2n_cipher_suite *cipher_suites_cloudfront_upstream_tls11[] = { 1118 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1119 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1120 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1121 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1122 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1123 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1124 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1125 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1126 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1127 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1128 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1129 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1130 &s2n_rsa_with_aes_256_gcm_sha384, 1131 &s2n_rsa_with_aes_128_gcm_sha256, 1132 &s2n_rsa_with_aes_256_cbc_sha, 1133 &s2n_rsa_with_aes_128_cbc_sha256, 1134 &s2n_rsa_with_aes_128_cbc_sha, 1135 &s2n_rsa_with_3des_ede_cbc_sha, 1136 &s2n_rsa_with_rc4_128_md5 1137 }; 1138 1139 const struct s2n_cipher_preferences cipher_preferences_cloudfront_upstream_tls11 = { 1140 .count = s2n_array_len(cipher_suites_cloudfront_upstream_tls11), 1141 .suites = cipher_suites_cloudfront_upstream_tls11, 1142 }; 1143 1144 struct s2n_cipher_suite *cipher_suites_cloudfront_upstream_tls12[] = { 1145 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1146 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1147 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1148 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1149 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1150 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1151 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1152 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1153 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1154 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1155 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1156 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1157 &s2n_rsa_with_aes_256_gcm_sha384, 1158 &s2n_rsa_with_aes_128_gcm_sha256, 1159 &s2n_rsa_with_aes_256_cbc_sha, 1160 &s2n_rsa_with_aes_128_cbc_sha256, 1161 &s2n_rsa_with_aes_128_cbc_sha, 1162 &s2n_rsa_with_3des_ede_cbc_sha, 1163 &s2n_rsa_with_rc4_128_md5 1164 }; 1165 1166 const struct s2n_cipher_preferences cipher_preferences_cloudfront_upstream_tls12 = { 1167 .count = s2n_array_len(cipher_suites_cloudfront_upstream_tls12), 1168 .suites = cipher_suites_cloudfront_upstream_tls12, 1169 }; 1170 1171 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_2_2019[] = { 1172 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1173 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1174 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1175 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1176 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1177 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 1178 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 1179 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1180 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1181 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1182 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256 1183 }; 1184 1185 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_2_2019 = { 1186 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_2_2019), 1187 .suites = cipher_suites_cloudfront_tls_1_2_2019, 1188 }; 1189 1190 struct s2n_cipher_suite *cipher_suites_cloudfront_tls_1_2_2021[] = { 1191 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1192 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1193 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1194 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1195 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1196 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 1197 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256 1198 }; 1199 1200 const struct s2n_cipher_preferences cipher_preferences_cloudfront_tls_1_2_2021 = { 1201 .count = s2n_array_len(cipher_suites_cloudfront_tls_1_2_2021), 1202 .suites = cipher_suites_cloudfront_tls_1_2_2021, 1203 }; 1204 1205 /* Based on cipher_preferences_cloudfront_tls_1_0_2016, but with ordering changed and AES256-SHA256, DES-CBC3-SHA, and 1206 * RC4-MD5 added for compatibility. */ 1207 struct s2n_cipher_suite *cipher_suites_aws_crt_sdk_ssl_v3[] = { 1208 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1209 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1210 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1211 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1212 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1213 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 1214 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 1215 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1216 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1217 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1218 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1219 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1220 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1221 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1222 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1223 &s2n_rsa_with_aes_128_gcm_sha256, 1224 &s2n_rsa_with_aes_256_gcm_sha384, 1225 &s2n_rsa_with_aes_128_cbc_sha256, 1226 &s2n_rsa_with_aes_256_cbc_sha256, 1227 &s2n_rsa_with_aes_128_cbc_sha, 1228 &s2n_rsa_with_aes_256_cbc_sha, 1229 &s2n_rsa_with_3des_ede_cbc_sha, 1230 &s2n_rsa_with_rc4_128_md5 1231 }; 1232 1233 const struct s2n_cipher_preferences cipher_preferences_aws_crt_sdk_ssl_v3 = { 1234 .count = s2n_array_len(cipher_suites_aws_crt_sdk_ssl_v3), 1235 .suites = cipher_suites_aws_crt_sdk_ssl_v3, 1236 }; 1237 1238 /* Based on cipher_preferences_cloudfront_tls_1_0_2016, but with ordering changed and AES256-SHA256 added for 1239 * compatibility. */ 1240 struct s2n_cipher_suite *cipher_suites_aws_crt_sdk_default[] = { 1241 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1242 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1243 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1244 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1245 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1246 &s2n_ecdhe_ecdsa_with_chacha20_poly1305_sha256, 1247 &s2n_ecdhe_rsa_with_chacha20_poly1305_sha256, 1248 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1249 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1250 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1251 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1252 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1253 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1254 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1255 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1256 &s2n_rsa_with_aes_128_gcm_sha256, 1257 &s2n_rsa_with_aes_256_gcm_sha384, 1258 &s2n_rsa_with_aes_128_cbc_sha256, 1259 &s2n_rsa_with_aes_256_cbc_sha256, 1260 &s2n_rsa_with_aes_128_cbc_sha, 1261 &s2n_rsa_with_aes_256_cbc_sha, 1262 }; 1263 1264 const struct s2n_cipher_preferences cipher_preferences_aws_crt_sdk_default = { 1265 .count = s2n_array_len(cipher_suites_aws_crt_sdk_default), 1266 .suites = cipher_suites_aws_crt_sdk_default, 1267 }; 1268 1269 struct s2n_cipher_suite *cipher_suites_aws_crt_sdk_tls_13[] = { 1270 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716 1271 }; 1272 1273 const struct s2n_cipher_preferences cipher_preferences_aws_crt_sdk_tls_13 = { 1274 .count = s2n_array_len(cipher_suites_aws_crt_sdk_tls_13), 1275 .suites = cipher_suites_aws_crt_sdk_tls_13, 1276 }; 1277 1278 struct s2n_cipher_suite *cipher_suites_kms_tls_1_0_2018_10[] = { 1279 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1280 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1281 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1282 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1283 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1284 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1285 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1286 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1287 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1288 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1289 }; 1290 1291 const struct s2n_cipher_preferences cipher_preferences_kms_tls_1_0_2018_10 = { 1292 .count = s2n_array_len(cipher_suites_kms_tls_1_0_2018_10), 1293 .suites = cipher_suites_kms_tls_1_0_2018_10, 1294 }; 1295 1296 1297 struct s2n_cipher_suite *cipher_suites_kms_tls_1_0_2021_08[] = { 1298 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1299 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1300 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1301 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1302 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1303 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1304 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1305 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1306 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1307 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1308 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1309 }; 1310 1311 const struct s2n_cipher_preferences cipher_preferences_kms_tls_1_0_2021_08 = { 1312 .count = s2n_array_len(cipher_suites_kms_tls_1_0_2021_08), 1313 .suites = cipher_suites_kms_tls_1_0_2021_08, 1314 }; 1315 1316 struct s2n_cipher_suite *cipher_suites_kms_pq_tls_1_0_2019_06[] = { 1317 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1318 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1319 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1320 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1321 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1322 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1323 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1324 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1325 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1326 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1327 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1328 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1329 }; 1330 1331 /* Includes only round 1 PQ KEM params */ 1332 const struct s2n_cipher_preferences cipher_preferences_kms_pq_tls_1_0_2019_06 = { 1333 .count = s2n_array_len(cipher_suites_kms_pq_tls_1_0_2019_06), 1334 .suites = cipher_suites_kms_pq_tls_1_0_2019_06, 1335 }; 1336 1337 /* Includes round 1 and round 2 PQ KEM params. The cipher suite list is the same 1338 * as in cipher_preferences_kms_pq_tls_1_0_2019_06.*/ 1339 const struct s2n_cipher_preferences cipher_preferences_kms_pq_tls_1_0_2020_02 = { 1340 .count = s2n_array_len(cipher_suites_kms_pq_tls_1_0_2019_06), 1341 .suites = cipher_suites_kms_pq_tls_1_0_2019_06, 1342 }; 1343 1344 struct s2n_cipher_suite *cipher_suites_pq_sike_test_tls_1_0_2019_11[] = { 1345 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1346 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1347 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1348 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1349 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1350 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1351 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1352 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1353 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1354 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1355 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1356 }; 1357 1358 /* Includes only SIKE round 1 (for integration tests) */ 1359 const struct s2n_cipher_preferences cipher_preferences_pq_sike_test_tls_1_0_2019_11 = { 1360 .count = s2n_array_len(cipher_suites_pq_sike_test_tls_1_0_2019_11), 1361 .suites = cipher_suites_pq_sike_test_tls_1_0_2019_11, 1362 }; 1363 1364 /* Includes only SIKE round 1 and round 2 (for integration tests). The cipher suite list 1365 * is the same as in cipher_preferences_pq_sike_test_tls_1_0_2019_11. */ 1366 const struct s2n_cipher_preferences cipher_preferences_pq_sike_test_tls_1_0_2020_02 = { 1367 .count = s2n_array_len(cipher_suites_pq_sike_test_tls_1_0_2019_11), 1368 .suites = cipher_suites_pq_sike_test_tls_1_0_2019_11, 1369 }; 1370 1371 /* Includes Kyber, BIKE, and SIKE PQ Ciphers */ 1372 struct s2n_cipher_suite *cipher_suites_kms_pq_tls_1_0_2020_07[] = { 1373 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1374 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1375 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1376 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1377 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1378 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1379 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1380 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1381 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1382 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1383 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1384 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1385 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1386 }; 1387 1388 const struct s2n_cipher_preferences cipher_preferences_kms_pq_tls_1_0_2020_07 = { 1389 .count = s2n_array_len(cipher_suites_kms_pq_tls_1_0_2020_07), 1390 .suites = cipher_suites_kms_pq_tls_1_0_2020_07, 1391 }; 1392 1393 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2020_12[] = { 1394 S2N_TLS13_CIPHER_SUITES_20190801, 1395 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1396 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1397 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1398 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1399 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1400 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1401 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1402 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1403 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1404 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1405 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1406 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1407 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1408 }; 1409 1410 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2020_12 = { 1411 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2020_12), 1412 .suites = cipher_suites_pq_tls_1_0_2020_12, 1413 }; 1414 1415 /* Same as ELBSecurityPolicy-TLS-1-1-2017-01, but with PQ Ciphers appended to top of preference list */ 1416 struct s2n_cipher_suite *cipher_suites_pq_tls_1_1_2021_05_17[] = { 1417 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1418 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1419 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1420 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1421 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1422 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1423 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1424 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1425 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1426 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1427 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1428 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1429 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1430 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1431 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1432 &s2n_rsa_with_aes_128_gcm_sha256, 1433 &s2n_rsa_with_aes_128_cbc_sha256, 1434 &s2n_rsa_with_aes_128_cbc_sha, 1435 &s2n_rsa_with_aes_256_gcm_sha384, 1436 &s2n_rsa_with_aes_256_cbc_sha256, 1437 &s2n_rsa_with_aes_256_cbc_sha, 1438 }; 1439 1440 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_1_2021_05_17 = { 1441 .count = s2n_array_len(cipher_suites_pq_tls_1_1_2021_05_17), 1442 .suites = cipher_suites_pq_tls_1_1_2021_05_17, 1443 }; 1444 1445 /* Same as cipher_preferences_20190214, but with PQ Ciphers appended to top of preference list */ 1446 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_18[] = { 1447 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1448 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1449 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1450 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1451 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1452 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1453 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1454 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1455 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1456 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1457 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1458 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1459 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1460 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1461 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1462 &s2n_rsa_with_aes_128_cbc_sha, 1463 &s2n_rsa_with_aes_128_gcm_sha256, 1464 &s2n_rsa_with_aes_256_gcm_sha384, 1465 &s2n_rsa_with_aes_128_cbc_sha256, 1466 &s2n_rsa_with_aes_256_cbc_sha, 1467 &s2n_rsa_with_aes_256_cbc_sha256, 1468 &s2n_rsa_with_3des_ede_cbc_sha, 1469 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1470 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 1471 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 1472 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1473 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1474 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1475 }; 1476 1477 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_18 = { 1478 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_18), 1479 .suites = cipher_suites_pq_tls_1_0_2021_05_18, 1480 }; 1481 1482 /* Same as ELBSecurityPolicy-2016-08, but with PQ Ciphers appended to top of preference list */ 1483 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_19[] = { 1484 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1485 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1486 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1487 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1488 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1489 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1490 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1491 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1492 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1493 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1494 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1495 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1496 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1497 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1498 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1499 &s2n_rsa_with_aes_128_gcm_sha256, 1500 &s2n_rsa_with_aes_128_cbc_sha256, 1501 &s2n_rsa_with_aes_128_cbc_sha, 1502 &s2n_rsa_with_aes_256_gcm_sha384, 1503 &s2n_rsa_with_aes_256_cbc_sha256, 1504 &s2n_rsa_with_aes_256_cbc_sha, 1505 }; 1506 1507 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_19 = { 1508 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_19), 1509 .suites = cipher_suites_pq_tls_1_0_2021_05_19, 1510 }; 1511 1512 /* Same as ELBSecurityPolicy-TLS-1-1-2017-01, but with TLS 1.3 and PQ Ciphers appended to top of preference list */ 1513 struct s2n_cipher_suite *cipher_suites_pq_tls_1_1_2021_05_21[] = { 1514 /* TLS 1.3 Ciphers don't specify their Key exchange method, allowing for Hybrid PQ KEMs to be negotiated separately */ 1515 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1516 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1517 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1518 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1519 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1520 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1521 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1522 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1523 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1524 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1525 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1526 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1527 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1528 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1529 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1530 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1531 &s2n_rsa_with_aes_128_gcm_sha256, 1532 &s2n_rsa_with_aes_128_cbc_sha256, 1533 &s2n_rsa_with_aes_128_cbc_sha, 1534 &s2n_rsa_with_aes_256_gcm_sha384, 1535 &s2n_rsa_with_aes_256_cbc_sha256, 1536 &s2n_rsa_with_aes_256_cbc_sha, 1537 }; 1538 1539 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_1_2021_05_21 = { 1540 .count = s2n_array_len(cipher_suites_pq_tls_1_1_2021_05_21), 1541 .suites = cipher_suites_pq_tls_1_1_2021_05_21, 1542 }; 1543 1544 /* Same as cipher_preferences_20190214, but with TLS 1.3 and PQ Ciphers appended to top of preference list */ 1545 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_22[] = { 1546 /* TLS 1.3 Ciphers don't specify their Key exchange method, allowing for Hybrid PQ KEMs to be negotiated separately */ 1547 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1548 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1549 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1550 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1551 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1552 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1553 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1554 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1555 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1556 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1557 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1558 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1559 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1560 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1561 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1562 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1563 &s2n_rsa_with_aes_128_cbc_sha, 1564 &s2n_rsa_with_aes_128_gcm_sha256, 1565 &s2n_rsa_with_aes_256_gcm_sha384, 1566 &s2n_rsa_with_aes_128_cbc_sha256, 1567 &s2n_rsa_with_aes_256_cbc_sha, 1568 &s2n_rsa_with_aes_256_cbc_sha256, 1569 &s2n_rsa_with_3des_ede_cbc_sha, 1570 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1571 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 1572 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 1573 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1574 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1575 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1576 }; 1577 1578 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_22 = { 1579 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_22), 1580 .suites = cipher_suites_pq_tls_1_0_2021_05_22, 1581 }; 1582 1583 /* Same as ELBSecurityPolicy-2016-08, but with TLS 1.3 and PQ Ciphers appended to top of preference list */ 1584 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_23[] = { 1585 /* TLS 1.3 Ciphers don't specify their Key exchange method, allowing for Hybrid PQ KEMs to be negotiated separately */ 1586 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1587 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1588 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1589 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1590 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1591 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1592 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1593 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1594 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1595 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1596 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1597 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1598 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1599 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1600 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1601 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1602 &s2n_rsa_with_aes_128_gcm_sha256, 1603 &s2n_rsa_with_aes_128_cbc_sha256, 1604 &s2n_rsa_with_aes_128_cbc_sha, 1605 &s2n_rsa_with_aes_256_gcm_sha384, 1606 &s2n_rsa_with_aes_256_cbc_sha256, 1607 &s2n_rsa_with_aes_256_cbc_sha, 1608 }; 1609 1610 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_23 = { 1611 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_23), 1612 .suites = cipher_suites_pq_tls_1_0_2021_05_23, 1613 }; 1614 1615 /* Same as cipher_preferences_kms_pq_tls_1_0_2020_07, but with TLS 1.3 appended to top of preference list */ 1616 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_24[] = { 1617 /* TLS 1.3 Ciphers don't specify their Key exchange method, allowing for Hybrid PQ KEMs to be negotiated separately */ 1618 S2N_TLS13_CIPHER_SUITES_20190801, 1619 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1620 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1621 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1622 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1623 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1624 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1625 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1626 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1627 &s2n_ecdhe_rsa_with_3des_ede_cbc_sha, 1628 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1629 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1630 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1631 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1632 }; 1633 1634 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_24 = { 1635 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_24), 1636 .suites = cipher_suites_pq_tls_1_0_2021_05_24, 1637 }; 1638 1639 /* Same as 20190214_gcm, but with PQ Ciphers appended to top of preference list */ 1640 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_25[] = { 1641 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1642 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1643 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1644 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1645 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1646 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1647 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1648 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1649 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1650 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1651 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1652 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1653 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1654 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1655 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1656 &s2n_rsa_with_aes_128_gcm_sha256, 1657 &s2n_rsa_with_aes_256_gcm_sha384, 1658 &s2n_rsa_with_aes_128_cbc_sha, 1659 &s2n_rsa_with_aes_128_cbc_sha256, 1660 &s2n_rsa_with_aes_256_cbc_sha, 1661 &s2n_rsa_with_aes_256_cbc_sha256, 1662 &s2n_rsa_with_3des_ede_cbc_sha, 1663 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 1664 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 1665 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1666 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1667 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1668 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1669 }; 1670 1671 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_25 = { 1672 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_25), 1673 .suites = cipher_suites_pq_tls_1_0_2021_05_25, 1674 }; 1675 1676 /* Same as 20190214_gcm, but with TLS 1.3 and PQ Ciphers appended to top of preference list */ 1677 struct s2n_cipher_suite *cipher_suites_pq_tls_1_0_2021_05_26[] = { 1678 /* TLS 1.3 Ciphers don't specify their Key exchange method, allowing for Hybrid PQ KEMs to be negotiated separately */ 1679 S2N_TLS13_CLOUDFRONT_CIPHER_SUITES_20200716, 1680 &s2n_ecdhe_kyber_rsa_with_aes_256_gcm_sha384, 1681 &s2n_ecdhe_bike_rsa_with_aes_256_gcm_sha384, 1682 &s2n_ecdhe_sike_rsa_with_aes_256_gcm_sha384, 1683 &s2n_ecdhe_ecdsa_with_aes_128_gcm_sha256, 1684 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1685 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1686 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1687 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha, 1688 &s2n_ecdhe_rsa_with_aes_128_cbc_sha, 1689 &s2n_ecdhe_ecdsa_with_aes_128_cbc_sha256, 1690 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1691 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha, 1692 &s2n_ecdhe_rsa_with_aes_256_cbc_sha, 1693 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1694 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1695 &s2n_rsa_with_aes_128_gcm_sha256, 1696 &s2n_rsa_with_aes_256_gcm_sha384, 1697 &s2n_rsa_with_aes_128_cbc_sha, 1698 &s2n_rsa_with_aes_128_cbc_sha256, 1699 &s2n_rsa_with_aes_256_cbc_sha, 1700 &s2n_rsa_with_aes_256_cbc_sha256, 1701 &s2n_rsa_with_3des_ede_cbc_sha, 1702 &s2n_dhe_rsa_with_aes_128_gcm_sha256, 1703 &s2n_dhe_rsa_with_aes_256_gcm_sha384, 1704 &s2n_dhe_rsa_with_aes_128_cbc_sha, 1705 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1706 &s2n_dhe_rsa_with_aes_256_cbc_sha, 1707 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1708 }; 1709 1710 const struct s2n_cipher_preferences cipher_preferences_pq_tls_1_0_2021_05_26 = { 1711 .count = s2n_array_len(cipher_suites_pq_tls_1_0_2021_05_26), 1712 .suites = cipher_suites_pq_tls_1_0_2021_05_26, 1713 }; 1714 1715 struct s2n_cipher_suite *cipher_suites_kms_fips_tls_1_2_2018_10[] = { 1716 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1717 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1718 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1719 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1720 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1721 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1722 }; 1723 1724 const struct s2n_cipher_preferences cipher_preferences_kms_fips_tls_1_2_2018_10 = { 1725 .count = s2n_array_len(cipher_suites_kms_fips_tls_1_2_2018_10), 1726 .suites = cipher_suites_kms_fips_tls_1_2_2018_10, 1727 }; 1728 1729 struct s2n_cipher_suite *cipher_suites_kms_fips_tls_1_2_2021_08[] = { 1730 &s2n_tls13_aes_128_gcm_sha256, 1731 &s2n_tls13_aes_256_gcm_sha384, 1732 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1733 &s2n_ecdhe_rsa_with_aes_128_gcm_sha256, 1734 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1735 &s2n_ecdhe_rsa_with_aes_128_cbc_sha256, 1736 &s2n_dhe_rsa_with_aes_256_cbc_sha256, 1737 &s2n_dhe_rsa_with_aes_128_cbc_sha256, 1738 }; 1739 1740 const struct s2n_cipher_preferences cipher_preferences_kms_fips_tls_1_2_2021_08 = { 1741 .count = s2n_array_len(cipher_suites_kms_fips_tls_1_2_2021_08), 1742 .suites = cipher_suites_kms_fips_tls_1_2_2021_08, 1743 }; 1744 1745 struct s2n_cipher_suite *cipher_suites_20210816[] = { 1746 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1747 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1748 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1749 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1750 }; 1751 1752 const struct s2n_cipher_preferences cipher_preferences_20210816 = { 1753 .count = s2n_array_len(cipher_suites_20210816), 1754 .suites = cipher_suites_20210816, 1755 }; 1756 1757 struct s2n_cipher_suite *cipher_suites_20210816_gcm[] = { 1758 &s2n_ecdhe_ecdsa_with_aes_256_gcm_sha384, 1759 &s2n_ecdhe_rsa_with_aes_256_gcm_sha384, 1760 &s2n_ecdhe_ecdsa_with_aes_256_cbc_sha384, 1761 &s2n_ecdhe_rsa_with_aes_256_cbc_sha384, 1762 }; 1763 1764 const struct s2n_cipher_preferences cipher_preferences_20210816_gcm = { 1765 .count = s2n_array_len(cipher_suites_20210816_gcm), 1766 .suites = cipher_suites_20210816_gcm, 1767 }; 1768 1769 /* clang-format on */ 1770