s2n_cipher_preferences.c 76 KB

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