s3_lib.c 129 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978
  1. /*
  2. * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
  3. * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
  4. * Copyright 2005 Nokia. All rights reserved.
  5. *
  6. * Licensed under the Apache License 2.0 (the "License"). You may not use
  7. * this file except in compliance with the License. You can obtain a copy
  8. * in the file LICENSE in the source distribution or at
  9. * https://www.openssl.org/source/license.html
  10. */
  11. #include <stdio.h>
  12. #include <openssl/objects.h>
  13. #include "internal/nelem.h"
  14. #include "ssl_local.h"
  15. #include <openssl/md5.h>
  16. #include <openssl/dh.h>
  17. #include <openssl/rand.h>
  18. #include <openssl/trace.h>
  19. #include <openssl/x509v3.h>
  20. #include <openssl/core_names.h>
  21. #include "internal/cryptlib.h"
  22. #define TLS13_NUM_CIPHERS OSSL_NELEM(tls13_ciphers)
  23. #define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers)
  24. #define SSL3_NUM_SCSVS OSSL_NELEM(ssl3_scsvs)
  25. /* TLSv1.3 downgrade protection sentinel values */
  26. const unsigned char tls11downgrade[] = {
  27. 0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x00
  28. };
  29. const unsigned char tls12downgrade[] = {
  30. 0x44, 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01
  31. };
  32. /* The list of available TLSv1.3 ciphers */
  33. static SSL_CIPHER tls13_ciphers[] = {
  34. {
  35. 1,
  36. TLS1_3_RFC_AES_128_GCM_SHA256,
  37. TLS1_3_RFC_AES_128_GCM_SHA256,
  38. TLS1_3_CK_AES_128_GCM_SHA256,
  39. SSL_kANY,
  40. SSL_aANY,
  41. SSL_AES128GCM,
  42. SSL_AEAD,
  43. TLS1_3_VERSION, TLS1_3_VERSION,
  44. 0, 0,
  45. SSL_HIGH,
  46. SSL_HANDSHAKE_MAC_SHA256,
  47. 128,
  48. 128,
  49. }, {
  50. 1,
  51. TLS1_3_RFC_AES_256_GCM_SHA384,
  52. TLS1_3_RFC_AES_256_GCM_SHA384,
  53. TLS1_3_CK_AES_256_GCM_SHA384,
  54. SSL_kANY,
  55. SSL_aANY,
  56. SSL_AES256GCM,
  57. SSL_AEAD,
  58. TLS1_3_VERSION, TLS1_3_VERSION,
  59. 0, 0,
  60. SSL_HIGH,
  61. SSL_HANDSHAKE_MAC_SHA384,
  62. 256,
  63. 256,
  64. },
  65. {
  66. 1,
  67. TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
  68. TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
  69. TLS1_3_CK_CHACHA20_POLY1305_SHA256,
  70. SSL_kANY,
  71. SSL_aANY,
  72. SSL_CHACHA20POLY1305,
  73. SSL_AEAD,
  74. TLS1_3_VERSION, TLS1_3_VERSION,
  75. 0, 0,
  76. SSL_HIGH,
  77. SSL_HANDSHAKE_MAC_SHA256,
  78. 256,
  79. 256,
  80. },
  81. {
  82. 1,
  83. TLS1_3_RFC_AES_128_CCM_SHA256,
  84. TLS1_3_RFC_AES_128_CCM_SHA256,
  85. TLS1_3_CK_AES_128_CCM_SHA256,
  86. SSL_kANY,
  87. SSL_aANY,
  88. SSL_AES128CCM,
  89. SSL_AEAD,
  90. TLS1_3_VERSION, TLS1_3_VERSION,
  91. 0, 0,
  92. SSL_NOT_DEFAULT | SSL_HIGH,
  93. SSL_HANDSHAKE_MAC_SHA256,
  94. 128,
  95. 128,
  96. }, {
  97. 1,
  98. TLS1_3_RFC_AES_128_CCM_8_SHA256,
  99. TLS1_3_RFC_AES_128_CCM_8_SHA256,
  100. TLS1_3_CK_AES_128_CCM_8_SHA256,
  101. SSL_kANY,
  102. SSL_aANY,
  103. SSL_AES128CCM8,
  104. SSL_AEAD,
  105. TLS1_3_VERSION, TLS1_3_VERSION,
  106. 0, 0,
  107. SSL_NOT_DEFAULT | SSL_MEDIUM,
  108. SSL_HANDSHAKE_MAC_SHA256,
  109. 64, /* CCM8 uses a short tag, so we have a low security strength */
  110. 128,
  111. }
  112. };
  113. /*
  114. * The list of available ciphers, mostly organized into the following
  115. * groups:
  116. * Always there
  117. * EC
  118. * PSK
  119. * SRP (within that: RSA EC PSK)
  120. * Cipher families: Chacha/poly, Camellia, Gost, IDEA, SEED
  121. * Weak ciphers
  122. */
  123. static SSL_CIPHER ssl3_ciphers[] = {
  124. {
  125. 1,
  126. SSL3_TXT_RSA_NULL_MD5,
  127. SSL3_RFC_RSA_NULL_MD5,
  128. SSL3_CK_RSA_NULL_MD5,
  129. SSL_kRSA,
  130. SSL_aRSA,
  131. SSL_eNULL,
  132. SSL_MD5,
  133. SSL3_VERSION, TLS1_2_VERSION,
  134. DTLS1_BAD_VER, DTLS1_2_VERSION,
  135. SSL_STRONG_NONE,
  136. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  137. 0,
  138. 0,
  139. },
  140. {
  141. 1,
  142. SSL3_TXT_RSA_NULL_SHA,
  143. SSL3_RFC_RSA_NULL_SHA,
  144. SSL3_CK_RSA_NULL_SHA,
  145. SSL_kRSA,
  146. SSL_aRSA,
  147. SSL_eNULL,
  148. SSL_SHA1,
  149. SSL3_VERSION, TLS1_2_VERSION,
  150. DTLS1_BAD_VER, DTLS1_2_VERSION,
  151. SSL_STRONG_NONE | SSL_FIPS,
  152. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  153. 0,
  154. 0,
  155. },
  156. #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  157. {
  158. 1,
  159. SSL3_TXT_RSA_DES_192_CBC3_SHA,
  160. SSL3_RFC_RSA_DES_192_CBC3_SHA,
  161. SSL3_CK_RSA_DES_192_CBC3_SHA,
  162. SSL_kRSA,
  163. SSL_aRSA,
  164. SSL_3DES,
  165. SSL_SHA1,
  166. SSL3_VERSION, TLS1_2_VERSION,
  167. DTLS1_BAD_VER, DTLS1_2_VERSION,
  168. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  169. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  170. 112,
  171. 168,
  172. },
  173. {
  174. 1,
  175. SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA,
  176. SSL3_RFC_DHE_DSS_DES_192_CBC3_SHA,
  177. SSL3_CK_DHE_DSS_DES_192_CBC3_SHA,
  178. SSL_kDHE,
  179. SSL_aDSS,
  180. SSL_3DES,
  181. SSL_SHA1,
  182. SSL3_VERSION, TLS1_2_VERSION,
  183. DTLS1_BAD_VER, DTLS1_2_VERSION,
  184. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  185. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  186. 112,
  187. 168,
  188. },
  189. {
  190. 1,
  191. SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA,
  192. SSL3_RFC_DHE_RSA_DES_192_CBC3_SHA,
  193. SSL3_CK_DHE_RSA_DES_192_CBC3_SHA,
  194. SSL_kDHE,
  195. SSL_aRSA,
  196. SSL_3DES,
  197. SSL_SHA1,
  198. SSL3_VERSION, TLS1_2_VERSION,
  199. DTLS1_BAD_VER, DTLS1_2_VERSION,
  200. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  201. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  202. 112,
  203. 168,
  204. },
  205. {
  206. 1,
  207. SSL3_TXT_ADH_DES_192_CBC_SHA,
  208. SSL3_RFC_ADH_DES_192_CBC_SHA,
  209. SSL3_CK_ADH_DES_192_CBC_SHA,
  210. SSL_kDHE,
  211. SSL_aNULL,
  212. SSL_3DES,
  213. SSL_SHA1,
  214. SSL3_VERSION, TLS1_2_VERSION,
  215. DTLS1_BAD_VER, DTLS1_2_VERSION,
  216. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  217. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  218. 112,
  219. 168,
  220. },
  221. #endif
  222. {
  223. 1,
  224. TLS1_TXT_RSA_WITH_AES_128_SHA,
  225. TLS1_RFC_RSA_WITH_AES_128_SHA,
  226. TLS1_CK_RSA_WITH_AES_128_SHA,
  227. SSL_kRSA,
  228. SSL_aRSA,
  229. SSL_AES128,
  230. SSL_SHA1,
  231. SSL3_VERSION, TLS1_2_VERSION,
  232. DTLS1_BAD_VER, DTLS1_2_VERSION,
  233. SSL_HIGH | SSL_FIPS,
  234. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  235. 128,
  236. 128,
  237. },
  238. {
  239. 1,
  240. TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
  241. TLS1_RFC_DHE_DSS_WITH_AES_128_SHA,
  242. TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
  243. SSL_kDHE,
  244. SSL_aDSS,
  245. SSL_AES128,
  246. SSL_SHA1,
  247. SSL3_VERSION, TLS1_2_VERSION,
  248. DTLS1_BAD_VER, DTLS1_2_VERSION,
  249. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  250. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  251. 128,
  252. 128,
  253. },
  254. {
  255. 1,
  256. TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
  257. TLS1_RFC_DHE_RSA_WITH_AES_128_SHA,
  258. TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
  259. SSL_kDHE,
  260. SSL_aRSA,
  261. SSL_AES128,
  262. SSL_SHA1,
  263. SSL3_VERSION, TLS1_2_VERSION,
  264. DTLS1_BAD_VER, DTLS1_2_VERSION,
  265. SSL_HIGH | SSL_FIPS,
  266. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  267. 128,
  268. 128,
  269. },
  270. {
  271. 1,
  272. TLS1_TXT_ADH_WITH_AES_128_SHA,
  273. TLS1_RFC_ADH_WITH_AES_128_SHA,
  274. TLS1_CK_ADH_WITH_AES_128_SHA,
  275. SSL_kDHE,
  276. SSL_aNULL,
  277. SSL_AES128,
  278. SSL_SHA1,
  279. SSL3_VERSION, TLS1_2_VERSION,
  280. DTLS1_BAD_VER, DTLS1_2_VERSION,
  281. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  282. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  283. 128,
  284. 128,
  285. },
  286. {
  287. 1,
  288. TLS1_TXT_RSA_WITH_AES_256_SHA,
  289. TLS1_RFC_RSA_WITH_AES_256_SHA,
  290. TLS1_CK_RSA_WITH_AES_256_SHA,
  291. SSL_kRSA,
  292. SSL_aRSA,
  293. SSL_AES256,
  294. SSL_SHA1,
  295. SSL3_VERSION, TLS1_2_VERSION,
  296. DTLS1_BAD_VER, DTLS1_2_VERSION,
  297. SSL_HIGH | SSL_FIPS,
  298. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  299. 256,
  300. 256,
  301. },
  302. {
  303. 1,
  304. TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
  305. TLS1_RFC_DHE_DSS_WITH_AES_256_SHA,
  306. TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
  307. SSL_kDHE,
  308. SSL_aDSS,
  309. SSL_AES256,
  310. SSL_SHA1,
  311. SSL3_VERSION, TLS1_2_VERSION,
  312. DTLS1_BAD_VER, DTLS1_2_VERSION,
  313. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  314. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  315. 256,
  316. 256,
  317. },
  318. {
  319. 1,
  320. TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
  321. TLS1_RFC_DHE_RSA_WITH_AES_256_SHA,
  322. TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
  323. SSL_kDHE,
  324. SSL_aRSA,
  325. SSL_AES256,
  326. SSL_SHA1,
  327. SSL3_VERSION, TLS1_2_VERSION,
  328. DTLS1_BAD_VER, DTLS1_2_VERSION,
  329. SSL_HIGH | SSL_FIPS,
  330. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  331. 256,
  332. 256,
  333. },
  334. {
  335. 1,
  336. TLS1_TXT_ADH_WITH_AES_256_SHA,
  337. TLS1_RFC_ADH_WITH_AES_256_SHA,
  338. TLS1_CK_ADH_WITH_AES_256_SHA,
  339. SSL_kDHE,
  340. SSL_aNULL,
  341. SSL_AES256,
  342. SSL_SHA1,
  343. SSL3_VERSION, TLS1_2_VERSION,
  344. DTLS1_BAD_VER, DTLS1_2_VERSION,
  345. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  346. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  347. 256,
  348. 256,
  349. },
  350. {
  351. 1,
  352. TLS1_TXT_RSA_WITH_NULL_SHA256,
  353. TLS1_RFC_RSA_WITH_NULL_SHA256,
  354. TLS1_CK_RSA_WITH_NULL_SHA256,
  355. SSL_kRSA,
  356. SSL_aRSA,
  357. SSL_eNULL,
  358. SSL_SHA256,
  359. TLS1_2_VERSION, TLS1_2_VERSION,
  360. DTLS1_2_VERSION, DTLS1_2_VERSION,
  361. SSL_STRONG_NONE | SSL_FIPS,
  362. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  363. 0,
  364. 0,
  365. },
  366. {
  367. 1,
  368. TLS1_TXT_RSA_WITH_AES_128_SHA256,
  369. TLS1_RFC_RSA_WITH_AES_128_SHA256,
  370. TLS1_CK_RSA_WITH_AES_128_SHA256,
  371. SSL_kRSA,
  372. SSL_aRSA,
  373. SSL_AES128,
  374. SSL_SHA256,
  375. TLS1_2_VERSION, TLS1_2_VERSION,
  376. DTLS1_2_VERSION, DTLS1_2_VERSION,
  377. SSL_HIGH | SSL_FIPS,
  378. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  379. 128,
  380. 128,
  381. },
  382. {
  383. 1,
  384. TLS1_TXT_RSA_WITH_AES_256_SHA256,
  385. TLS1_RFC_RSA_WITH_AES_256_SHA256,
  386. TLS1_CK_RSA_WITH_AES_256_SHA256,
  387. SSL_kRSA,
  388. SSL_aRSA,
  389. SSL_AES256,
  390. SSL_SHA256,
  391. TLS1_2_VERSION, TLS1_2_VERSION,
  392. DTLS1_2_VERSION, DTLS1_2_VERSION,
  393. SSL_HIGH | SSL_FIPS,
  394. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  395. 256,
  396. 256,
  397. },
  398. {
  399. 1,
  400. TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
  401. TLS1_RFC_DHE_DSS_WITH_AES_128_SHA256,
  402. TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
  403. SSL_kDHE,
  404. SSL_aDSS,
  405. SSL_AES128,
  406. SSL_SHA256,
  407. TLS1_2_VERSION, TLS1_2_VERSION,
  408. DTLS1_2_VERSION, DTLS1_2_VERSION,
  409. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  410. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  411. 128,
  412. 128,
  413. },
  414. {
  415. 1,
  416. TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
  417. TLS1_RFC_DHE_RSA_WITH_AES_128_SHA256,
  418. TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
  419. SSL_kDHE,
  420. SSL_aRSA,
  421. SSL_AES128,
  422. SSL_SHA256,
  423. TLS1_2_VERSION, TLS1_2_VERSION,
  424. DTLS1_2_VERSION, DTLS1_2_VERSION,
  425. SSL_HIGH | SSL_FIPS,
  426. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  427. 128,
  428. 128,
  429. },
  430. {
  431. 1,
  432. TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
  433. TLS1_RFC_DHE_DSS_WITH_AES_256_SHA256,
  434. TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
  435. SSL_kDHE,
  436. SSL_aDSS,
  437. SSL_AES256,
  438. SSL_SHA256,
  439. TLS1_2_VERSION, TLS1_2_VERSION,
  440. DTLS1_2_VERSION, DTLS1_2_VERSION,
  441. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  442. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  443. 256,
  444. 256,
  445. },
  446. {
  447. 1,
  448. TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
  449. TLS1_RFC_DHE_RSA_WITH_AES_256_SHA256,
  450. TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
  451. SSL_kDHE,
  452. SSL_aRSA,
  453. SSL_AES256,
  454. SSL_SHA256,
  455. TLS1_2_VERSION, TLS1_2_VERSION,
  456. DTLS1_2_VERSION, DTLS1_2_VERSION,
  457. SSL_HIGH | SSL_FIPS,
  458. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  459. 256,
  460. 256,
  461. },
  462. {
  463. 1,
  464. TLS1_TXT_ADH_WITH_AES_128_SHA256,
  465. TLS1_RFC_ADH_WITH_AES_128_SHA256,
  466. TLS1_CK_ADH_WITH_AES_128_SHA256,
  467. SSL_kDHE,
  468. SSL_aNULL,
  469. SSL_AES128,
  470. SSL_SHA256,
  471. TLS1_2_VERSION, TLS1_2_VERSION,
  472. DTLS1_2_VERSION, DTLS1_2_VERSION,
  473. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  474. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  475. 128,
  476. 128,
  477. },
  478. {
  479. 1,
  480. TLS1_TXT_ADH_WITH_AES_256_SHA256,
  481. TLS1_RFC_ADH_WITH_AES_256_SHA256,
  482. TLS1_CK_ADH_WITH_AES_256_SHA256,
  483. SSL_kDHE,
  484. SSL_aNULL,
  485. SSL_AES256,
  486. SSL_SHA256,
  487. TLS1_2_VERSION, TLS1_2_VERSION,
  488. DTLS1_2_VERSION, DTLS1_2_VERSION,
  489. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  490. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  491. 256,
  492. 256,
  493. },
  494. {
  495. 1,
  496. TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
  497. TLS1_RFC_RSA_WITH_AES_128_GCM_SHA256,
  498. TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
  499. SSL_kRSA,
  500. SSL_aRSA,
  501. SSL_AES128GCM,
  502. SSL_AEAD,
  503. TLS1_2_VERSION, TLS1_2_VERSION,
  504. DTLS1_2_VERSION, DTLS1_2_VERSION,
  505. SSL_HIGH | SSL_FIPS,
  506. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  507. 128,
  508. 128,
  509. },
  510. {
  511. 1,
  512. TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
  513. TLS1_RFC_RSA_WITH_AES_256_GCM_SHA384,
  514. TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
  515. SSL_kRSA,
  516. SSL_aRSA,
  517. SSL_AES256GCM,
  518. SSL_AEAD,
  519. TLS1_2_VERSION, TLS1_2_VERSION,
  520. DTLS1_2_VERSION, DTLS1_2_VERSION,
  521. SSL_HIGH | SSL_FIPS,
  522. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  523. 256,
  524. 256,
  525. },
  526. {
  527. 1,
  528. TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
  529. TLS1_RFC_DHE_RSA_WITH_AES_128_GCM_SHA256,
  530. TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
  531. SSL_kDHE,
  532. SSL_aRSA,
  533. SSL_AES128GCM,
  534. SSL_AEAD,
  535. TLS1_2_VERSION, TLS1_2_VERSION,
  536. DTLS1_2_VERSION, DTLS1_2_VERSION,
  537. SSL_HIGH | SSL_FIPS,
  538. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  539. 128,
  540. 128,
  541. },
  542. {
  543. 1,
  544. TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
  545. TLS1_RFC_DHE_RSA_WITH_AES_256_GCM_SHA384,
  546. TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
  547. SSL_kDHE,
  548. SSL_aRSA,
  549. SSL_AES256GCM,
  550. SSL_AEAD,
  551. TLS1_2_VERSION, TLS1_2_VERSION,
  552. DTLS1_2_VERSION, DTLS1_2_VERSION,
  553. SSL_HIGH | SSL_FIPS,
  554. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  555. 256,
  556. 256,
  557. },
  558. {
  559. 1,
  560. TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
  561. TLS1_RFC_DHE_DSS_WITH_AES_128_GCM_SHA256,
  562. TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
  563. SSL_kDHE,
  564. SSL_aDSS,
  565. SSL_AES128GCM,
  566. SSL_AEAD,
  567. TLS1_2_VERSION, TLS1_2_VERSION,
  568. DTLS1_2_VERSION, DTLS1_2_VERSION,
  569. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  570. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  571. 128,
  572. 128,
  573. },
  574. {
  575. 1,
  576. TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
  577. TLS1_RFC_DHE_DSS_WITH_AES_256_GCM_SHA384,
  578. TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
  579. SSL_kDHE,
  580. SSL_aDSS,
  581. SSL_AES256GCM,
  582. SSL_AEAD,
  583. TLS1_2_VERSION, TLS1_2_VERSION,
  584. DTLS1_2_VERSION, DTLS1_2_VERSION,
  585. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  586. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  587. 256,
  588. 256,
  589. },
  590. {
  591. 1,
  592. TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
  593. TLS1_RFC_ADH_WITH_AES_128_GCM_SHA256,
  594. TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
  595. SSL_kDHE,
  596. SSL_aNULL,
  597. SSL_AES128GCM,
  598. SSL_AEAD,
  599. TLS1_2_VERSION, TLS1_2_VERSION,
  600. DTLS1_2_VERSION, DTLS1_2_VERSION,
  601. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  602. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  603. 128,
  604. 128,
  605. },
  606. {
  607. 1,
  608. TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
  609. TLS1_RFC_ADH_WITH_AES_256_GCM_SHA384,
  610. TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
  611. SSL_kDHE,
  612. SSL_aNULL,
  613. SSL_AES256GCM,
  614. SSL_AEAD,
  615. TLS1_2_VERSION, TLS1_2_VERSION,
  616. DTLS1_2_VERSION, DTLS1_2_VERSION,
  617. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  618. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  619. 256,
  620. 256,
  621. },
  622. {
  623. 1,
  624. TLS1_TXT_RSA_WITH_AES_128_CCM,
  625. TLS1_RFC_RSA_WITH_AES_128_CCM,
  626. TLS1_CK_RSA_WITH_AES_128_CCM,
  627. SSL_kRSA,
  628. SSL_aRSA,
  629. SSL_AES128CCM,
  630. SSL_AEAD,
  631. TLS1_2_VERSION, TLS1_2_VERSION,
  632. DTLS1_2_VERSION, DTLS1_2_VERSION,
  633. SSL_NOT_DEFAULT | SSL_HIGH,
  634. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  635. 128,
  636. 128,
  637. },
  638. {
  639. 1,
  640. TLS1_TXT_RSA_WITH_AES_256_CCM,
  641. TLS1_RFC_RSA_WITH_AES_256_CCM,
  642. TLS1_CK_RSA_WITH_AES_256_CCM,
  643. SSL_kRSA,
  644. SSL_aRSA,
  645. SSL_AES256CCM,
  646. SSL_AEAD,
  647. TLS1_2_VERSION, TLS1_2_VERSION,
  648. DTLS1_2_VERSION, DTLS1_2_VERSION,
  649. SSL_NOT_DEFAULT | SSL_HIGH,
  650. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  651. 256,
  652. 256,
  653. },
  654. {
  655. 1,
  656. TLS1_TXT_DHE_RSA_WITH_AES_128_CCM,
  657. TLS1_RFC_DHE_RSA_WITH_AES_128_CCM,
  658. TLS1_CK_DHE_RSA_WITH_AES_128_CCM,
  659. SSL_kDHE,
  660. SSL_aRSA,
  661. SSL_AES128CCM,
  662. SSL_AEAD,
  663. TLS1_2_VERSION, TLS1_2_VERSION,
  664. DTLS1_2_VERSION, DTLS1_2_VERSION,
  665. SSL_NOT_DEFAULT | SSL_HIGH,
  666. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  667. 128,
  668. 128,
  669. },
  670. {
  671. 1,
  672. TLS1_TXT_DHE_RSA_WITH_AES_256_CCM,
  673. TLS1_RFC_DHE_RSA_WITH_AES_256_CCM,
  674. TLS1_CK_DHE_RSA_WITH_AES_256_CCM,
  675. SSL_kDHE,
  676. SSL_aRSA,
  677. SSL_AES256CCM,
  678. SSL_AEAD,
  679. TLS1_2_VERSION, TLS1_2_VERSION,
  680. DTLS1_2_VERSION, DTLS1_2_VERSION,
  681. SSL_NOT_DEFAULT | SSL_HIGH,
  682. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  683. 256,
  684. 256,
  685. },
  686. {
  687. 1,
  688. TLS1_TXT_RSA_WITH_AES_128_CCM_8,
  689. TLS1_RFC_RSA_WITH_AES_128_CCM_8,
  690. TLS1_CK_RSA_WITH_AES_128_CCM_8,
  691. SSL_kRSA,
  692. SSL_aRSA,
  693. SSL_AES128CCM8,
  694. SSL_AEAD,
  695. TLS1_2_VERSION, TLS1_2_VERSION,
  696. DTLS1_2_VERSION, DTLS1_2_VERSION,
  697. SSL_NOT_DEFAULT | SSL_MEDIUM,
  698. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  699. 64, /* CCM8 uses a short tag, so we have a low security strength */
  700. 128,
  701. },
  702. {
  703. 1,
  704. TLS1_TXT_RSA_WITH_AES_256_CCM_8,
  705. TLS1_RFC_RSA_WITH_AES_256_CCM_8,
  706. TLS1_CK_RSA_WITH_AES_256_CCM_8,
  707. SSL_kRSA,
  708. SSL_aRSA,
  709. SSL_AES256CCM8,
  710. SSL_AEAD,
  711. TLS1_2_VERSION, TLS1_2_VERSION,
  712. DTLS1_2_VERSION, DTLS1_2_VERSION,
  713. SSL_NOT_DEFAULT | SSL_MEDIUM,
  714. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  715. 64, /* CCM8 uses a short tag, so we have a low security strength */
  716. 256,
  717. },
  718. {
  719. 1,
  720. TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8,
  721. TLS1_RFC_DHE_RSA_WITH_AES_128_CCM_8,
  722. TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8,
  723. SSL_kDHE,
  724. SSL_aRSA,
  725. SSL_AES128CCM8,
  726. SSL_AEAD,
  727. TLS1_2_VERSION, TLS1_2_VERSION,
  728. DTLS1_2_VERSION, DTLS1_2_VERSION,
  729. SSL_NOT_DEFAULT | SSL_MEDIUM,
  730. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  731. 64, /* CCM8 uses a short tag, so we have a low security strength */
  732. 128,
  733. },
  734. {
  735. 1,
  736. TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8,
  737. TLS1_RFC_DHE_RSA_WITH_AES_256_CCM_8,
  738. TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8,
  739. SSL_kDHE,
  740. SSL_aRSA,
  741. SSL_AES256CCM8,
  742. SSL_AEAD,
  743. TLS1_2_VERSION, TLS1_2_VERSION,
  744. DTLS1_2_VERSION, DTLS1_2_VERSION,
  745. SSL_NOT_DEFAULT | SSL_MEDIUM,
  746. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  747. 64, /* CCM8 uses a short tag, so we have a low security strength */
  748. 256,
  749. },
  750. {
  751. 1,
  752. TLS1_TXT_PSK_WITH_AES_128_CCM,
  753. TLS1_RFC_PSK_WITH_AES_128_CCM,
  754. TLS1_CK_PSK_WITH_AES_128_CCM,
  755. SSL_kPSK,
  756. SSL_aPSK,
  757. SSL_AES128CCM,
  758. SSL_AEAD,
  759. TLS1_2_VERSION, TLS1_2_VERSION,
  760. DTLS1_2_VERSION, DTLS1_2_VERSION,
  761. SSL_NOT_DEFAULT | SSL_HIGH,
  762. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  763. 128,
  764. 128,
  765. },
  766. {
  767. 1,
  768. TLS1_TXT_PSK_WITH_AES_256_CCM,
  769. TLS1_RFC_PSK_WITH_AES_256_CCM,
  770. TLS1_CK_PSK_WITH_AES_256_CCM,
  771. SSL_kPSK,
  772. SSL_aPSK,
  773. SSL_AES256CCM,
  774. SSL_AEAD,
  775. TLS1_2_VERSION, TLS1_2_VERSION,
  776. DTLS1_2_VERSION, DTLS1_2_VERSION,
  777. SSL_NOT_DEFAULT | SSL_HIGH,
  778. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  779. 256,
  780. 256,
  781. },
  782. {
  783. 1,
  784. TLS1_TXT_DHE_PSK_WITH_AES_128_CCM,
  785. TLS1_RFC_DHE_PSK_WITH_AES_128_CCM,
  786. TLS1_CK_DHE_PSK_WITH_AES_128_CCM,
  787. SSL_kDHEPSK,
  788. SSL_aPSK,
  789. SSL_AES128CCM,
  790. SSL_AEAD,
  791. TLS1_2_VERSION, TLS1_2_VERSION,
  792. DTLS1_2_VERSION, DTLS1_2_VERSION,
  793. SSL_NOT_DEFAULT | SSL_HIGH,
  794. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  795. 128,
  796. 128,
  797. },
  798. {
  799. 1,
  800. TLS1_TXT_DHE_PSK_WITH_AES_256_CCM,
  801. TLS1_RFC_DHE_PSK_WITH_AES_256_CCM,
  802. TLS1_CK_DHE_PSK_WITH_AES_256_CCM,
  803. SSL_kDHEPSK,
  804. SSL_aPSK,
  805. SSL_AES256CCM,
  806. SSL_AEAD,
  807. TLS1_2_VERSION, TLS1_2_VERSION,
  808. DTLS1_2_VERSION, DTLS1_2_VERSION,
  809. SSL_NOT_DEFAULT | SSL_HIGH,
  810. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  811. 256,
  812. 256,
  813. },
  814. {
  815. 1,
  816. TLS1_TXT_PSK_WITH_AES_128_CCM_8,
  817. TLS1_RFC_PSK_WITH_AES_128_CCM_8,
  818. TLS1_CK_PSK_WITH_AES_128_CCM_8,
  819. SSL_kPSK,
  820. SSL_aPSK,
  821. SSL_AES128CCM8,
  822. SSL_AEAD,
  823. TLS1_2_VERSION, TLS1_2_VERSION,
  824. DTLS1_2_VERSION, DTLS1_2_VERSION,
  825. SSL_NOT_DEFAULT | SSL_MEDIUM,
  826. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  827. 64, /* CCM8 uses a short tag, so we have a low security strength */
  828. 128,
  829. },
  830. {
  831. 1,
  832. TLS1_TXT_PSK_WITH_AES_256_CCM_8,
  833. TLS1_RFC_PSK_WITH_AES_256_CCM_8,
  834. TLS1_CK_PSK_WITH_AES_256_CCM_8,
  835. SSL_kPSK,
  836. SSL_aPSK,
  837. SSL_AES256CCM8,
  838. SSL_AEAD,
  839. TLS1_2_VERSION, TLS1_2_VERSION,
  840. DTLS1_2_VERSION, DTLS1_2_VERSION,
  841. SSL_NOT_DEFAULT | SSL_MEDIUM,
  842. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  843. 64, /* CCM8 uses a short tag, so we have a low security strength */
  844. 256,
  845. },
  846. {
  847. 1,
  848. TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8,
  849. TLS1_RFC_DHE_PSK_WITH_AES_128_CCM_8,
  850. TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8,
  851. SSL_kDHEPSK,
  852. SSL_aPSK,
  853. SSL_AES128CCM8,
  854. SSL_AEAD,
  855. TLS1_2_VERSION, TLS1_2_VERSION,
  856. DTLS1_2_VERSION, DTLS1_2_VERSION,
  857. SSL_NOT_DEFAULT | SSL_MEDIUM,
  858. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  859. 64, /* CCM8 uses a short tag, so we have a low security strength */
  860. 128,
  861. },
  862. {
  863. 1,
  864. TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8,
  865. TLS1_RFC_DHE_PSK_WITH_AES_256_CCM_8,
  866. TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8,
  867. SSL_kDHEPSK,
  868. SSL_aPSK,
  869. SSL_AES256CCM8,
  870. SSL_AEAD,
  871. TLS1_2_VERSION, TLS1_2_VERSION,
  872. DTLS1_2_VERSION, DTLS1_2_VERSION,
  873. SSL_NOT_DEFAULT | SSL_MEDIUM,
  874. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  875. 64, /* CCM8 uses a short tag, so we have a low security strength */
  876. 256,
  877. },
  878. {
  879. 1,
  880. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM,
  881. TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM,
  882. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM,
  883. SSL_kECDHE,
  884. SSL_aECDSA,
  885. SSL_AES128CCM,
  886. SSL_AEAD,
  887. TLS1_2_VERSION, TLS1_2_VERSION,
  888. DTLS1_2_VERSION, DTLS1_2_VERSION,
  889. SSL_NOT_DEFAULT | SSL_HIGH,
  890. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  891. 128,
  892. 128,
  893. },
  894. {
  895. 1,
  896. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM,
  897. TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM,
  898. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM,
  899. SSL_kECDHE,
  900. SSL_aECDSA,
  901. SSL_AES256CCM,
  902. SSL_AEAD,
  903. TLS1_2_VERSION, TLS1_2_VERSION,
  904. DTLS1_2_VERSION, DTLS1_2_VERSION,
  905. SSL_NOT_DEFAULT | SSL_HIGH,
  906. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  907. 256,
  908. 256,
  909. },
  910. {
  911. 1,
  912. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8,
  913. TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CCM_8,
  914. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8,
  915. SSL_kECDHE,
  916. SSL_aECDSA,
  917. SSL_AES128CCM8,
  918. SSL_AEAD,
  919. TLS1_2_VERSION, TLS1_2_VERSION,
  920. DTLS1_2_VERSION, DTLS1_2_VERSION,
  921. SSL_NOT_DEFAULT | SSL_MEDIUM,
  922. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  923. 64, /* CCM8 uses a short tag, so we have a low security strength */
  924. 128,
  925. },
  926. {
  927. 1,
  928. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8,
  929. TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CCM_8,
  930. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8,
  931. SSL_kECDHE,
  932. SSL_aECDSA,
  933. SSL_AES256CCM8,
  934. SSL_AEAD,
  935. TLS1_2_VERSION, TLS1_2_VERSION,
  936. DTLS1_2_VERSION, DTLS1_2_VERSION,
  937. SSL_NOT_DEFAULT | SSL_MEDIUM,
  938. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  939. 64, /* CCM8 uses a short tag, so we have a low security strength */
  940. 256,
  941. },
  942. {
  943. 1,
  944. TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
  945. TLS1_RFC_ECDHE_ECDSA_WITH_NULL_SHA,
  946. TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
  947. SSL_kECDHE,
  948. SSL_aECDSA,
  949. SSL_eNULL,
  950. SSL_SHA1,
  951. TLS1_VERSION, TLS1_2_VERSION,
  952. DTLS1_BAD_VER, DTLS1_2_VERSION,
  953. SSL_STRONG_NONE | SSL_FIPS,
  954. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  955. 0,
  956. 0,
  957. },
  958. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  959. {
  960. 1,
  961. TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
  962. TLS1_RFC_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
  963. TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
  964. SSL_kECDHE,
  965. SSL_aECDSA,
  966. SSL_3DES,
  967. SSL_SHA1,
  968. TLS1_VERSION, TLS1_2_VERSION,
  969. DTLS1_BAD_VER, DTLS1_2_VERSION,
  970. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  971. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  972. 112,
  973. 168,
  974. },
  975. # endif
  976. {
  977. 1,
  978. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  979. TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  980. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  981. SSL_kECDHE,
  982. SSL_aECDSA,
  983. SSL_AES128,
  984. SSL_SHA1,
  985. TLS1_VERSION, TLS1_2_VERSION,
  986. DTLS1_BAD_VER, DTLS1_2_VERSION,
  987. SSL_HIGH | SSL_FIPS,
  988. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  989. 128,
  990. 128,
  991. },
  992. {
  993. 1,
  994. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  995. TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  996. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  997. SSL_kECDHE,
  998. SSL_aECDSA,
  999. SSL_AES256,
  1000. SSL_SHA1,
  1001. TLS1_VERSION, TLS1_2_VERSION,
  1002. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1003. SSL_HIGH | SSL_FIPS,
  1004. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1005. 256,
  1006. 256,
  1007. },
  1008. {
  1009. 1,
  1010. TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
  1011. TLS1_RFC_ECDHE_RSA_WITH_NULL_SHA,
  1012. TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
  1013. SSL_kECDHE,
  1014. SSL_aRSA,
  1015. SSL_eNULL,
  1016. SSL_SHA1,
  1017. TLS1_VERSION, TLS1_2_VERSION,
  1018. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1019. SSL_STRONG_NONE | SSL_FIPS,
  1020. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1021. 0,
  1022. 0,
  1023. },
  1024. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1025. {
  1026. 1,
  1027. TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
  1028. TLS1_RFC_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
  1029. TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
  1030. SSL_kECDHE,
  1031. SSL_aRSA,
  1032. SSL_3DES,
  1033. SSL_SHA1,
  1034. TLS1_VERSION, TLS1_2_VERSION,
  1035. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1036. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1037. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1038. 112,
  1039. 168,
  1040. },
  1041. # endif
  1042. {
  1043. 1,
  1044. TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  1045. TLS1_RFC_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  1046. TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  1047. SSL_kECDHE,
  1048. SSL_aRSA,
  1049. SSL_AES128,
  1050. SSL_SHA1,
  1051. TLS1_VERSION, TLS1_2_VERSION,
  1052. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1053. SSL_HIGH | SSL_FIPS,
  1054. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1055. 128,
  1056. 128,
  1057. },
  1058. {
  1059. 1,
  1060. TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  1061. TLS1_RFC_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  1062. TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  1063. SSL_kECDHE,
  1064. SSL_aRSA,
  1065. SSL_AES256,
  1066. SSL_SHA1,
  1067. TLS1_VERSION, TLS1_2_VERSION,
  1068. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1069. SSL_HIGH | SSL_FIPS,
  1070. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1071. 256,
  1072. 256,
  1073. },
  1074. {
  1075. 1,
  1076. TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
  1077. TLS1_RFC_ECDH_anon_WITH_NULL_SHA,
  1078. TLS1_CK_ECDH_anon_WITH_NULL_SHA,
  1079. SSL_kECDHE,
  1080. SSL_aNULL,
  1081. SSL_eNULL,
  1082. SSL_SHA1,
  1083. TLS1_VERSION, TLS1_2_VERSION,
  1084. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1085. SSL_STRONG_NONE | SSL_FIPS,
  1086. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1087. 0,
  1088. 0,
  1089. },
  1090. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1091. {
  1092. 1,
  1093. TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
  1094. TLS1_RFC_ECDH_anon_WITH_DES_192_CBC3_SHA,
  1095. TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
  1096. SSL_kECDHE,
  1097. SSL_aNULL,
  1098. SSL_3DES,
  1099. SSL_SHA1,
  1100. TLS1_VERSION, TLS1_2_VERSION,
  1101. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1102. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1103. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1104. 112,
  1105. 168,
  1106. },
  1107. # endif
  1108. {
  1109. 1,
  1110. TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
  1111. TLS1_RFC_ECDH_anon_WITH_AES_128_CBC_SHA,
  1112. TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
  1113. SSL_kECDHE,
  1114. SSL_aNULL,
  1115. SSL_AES128,
  1116. SSL_SHA1,
  1117. TLS1_VERSION, TLS1_2_VERSION,
  1118. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1119. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  1120. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1121. 128,
  1122. 128,
  1123. },
  1124. {
  1125. 1,
  1126. TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
  1127. TLS1_RFC_ECDH_anon_WITH_AES_256_CBC_SHA,
  1128. TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
  1129. SSL_kECDHE,
  1130. SSL_aNULL,
  1131. SSL_AES256,
  1132. SSL_SHA1,
  1133. TLS1_VERSION, TLS1_2_VERSION,
  1134. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1135. SSL_NOT_DEFAULT | SSL_HIGH | SSL_FIPS,
  1136. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1137. 256,
  1138. 256,
  1139. },
  1140. {
  1141. 1,
  1142. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
  1143. TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_SHA256,
  1144. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
  1145. SSL_kECDHE,
  1146. SSL_aECDSA,
  1147. SSL_AES128,
  1148. SSL_SHA256,
  1149. TLS1_2_VERSION, TLS1_2_VERSION,
  1150. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1151. SSL_HIGH | SSL_FIPS,
  1152. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1153. 128,
  1154. 128,
  1155. },
  1156. {
  1157. 1,
  1158. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
  1159. TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_SHA384,
  1160. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
  1161. SSL_kECDHE,
  1162. SSL_aECDSA,
  1163. SSL_AES256,
  1164. SSL_SHA384,
  1165. TLS1_2_VERSION, TLS1_2_VERSION,
  1166. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1167. SSL_HIGH | SSL_FIPS,
  1168. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1169. 256,
  1170. 256,
  1171. },
  1172. {
  1173. 1,
  1174. TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
  1175. TLS1_RFC_ECDHE_RSA_WITH_AES_128_SHA256,
  1176. TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
  1177. SSL_kECDHE,
  1178. SSL_aRSA,
  1179. SSL_AES128,
  1180. SSL_SHA256,
  1181. TLS1_2_VERSION, TLS1_2_VERSION,
  1182. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1183. SSL_HIGH | SSL_FIPS,
  1184. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1185. 128,
  1186. 128,
  1187. },
  1188. {
  1189. 1,
  1190. TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
  1191. TLS1_RFC_ECDHE_RSA_WITH_AES_256_SHA384,
  1192. TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
  1193. SSL_kECDHE,
  1194. SSL_aRSA,
  1195. SSL_AES256,
  1196. SSL_SHA384,
  1197. TLS1_2_VERSION, TLS1_2_VERSION,
  1198. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1199. SSL_HIGH | SSL_FIPS,
  1200. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1201. 256,
  1202. 256,
  1203. },
  1204. {
  1205. 1,
  1206. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  1207. TLS1_RFC_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  1208. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  1209. SSL_kECDHE,
  1210. SSL_aECDSA,
  1211. SSL_AES128GCM,
  1212. SSL_AEAD,
  1213. TLS1_2_VERSION, TLS1_2_VERSION,
  1214. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1215. SSL_HIGH | SSL_FIPS,
  1216. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1217. 128,
  1218. 128,
  1219. },
  1220. {
  1221. 1,
  1222. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  1223. TLS1_RFC_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  1224. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  1225. SSL_kECDHE,
  1226. SSL_aECDSA,
  1227. SSL_AES256GCM,
  1228. SSL_AEAD,
  1229. TLS1_2_VERSION, TLS1_2_VERSION,
  1230. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1231. SSL_HIGH | SSL_FIPS,
  1232. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1233. 256,
  1234. 256,
  1235. },
  1236. {
  1237. 1,
  1238. TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  1239. TLS1_RFC_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  1240. TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  1241. SSL_kECDHE,
  1242. SSL_aRSA,
  1243. SSL_AES128GCM,
  1244. SSL_AEAD,
  1245. TLS1_2_VERSION, TLS1_2_VERSION,
  1246. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1247. SSL_HIGH | SSL_FIPS,
  1248. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1249. 128,
  1250. 128,
  1251. },
  1252. {
  1253. 1,
  1254. TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  1255. TLS1_RFC_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  1256. TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  1257. SSL_kECDHE,
  1258. SSL_aRSA,
  1259. SSL_AES256GCM,
  1260. SSL_AEAD,
  1261. TLS1_2_VERSION, TLS1_2_VERSION,
  1262. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1263. SSL_HIGH | SSL_FIPS,
  1264. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1265. 256,
  1266. 256,
  1267. },
  1268. {
  1269. 1,
  1270. TLS1_TXT_PSK_WITH_NULL_SHA,
  1271. TLS1_RFC_PSK_WITH_NULL_SHA,
  1272. TLS1_CK_PSK_WITH_NULL_SHA,
  1273. SSL_kPSK,
  1274. SSL_aPSK,
  1275. SSL_eNULL,
  1276. SSL_SHA1,
  1277. SSL3_VERSION, TLS1_2_VERSION,
  1278. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1279. SSL_STRONG_NONE | SSL_FIPS,
  1280. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1281. 0,
  1282. 0,
  1283. },
  1284. {
  1285. 1,
  1286. TLS1_TXT_DHE_PSK_WITH_NULL_SHA,
  1287. TLS1_RFC_DHE_PSK_WITH_NULL_SHA,
  1288. TLS1_CK_DHE_PSK_WITH_NULL_SHA,
  1289. SSL_kDHEPSK,
  1290. SSL_aPSK,
  1291. SSL_eNULL,
  1292. SSL_SHA1,
  1293. SSL3_VERSION, TLS1_2_VERSION,
  1294. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1295. SSL_STRONG_NONE | SSL_FIPS,
  1296. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1297. 0,
  1298. 0,
  1299. },
  1300. {
  1301. 1,
  1302. TLS1_TXT_RSA_PSK_WITH_NULL_SHA,
  1303. TLS1_RFC_RSA_PSK_WITH_NULL_SHA,
  1304. TLS1_CK_RSA_PSK_WITH_NULL_SHA,
  1305. SSL_kRSAPSK,
  1306. SSL_aRSA,
  1307. SSL_eNULL,
  1308. SSL_SHA1,
  1309. SSL3_VERSION, TLS1_2_VERSION,
  1310. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1311. SSL_STRONG_NONE | SSL_FIPS,
  1312. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1313. 0,
  1314. 0,
  1315. },
  1316. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1317. {
  1318. 1,
  1319. TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
  1320. TLS1_RFC_PSK_WITH_3DES_EDE_CBC_SHA,
  1321. TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
  1322. SSL_kPSK,
  1323. SSL_aPSK,
  1324. SSL_3DES,
  1325. SSL_SHA1,
  1326. SSL3_VERSION, TLS1_2_VERSION,
  1327. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1328. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1329. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1330. 112,
  1331. 168,
  1332. },
  1333. # endif
  1334. {
  1335. 1,
  1336. TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
  1337. TLS1_RFC_PSK_WITH_AES_128_CBC_SHA,
  1338. TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
  1339. SSL_kPSK,
  1340. SSL_aPSK,
  1341. SSL_AES128,
  1342. SSL_SHA1,
  1343. SSL3_VERSION, TLS1_2_VERSION,
  1344. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1345. SSL_HIGH | SSL_FIPS,
  1346. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1347. 128,
  1348. 128,
  1349. },
  1350. {
  1351. 1,
  1352. TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
  1353. TLS1_RFC_PSK_WITH_AES_256_CBC_SHA,
  1354. TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
  1355. SSL_kPSK,
  1356. SSL_aPSK,
  1357. SSL_AES256,
  1358. SSL_SHA1,
  1359. SSL3_VERSION, TLS1_2_VERSION,
  1360. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1361. SSL_HIGH | SSL_FIPS,
  1362. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1363. 256,
  1364. 256,
  1365. },
  1366. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1367. {
  1368. 1,
  1369. TLS1_TXT_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1370. TLS1_RFC_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1371. TLS1_CK_DHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1372. SSL_kDHEPSK,
  1373. SSL_aPSK,
  1374. SSL_3DES,
  1375. SSL_SHA1,
  1376. SSL3_VERSION, TLS1_2_VERSION,
  1377. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1378. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1379. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1380. 112,
  1381. 168,
  1382. },
  1383. # endif
  1384. {
  1385. 1,
  1386. TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA,
  1387. TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA,
  1388. TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA,
  1389. SSL_kDHEPSK,
  1390. SSL_aPSK,
  1391. SSL_AES128,
  1392. SSL_SHA1,
  1393. SSL3_VERSION, TLS1_2_VERSION,
  1394. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1395. SSL_HIGH | SSL_FIPS,
  1396. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1397. 128,
  1398. 128,
  1399. },
  1400. {
  1401. 1,
  1402. TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA,
  1403. TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA,
  1404. TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA,
  1405. SSL_kDHEPSK,
  1406. SSL_aPSK,
  1407. SSL_AES256,
  1408. SSL_SHA1,
  1409. SSL3_VERSION, TLS1_2_VERSION,
  1410. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1411. SSL_HIGH | SSL_FIPS,
  1412. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1413. 256,
  1414. 256,
  1415. },
  1416. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1417. {
  1418. 1,
  1419. TLS1_TXT_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
  1420. TLS1_RFC_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
  1421. TLS1_CK_RSA_PSK_WITH_3DES_EDE_CBC_SHA,
  1422. SSL_kRSAPSK,
  1423. SSL_aRSA,
  1424. SSL_3DES,
  1425. SSL_SHA1,
  1426. SSL3_VERSION, TLS1_2_VERSION,
  1427. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1428. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1429. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1430. 112,
  1431. 168,
  1432. },
  1433. # endif
  1434. {
  1435. 1,
  1436. TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA,
  1437. TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA,
  1438. TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA,
  1439. SSL_kRSAPSK,
  1440. SSL_aRSA,
  1441. SSL_AES128,
  1442. SSL_SHA1,
  1443. SSL3_VERSION, TLS1_2_VERSION,
  1444. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1445. SSL_HIGH | SSL_FIPS,
  1446. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1447. 128,
  1448. 128,
  1449. },
  1450. {
  1451. 1,
  1452. TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA,
  1453. TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA,
  1454. TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA,
  1455. SSL_kRSAPSK,
  1456. SSL_aRSA,
  1457. SSL_AES256,
  1458. SSL_SHA1,
  1459. SSL3_VERSION, TLS1_2_VERSION,
  1460. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1461. SSL_HIGH | SSL_FIPS,
  1462. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1463. 256,
  1464. 256,
  1465. },
  1466. {
  1467. 1,
  1468. TLS1_TXT_PSK_WITH_AES_128_GCM_SHA256,
  1469. TLS1_RFC_PSK_WITH_AES_128_GCM_SHA256,
  1470. TLS1_CK_PSK_WITH_AES_128_GCM_SHA256,
  1471. SSL_kPSK,
  1472. SSL_aPSK,
  1473. SSL_AES128GCM,
  1474. SSL_AEAD,
  1475. TLS1_2_VERSION, TLS1_2_VERSION,
  1476. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1477. SSL_HIGH | SSL_FIPS,
  1478. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1479. 128,
  1480. 128,
  1481. },
  1482. {
  1483. 1,
  1484. TLS1_TXT_PSK_WITH_AES_256_GCM_SHA384,
  1485. TLS1_RFC_PSK_WITH_AES_256_GCM_SHA384,
  1486. TLS1_CK_PSK_WITH_AES_256_GCM_SHA384,
  1487. SSL_kPSK,
  1488. SSL_aPSK,
  1489. SSL_AES256GCM,
  1490. SSL_AEAD,
  1491. TLS1_2_VERSION, TLS1_2_VERSION,
  1492. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1493. SSL_HIGH | SSL_FIPS,
  1494. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1495. 256,
  1496. 256,
  1497. },
  1498. {
  1499. 1,
  1500. TLS1_TXT_DHE_PSK_WITH_AES_128_GCM_SHA256,
  1501. TLS1_RFC_DHE_PSK_WITH_AES_128_GCM_SHA256,
  1502. TLS1_CK_DHE_PSK_WITH_AES_128_GCM_SHA256,
  1503. SSL_kDHEPSK,
  1504. SSL_aPSK,
  1505. SSL_AES128GCM,
  1506. SSL_AEAD,
  1507. TLS1_2_VERSION, TLS1_2_VERSION,
  1508. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1509. SSL_HIGH | SSL_FIPS,
  1510. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1511. 128,
  1512. 128,
  1513. },
  1514. {
  1515. 1,
  1516. TLS1_TXT_DHE_PSK_WITH_AES_256_GCM_SHA384,
  1517. TLS1_RFC_DHE_PSK_WITH_AES_256_GCM_SHA384,
  1518. TLS1_CK_DHE_PSK_WITH_AES_256_GCM_SHA384,
  1519. SSL_kDHEPSK,
  1520. SSL_aPSK,
  1521. SSL_AES256GCM,
  1522. SSL_AEAD,
  1523. TLS1_2_VERSION, TLS1_2_VERSION,
  1524. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1525. SSL_HIGH | SSL_FIPS,
  1526. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1527. 256,
  1528. 256,
  1529. },
  1530. {
  1531. 1,
  1532. TLS1_TXT_RSA_PSK_WITH_AES_128_GCM_SHA256,
  1533. TLS1_RFC_RSA_PSK_WITH_AES_128_GCM_SHA256,
  1534. TLS1_CK_RSA_PSK_WITH_AES_128_GCM_SHA256,
  1535. SSL_kRSAPSK,
  1536. SSL_aRSA,
  1537. SSL_AES128GCM,
  1538. SSL_AEAD,
  1539. TLS1_2_VERSION, TLS1_2_VERSION,
  1540. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1541. SSL_HIGH | SSL_FIPS,
  1542. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  1543. 128,
  1544. 128,
  1545. },
  1546. {
  1547. 1,
  1548. TLS1_TXT_RSA_PSK_WITH_AES_256_GCM_SHA384,
  1549. TLS1_RFC_RSA_PSK_WITH_AES_256_GCM_SHA384,
  1550. TLS1_CK_RSA_PSK_WITH_AES_256_GCM_SHA384,
  1551. SSL_kRSAPSK,
  1552. SSL_aRSA,
  1553. SSL_AES256GCM,
  1554. SSL_AEAD,
  1555. TLS1_2_VERSION, TLS1_2_VERSION,
  1556. DTLS1_2_VERSION, DTLS1_2_VERSION,
  1557. SSL_HIGH | SSL_FIPS,
  1558. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1559. 256,
  1560. 256,
  1561. },
  1562. {
  1563. 1,
  1564. TLS1_TXT_PSK_WITH_AES_128_CBC_SHA256,
  1565. TLS1_RFC_PSK_WITH_AES_128_CBC_SHA256,
  1566. TLS1_CK_PSK_WITH_AES_128_CBC_SHA256,
  1567. SSL_kPSK,
  1568. SSL_aPSK,
  1569. SSL_AES128,
  1570. SSL_SHA256,
  1571. TLS1_VERSION, TLS1_2_VERSION,
  1572. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1573. SSL_HIGH | SSL_FIPS,
  1574. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1575. 128,
  1576. 128,
  1577. },
  1578. {
  1579. 1,
  1580. TLS1_TXT_PSK_WITH_AES_256_CBC_SHA384,
  1581. TLS1_RFC_PSK_WITH_AES_256_CBC_SHA384,
  1582. TLS1_CK_PSK_WITH_AES_256_CBC_SHA384,
  1583. SSL_kPSK,
  1584. SSL_aPSK,
  1585. SSL_AES256,
  1586. SSL_SHA384,
  1587. TLS1_VERSION, TLS1_2_VERSION,
  1588. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1589. SSL_HIGH | SSL_FIPS,
  1590. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1591. 256,
  1592. 256,
  1593. },
  1594. {
  1595. 1,
  1596. TLS1_TXT_PSK_WITH_NULL_SHA256,
  1597. TLS1_RFC_PSK_WITH_NULL_SHA256,
  1598. TLS1_CK_PSK_WITH_NULL_SHA256,
  1599. SSL_kPSK,
  1600. SSL_aPSK,
  1601. SSL_eNULL,
  1602. SSL_SHA256,
  1603. TLS1_VERSION, TLS1_2_VERSION,
  1604. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1605. SSL_STRONG_NONE | SSL_FIPS,
  1606. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1607. 0,
  1608. 0,
  1609. },
  1610. {
  1611. 1,
  1612. TLS1_TXT_PSK_WITH_NULL_SHA384,
  1613. TLS1_RFC_PSK_WITH_NULL_SHA384,
  1614. TLS1_CK_PSK_WITH_NULL_SHA384,
  1615. SSL_kPSK,
  1616. SSL_aPSK,
  1617. SSL_eNULL,
  1618. SSL_SHA384,
  1619. TLS1_VERSION, TLS1_2_VERSION,
  1620. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1621. SSL_STRONG_NONE | SSL_FIPS,
  1622. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1623. 0,
  1624. 0,
  1625. },
  1626. {
  1627. 1,
  1628. TLS1_TXT_DHE_PSK_WITH_AES_128_CBC_SHA256,
  1629. TLS1_RFC_DHE_PSK_WITH_AES_128_CBC_SHA256,
  1630. TLS1_CK_DHE_PSK_WITH_AES_128_CBC_SHA256,
  1631. SSL_kDHEPSK,
  1632. SSL_aPSK,
  1633. SSL_AES128,
  1634. SSL_SHA256,
  1635. TLS1_VERSION, TLS1_2_VERSION,
  1636. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1637. SSL_HIGH | SSL_FIPS,
  1638. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1639. 128,
  1640. 128,
  1641. },
  1642. {
  1643. 1,
  1644. TLS1_TXT_DHE_PSK_WITH_AES_256_CBC_SHA384,
  1645. TLS1_RFC_DHE_PSK_WITH_AES_256_CBC_SHA384,
  1646. TLS1_CK_DHE_PSK_WITH_AES_256_CBC_SHA384,
  1647. SSL_kDHEPSK,
  1648. SSL_aPSK,
  1649. SSL_AES256,
  1650. SSL_SHA384,
  1651. TLS1_VERSION, TLS1_2_VERSION,
  1652. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1653. SSL_HIGH | SSL_FIPS,
  1654. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1655. 256,
  1656. 256,
  1657. },
  1658. {
  1659. 1,
  1660. TLS1_TXT_DHE_PSK_WITH_NULL_SHA256,
  1661. TLS1_RFC_DHE_PSK_WITH_NULL_SHA256,
  1662. TLS1_CK_DHE_PSK_WITH_NULL_SHA256,
  1663. SSL_kDHEPSK,
  1664. SSL_aPSK,
  1665. SSL_eNULL,
  1666. SSL_SHA256,
  1667. TLS1_VERSION, TLS1_2_VERSION,
  1668. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1669. SSL_STRONG_NONE | SSL_FIPS,
  1670. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1671. 0,
  1672. 0,
  1673. },
  1674. {
  1675. 1,
  1676. TLS1_TXT_DHE_PSK_WITH_NULL_SHA384,
  1677. TLS1_RFC_DHE_PSK_WITH_NULL_SHA384,
  1678. TLS1_CK_DHE_PSK_WITH_NULL_SHA384,
  1679. SSL_kDHEPSK,
  1680. SSL_aPSK,
  1681. SSL_eNULL,
  1682. SSL_SHA384,
  1683. TLS1_VERSION, TLS1_2_VERSION,
  1684. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1685. SSL_STRONG_NONE | SSL_FIPS,
  1686. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1687. 0,
  1688. 0,
  1689. },
  1690. {
  1691. 1,
  1692. TLS1_TXT_RSA_PSK_WITH_AES_128_CBC_SHA256,
  1693. TLS1_RFC_RSA_PSK_WITH_AES_128_CBC_SHA256,
  1694. TLS1_CK_RSA_PSK_WITH_AES_128_CBC_SHA256,
  1695. SSL_kRSAPSK,
  1696. SSL_aRSA,
  1697. SSL_AES128,
  1698. SSL_SHA256,
  1699. TLS1_VERSION, TLS1_2_VERSION,
  1700. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1701. SSL_HIGH | SSL_FIPS,
  1702. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1703. 128,
  1704. 128,
  1705. },
  1706. {
  1707. 1,
  1708. TLS1_TXT_RSA_PSK_WITH_AES_256_CBC_SHA384,
  1709. TLS1_RFC_RSA_PSK_WITH_AES_256_CBC_SHA384,
  1710. TLS1_CK_RSA_PSK_WITH_AES_256_CBC_SHA384,
  1711. SSL_kRSAPSK,
  1712. SSL_aRSA,
  1713. SSL_AES256,
  1714. SSL_SHA384,
  1715. TLS1_VERSION, TLS1_2_VERSION,
  1716. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1717. SSL_HIGH | SSL_FIPS,
  1718. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1719. 256,
  1720. 256,
  1721. },
  1722. {
  1723. 1,
  1724. TLS1_TXT_RSA_PSK_WITH_NULL_SHA256,
  1725. TLS1_RFC_RSA_PSK_WITH_NULL_SHA256,
  1726. TLS1_CK_RSA_PSK_WITH_NULL_SHA256,
  1727. SSL_kRSAPSK,
  1728. SSL_aRSA,
  1729. SSL_eNULL,
  1730. SSL_SHA256,
  1731. TLS1_VERSION, TLS1_2_VERSION,
  1732. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1733. SSL_STRONG_NONE | SSL_FIPS,
  1734. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1735. 0,
  1736. 0,
  1737. },
  1738. {
  1739. 1,
  1740. TLS1_TXT_RSA_PSK_WITH_NULL_SHA384,
  1741. TLS1_RFC_RSA_PSK_WITH_NULL_SHA384,
  1742. TLS1_CK_RSA_PSK_WITH_NULL_SHA384,
  1743. SSL_kRSAPSK,
  1744. SSL_aRSA,
  1745. SSL_eNULL,
  1746. SSL_SHA384,
  1747. TLS1_VERSION, TLS1_2_VERSION,
  1748. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1749. SSL_STRONG_NONE | SSL_FIPS,
  1750. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1751. 0,
  1752. 0,
  1753. },
  1754. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1755. {
  1756. 1,
  1757. TLS1_TXT_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1758. TLS1_RFC_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1759. TLS1_CK_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA,
  1760. SSL_kECDHEPSK,
  1761. SSL_aPSK,
  1762. SSL_3DES,
  1763. SSL_SHA1,
  1764. TLS1_VERSION, TLS1_2_VERSION,
  1765. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1766. SSL_NOT_DEFAULT | SSL_MEDIUM | SSL_FIPS,
  1767. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1768. 112,
  1769. 168,
  1770. },
  1771. # endif
  1772. {
  1773. 1,
  1774. TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA,
  1775. TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA,
  1776. TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA,
  1777. SSL_kECDHEPSK,
  1778. SSL_aPSK,
  1779. SSL_AES128,
  1780. SSL_SHA1,
  1781. TLS1_VERSION, TLS1_2_VERSION,
  1782. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1783. SSL_HIGH | SSL_FIPS,
  1784. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1785. 128,
  1786. 128,
  1787. },
  1788. {
  1789. 1,
  1790. TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA,
  1791. TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA,
  1792. TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA,
  1793. SSL_kECDHEPSK,
  1794. SSL_aPSK,
  1795. SSL_AES256,
  1796. SSL_SHA1,
  1797. TLS1_VERSION, TLS1_2_VERSION,
  1798. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1799. SSL_HIGH | SSL_FIPS,
  1800. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1801. 256,
  1802. 256,
  1803. },
  1804. {
  1805. 1,
  1806. TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
  1807. TLS1_RFC_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
  1808. TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
  1809. SSL_kECDHEPSK,
  1810. SSL_aPSK,
  1811. SSL_AES128,
  1812. SSL_SHA256,
  1813. TLS1_VERSION, TLS1_2_VERSION,
  1814. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1815. SSL_HIGH | SSL_FIPS,
  1816. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1817. 128,
  1818. 128,
  1819. },
  1820. {
  1821. 1,
  1822. TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
  1823. TLS1_RFC_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
  1824. TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA384,
  1825. SSL_kECDHEPSK,
  1826. SSL_aPSK,
  1827. SSL_AES256,
  1828. SSL_SHA384,
  1829. TLS1_VERSION, TLS1_2_VERSION,
  1830. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1831. SSL_HIGH | SSL_FIPS,
  1832. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1833. 256,
  1834. 256,
  1835. },
  1836. {
  1837. 1,
  1838. TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA,
  1839. TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA,
  1840. TLS1_CK_ECDHE_PSK_WITH_NULL_SHA,
  1841. SSL_kECDHEPSK,
  1842. SSL_aPSK,
  1843. SSL_eNULL,
  1844. SSL_SHA1,
  1845. TLS1_VERSION, TLS1_2_VERSION,
  1846. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1847. SSL_STRONG_NONE | SSL_FIPS,
  1848. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1849. 0,
  1850. 0,
  1851. },
  1852. {
  1853. 1,
  1854. TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA256,
  1855. TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA256,
  1856. TLS1_CK_ECDHE_PSK_WITH_NULL_SHA256,
  1857. SSL_kECDHEPSK,
  1858. SSL_aPSK,
  1859. SSL_eNULL,
  1860. SSL_SHA256,
  1861. TLS1_VERSION, TLS1_2_VERSION,
  1862. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1863. SSL_STRONG_NONE | SSL_FIPS,
  1864. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1865. 0,
  1866. 0,
  1867. },
  1868. {
  1869. 1,
  1870. TLS1_TXT_ECDHE_PSK_WITH_NULL_SHA384,
  1871. TLS1_RFC_ECDHE_PSK_WITH_NULL_SHA384,
  1872. TLS1_CK_ECDHE_PSK_WITH_NULL_SHA384,
  1873. SSL_kECDHEPSK,
  1874. SSL_aPSK,
  1875. SSL_eNULL,
  1876. SSL_SHA384,
  1877. TLS1_VERSION, TLS1_2_VERSION,
  1878. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1879. SSL_STRONG_NONE | SSL_FIPS,
  1880. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  1881. 0,
  1882. 0,
  1883. },
  1884. # ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  1885. {
  1886. 1,
  1887. TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
  1888. TLS1_RFC_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
  1889. TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
  1890. SSL_kSRP,
  1891. SSL_aSRP,
  1892. SSL_3DES,
  1893. SSL_SHA1,
  1894. SSL3_VERSION, TLS1_2_VERSION,
  1895. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1896. SSL_NOT_DEFAULT | SSL_MEDIUM,
  1897. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1898. 112,
  1899. 168,
  1900. },
  1901. {
  1902. 1,
  1903. TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
  1904. TLS1_RFC_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
  1905. TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
  1906. SSL_kSRP,
  1907. SSL_aRSA,
  1908. SSL_3DES,
  1909. SSL_SHA1,
  1910. SSL3_VERSION, TLS1_2_VERSION,
  1911. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1912. SSL_NOT_DEFAULT | SSL_MEDIUM,
  1913. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1914. 112,
  1915. 168,
  1916. },
  1917. {
  1918. 1,
  1919. TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
  1920. TLS1_RFC_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
  1921. TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
  1922. SSL_kSRP,
  1923. SSL_aDSS,
  1924. SSL_3DES,
  1925. SSL_SHA1,
  1926. SSL3_VERSION, TLS1_2_VERSION,
  1927. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1928. SSL_NOT_DEFAULT | SSL_MEDIUM,
  1929. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1930. 112,
  1931. 168,
  1932. },
  1933. # endif
  1934. {
  1935. 1,
  1936. TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
  1937. TLS1_RFC_SRP_SHA_WITH_AES_128_CBC_SHA,
  1938. TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
  1939. SSL_kSRP,
  1940. SSL_aSRP,
  1941. SSL_AES128,
  1942. SSL_SHA1,
  1943. SSL3_VERSION, TLS1_2_VERSION,
  1944. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1945. SSL_HIGH,
  1946. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1947. 128,
  1948. 128,
  1949. },
  1950. {
  1951. 1,
  1952. TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
  1953. TLS1_RFC_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
  1954. TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
  1955. SSL_kSRP,
  1956. SSL_aRSA,
  1957. SSL_AES128,
  1958. SSL_SHA1,
  1959. SSL3_VERSION, TLS1_2_VERSION,
  1960. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1961. SSL_HIGH,
  1962. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1963. 128,
  1964. 128,
  1965. },
  1966. {
  1967. 1,
  1968. TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
  1969. TLS1_RFC_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
  1970. TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
  1971. SSL_kSRP,
  1972. SSL_aDSS,
  1973. SSL_AES128,
  1974. SSL_SHA1,
  1975. SSL3_VERSION, TLS1_2_VERSION,
  1976. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1977. SSL_NOT_DEFAULT | SSL_HIGH,
  1978. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1979. 128,
  1980. 128,
  1981. },
  1982. {
  1983. 1,
  1984. TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
  1985. TLS1_RFC_SRP_SHA_WITH_AES_256_CBC_SHA,
  1986. TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
  1987. SSL_kSRP,
  1988. SSL_aSRP,
  1989. SSL_AES256,
  1990. SSL_SHA1,
  1991. SSL3_VERSION, TLS1_2_VERSION,
  1992. DTLS1_BAD_VER, DTLS1_2_VERSION,
  1993. SSL_HIGH,
  1994. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  1995. 256,
  1996. 256,
  1997. },
  1998. {
  1999. 1,
  2000. TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
  2001. TLS1_RFC_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
  2002. TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
  2003. SSL_kSRP,
  2004. SSL_aRSA,
  2005. SSL_AES256,
  2006. SSL_SHA1,
  2007. SSL3_VERSION, TLS1_2_VERSION,
  2008. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2009. SSL_HIGH,
  2010. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2011. 256,
  2012. 256,
  2013. },
  2014. {
  2015. 1,
  2016. TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
  2017. TLS1_RFC_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
  2018. TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
  2019. SSL_kSRP,
  2020. SSL_aDSS,
  2021. SSL_AES256,
  2022. SSL_SHA1,
  2023. SSL3_VERSION, TLS1_2_VERSION,
  2024. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2025. SSL_NOT_DEFAULT | SSL_HIGH,
  2026. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2027. 256,
  2028. 256,
  2029. },
  2030. {
  2031. 1,
  2032. TLS1_TXT_DHE_RSA_WITH_CHACHA20_POLY1305,
  2033. TLS1_RFC_DHE_RSA_WITH_CHACHA20_POLY1305,
  2034. TLS1_CK_DHE_RSA_WITH_CHACHA20_POLY1305,
  2035. SSL_kDHE,
  2036. SSL_aRSA,
  2037. SSL_CHACHA20POLY1305,
  2038. SSL_AEAD,
  2039. TLS1_2_VERSION, TLS1_2_VERSION,
  2040. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2041. SSL_HIGH,
  2042. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2043. 256,
  2044. 256,
  2045. },
  2046. {
  2047. 1,
  2048. TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  2049. TLS1_RFC_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  2050. TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305,
  2051. SSL_kECDHE,
  2052. SSL_aRSA,
  2053. SSL_CHACHA20POLY1305,
  2054. SSL_AEAD,
  2055. TLS1_2_VERSION, TLS1_2_VERSION,
  2056. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2057. SSL_HIGH,
  2058. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2059. 256,
  2060. 256,
  2061. },
  2062. {
  2063. 1,
  2064. TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  2065. TLS1_RFC_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  2066. TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
  2067. SSL_kECDHE,
  2068. SSL_aECDSA,
  2069. SSL_CHACHA20POLY1305,
  2070. SSL_AEAD,
  2071. TLS1_2_VERSION, TLS1_2_VERSION,
  2072. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2073. SSL_HIGH,
  2074. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2075. 256,
  2076. 256,
  2077. },
  2078. {
  2079. 1,
  2080. TLS1_TXT_PSK_WITH_CHACHA20_POLY1305,
  2081. TLS1_RFC_PSK_WITH_CHACHA20_POLY1305,
  2082. TLS1_CK_PSK_WITH_CHACHA20_POLY1305,
  2083. SSL_kPSK,
  2084. SSL_aPSK,
  2085. SSL_CHACHA20POLY1305,
  2086. SSL_AEAD,
  2087. TLS1_2_VERSION, TLS1_2_VERSION,
  2088. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2089. SSL_HIGH,
  2090. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2091. 256,
  2092. 256,
  2093. },
  2094. {
  2095. 1,
  2096. TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305,
  2097. TLS1_RFC_ECDHE_PSK_WITH_CHACHA20_POLY1305,
  2098. TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305,
  2099. SSL_kECDHEPSK,
  2100. SSL_aPSK,
  2101. SSL_CHACHA20POLY1305,
  2102. SSL_AEAD,
  2103. TLS1_2_VERSION, TLS1_2_VERSION,
  2104. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2105. SSL_HIGH,
  2106. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2107. 256,
  2108. 256,
  2109. },
  2110. {
  2111. 1,
  2112. TLS1_TXT_DHE_PSK_WITH_CHACHA20_POLY1305,
  2113. TLS1_RFC_DHE_PSK_WITH_CHACHA20_POLY1305,
  2114. TLS1_CK_DHE_PSK_WITH_CHACHA20_POLY1305,
  2115. SSL_kDHEPSK,
  2116. SSL_aPSK,
  2117. SSL_CHACHA20POLY1305,
  2118. SSL_AEAD,
  2119. TLS1_2_VERSION, TLS1_2_VERSION,
  2120. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2121. SSL_HIGH,
  2122. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2123. 256,
  2124. 256,
  2125. },
  2126. {
  2127. 1,
  2128. TLS1_TXT_RSA_PSK_WITH_CHACHA20_POLY1305,
  2129. TLS1_RFC_RSA_PSK_WITH_CHACHA20_POLY1305,
  2130. TLS1_CK_RSA_PSK_WITH_CHACHA20_POLY1305,
  2131. SSL_kRSAPSK,
  2132. SSL_aRSA,
  2133. SSL_CHACHA20POLY1305,
  2134. SSL_AEAD,
  2135. TLS1_2_VERSION, TLS1_2_VERSION,
  2136. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2137. SSL_HIGH,
  2138. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2139. 256,
  2140. 256,
  2141. },
  2142. {
  2143. 1,
  2144. TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2145. TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2146. TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2147. SSL_kRSA,
  2148. SSL_aRSA,
  2149. SSL_CAMELLIA128,
  2150. SSL_SHA256,
  2151. TLS1_2_VERSION, TLS1_2_VERSION,
  2152. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2153. SSL_NOT_DEFAULT | SSL_HIGH,
  2154. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2155. 128,
  2156. 128,
  2157. },
  2158. {
  2159. 1,
  2160. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
  2161. TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
  2162. TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256,
  2163. SSL_kDHE,
  2164. SSL_aDSS,
  2165. SSL_CAMELLIA128,
  2166. SSL_SHA256,
  2167. TLS1_2_VERSION, TLS1_2_VERSION,
  2168. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2169. SSL_NOT_DEFAULT | SSL_HIGH,
  2170. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2171. 128,
  2172. 128,
  2173. },
  2174. {
  2175. 1,
  2176. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2177. TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2178. TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2179. SSL_kDHE,
  2180. SSL_aRSA,
  2181. SSL_CAMELLIA128,
  2182. SSL_SHA256,
  2183. TLS1_2_VERSION, TLS1_2_VERSION,
  2184. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2185. SSL_NOT_DEFAULT | SSL_HIGH,
  2186. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2187. 128,
  2188. 128,
  2189. },
  2190. {
  2191. 1,
  2192. TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA256,
  2193. TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA256,
  2194. TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA256,
  2195. SSL_kDHE,
  2196. SSL_aNULL,
  2197. SSL_CAMELLIA128,
  2198. SSL_SHA256,
  2199. TLS1_2_VERSION, TLS1_2_VERSION,
  2200. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2201. SSL_NOT_DEFAULT | SSL_HIGH,
  2202. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2203. 128,
  2204. 128,
  2205. },
  2206. {
  2207. 1,
  2208. TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2209. TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2210. TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2211. SSL_kRSA,
  2212. SSL_aRSA,
  2213. SSL_CAMELLIA256,
  2214. SSL_SHA256,
  2215. TLS1_2_VERSION, TLS1_2_VERSION,
  2216. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2217. SSL_NOT_DEFAULT | SSL_HIGH,
  2218. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2219. 256,
  2220. 256,
  2221. },
  2222. {
  2223. 1,
  2224. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
  2225. TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
  2226. TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256,
  2227. SSL_kDHE,
  2228. SSL_aDSS,
  2229. SSL_CAMELLIA256,
  2230. SSL_SHA256,
  2231. TLS1_2_VERSION, TLS1_2_VERSION,
  2232. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2233. SSL_NOT_DEFAULT | SSL_HIGH,
  2234. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2235. 256,
  2236. 256,
  2237. },
  2238. {
  2239. 1,
  2240. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2241. TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2242. TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256,
  2243. SSL_kDHE,
  2244. SSL_aRSA,
  2245. SSL_CAMELLIA256,
  2246. SSL_SHA256,
  2247. TLS1_2_VERSION, TLS1_2_VERSION,
  2248. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2249. SSL_NOT_DEFAULT | SSL_HIGH,
  2250. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2251. 256,
  2252. 256,
  2253. },
  2254. {
  2255. 1,
  2256. TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA256,
  2257. TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA256,
  2258. TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA256,
  2259. SSL_kDHE,
  2260. SSL_aNULL,
  2261. SSL_CAMELLIA256,
  2262. SSL_SHA256,
  2263. TLS1_2_VERSION, TLS1_2_VERSION,
  2264. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2265. SSL_NOT_DEFAULT | SSL_HIGH,
  2266. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2267. 256,
  2268. 256,
  2269. },
  2270. {
  2271. 1,
  2272. TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2273. TLS1_RFC_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2274. TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2275. SSL_kRSA,
  2276. SSL_aRSA,
  2277. SSL_CAMELLIA256,
  2278. SSL_SHA1,
  2279. SSL3_VERSION, TLS1_2_VERSION,
  2280. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2281. SSL_NOT_DEFAULT | SSL_HIGH,
  2282. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2283. 256,
  2284. 256,
  2285. },
  2286. {
  2287. 1,
  2288. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
  2289. TLS1_RFC_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
  2290. TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
  2291. SSL_kDHE,
  2292. SSL_aDSS,
  2293. SSL_CAMELLIA256,
  2294. SSL_SHA1,
  2295. SSL3_VERSION, TLS1_2_VERSION,
  2296. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2297. SSL_NOT_DEFAULT | SSL_HIGH,
  2298. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2299. 256,
  2300. 256,
  2301. },
  2302. {
  2303. 1,
  2304. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2305. TLS1_RFC_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2306. TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  2307. SSL_kDHE,
  2308. SSL_aRSA,
  2309. SSL_CAMELLIA256,
  2310. SSL_SHA1,
  2311. SSL3_VERSION, TLS1_2_VERSION,
  2312. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2313. SSL_NOT_DEFAULT | SSL_HIGH,
  2314. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2315. 256,
  2316. 256,
  2317. },
  2318. {
  2319. 1,
  2320. TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
  2321. TLS1_RFC_ADH_WITH_CAMELLIA_256_CBC_SHA,
  2322. TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
  2323. SSL_kDHE,
  2324. SSL_aNULL,
  2325. SSL_CAMELLIA256,
  2326. SSL_SHA1,
  2327. SSL3_VERSION, TLS1_2_VERSION,
  2328. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2329. SSL_NOT_DEFAULT | SSL_HIGH,
  2330. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2331. 256,
  2332. 256,
  2333. },
  2334. {
  2335. 1,
  2336. TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2337. TLS1_RFC_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2338. TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2339. SSL_kRSA,
  2340. SSL_aRSA,
  2341. SSL_CAMELLIA128,
  2342. SSL_SHA1,
  2343. SSL3_VERSION, TLS1_2_VERSION,
  2344. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2345. SSL_NOT_DEFAULT | SSL_HIGH,
  2346. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2347. 128,
  2348. 128,
  2349. },
  2350. {
  2351. 1,
  2352. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
  2353. TLS1_RFC_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
  2354. TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
  2355. SSL_kDHE,
  2356. SSL_aDSS,
  2357. SSL_CAMELLIA128,
  2358. SSL_SHA1,
  2359. SSL3_VERSION, TLS1_2_VERSION,
  2360. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2361. SSL_NOT_DEFAULT | SSL_HIGH,
  2362. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2363. 128,
  2364. 128,
  2365. },
  2366. {
  2367. 1,
  2368. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2369. TLS1_RFC_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2370. TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  2371. SSL_kDHE,
  2372. SSL_aRSA,
  2373. SSL_CAMELLIA128,
  2374. SSL_SHA1,
  2375. SSL3_VERSION, TLS1_2_VERSION,
  2376. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2377. SSL_NOT_DEFAULT | SSL_HIGH,
  2378. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2379. 128,
  2380. 128,
  2381. },
  2382. {
  2383. 1,
  2384. TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
  2385. TLS1_RFC_ADH_WITH_CAMELLIA_128_CBC_SHA,
  2386. TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
  2387. SSL_kDHE,
  2388. SSL_aNULL,
  2389. SSL_CAMELLIA128,
  2390. SSL_SHA1,
  2391. SSL3_VERSION, TLS1_2_VERSION,
  2392. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2393. SSL_NOT_DEFAULT | SSL_HIGH,
  2394. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2395. 128,
  2396. 128,
  2397. },
  2398. {
  2399. 1,
  2400. TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  2401. TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  2402. TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256,
  2403. SSL_kECDHE,
  2404. SSL_aECDSA,
  2405. SSL_CAMELLIA128,
  2406. SSL_SHA256,
  2407. TLS1_2_VERSION, TLS1_2_VERSION,
  2408. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2409. SSL_NOT_DEFAULT | SSL_HIGH,
  2410. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2411. 128,
  2412. 128,
  2413. },
  2414. {
  2415. 1,
  2416. TLS1_TXT_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  2417. TLS1_RFC_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  2418. TLS1_CK_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384,
  2419. SSL_kECDHE,
  2420. SSL_aECDSA,
  2421. SSL_CAMELLIA256,
  2422. SSL_SHA384,
  2423. TLS1_2_VERSION, TLS1_2_VERSION,
  2424. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2425. SSL_NOT_DEFAULT | SSL_HIGH,
  2426. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2427. 256,
  2428. 256,
  2429. },
  2430. {
  2431. 1,
  2432. TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2433. TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2434. TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256,
  2435. SSL_kECDHE,
  2436. SSL_aRSA,
  2437. SSL_CAMELLIA128,
  2438. SSL_SHA256,
  2439. TLS1_2_VERSION, TLS1_2_VERSION,
  2440. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2441. SSL_NOT_DEFAULT | SSL_HIGH,
  2442. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2443. 128,
  2444. 128,
  2445. },
  2446. {
  2447. 1,
  2448. TLS1_TXT_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  2449. TLS1_RFC_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  2450. TLS1_CK_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384,
  2451. SSL_kECDHE,
  2452. SSL_aRSA,
  2453. SSL_CAMELLIA256,
  2454. SSL_SHA384,
  2455. TLS1_2_VERSION, TLS1_2_VERSION,
  2456. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2457. SSL_NOT_DEFAULT | SSL_HIGH,
  2458. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2459. 256,
  2460. 256,
  2461. },
  2462. {
  2463. 1,
  2464. TLS1_TXT_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2465. TLS1_RFC_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2466. TLS1_CK_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2467. SSL_kPSK,
  2468. SSL_aPSK,
  2469. SSL_CAMELLIA128,
  2470. SSL_SHA256,
  2471. TLS1_VERSION, TLS1_2_VERSION,
  2472. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2473. SSL_NOT_DEFAULT | SSL_HIGH,
  2474. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2475. 128,
  2476. 128,
  2477. },
  2478. {
  2479. 1,
  2480. TLS1_TXT_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2481. TLS1_RFC_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2482. TLS1_CK_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2483. SSL_kPSK,
  2484. SSL_aPSK,
  2485. SSL_CAMELLIA256,
  2486. SSL_SHA384,
  2487. TLS1_VERSION, TLS1_2_VERSION,
  2488. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2489. SSL_NOT_DEFAULT | SSL_HIGH,
  2490. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2491. 256,
  2492. 256,
  2493. },
  2494. {
  2495. 1,
  2496. TLS1_TXT_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2497. TLS1_RFC_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2498. TLS1_CK_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2499. SSL_kDHEPSK,
  2500. SSL_aPSK,
  2501. SSL_CAMELLIA128,
  2502. SSL_SHA256,
  2503. TLS1_VERSION, TLS1_2_VERSION,
  2504. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2505. SSL_NOT_DEFAULT | SSL_HIGH,
  2506. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2507. 128,
  2508. 128,
  2509. },
  2510. {
  2511. 1,
  2512. TLS1_TXT_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2513. TLS1_RFC_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2514. TLS1_CK_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2515. SSL_kDHEPSK,
  2516. SSL_aPSK,
  2517. SSL_CAMELLIA256,
  2518. SSL_SHA384,
  2519. TLS1_VERSION, TLS1_2_VERSION,
  2520. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2521. SSL_NOT_DEFAULT | SSL_HIGH,
  2522. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2523. 256,
  2524. 256,
  2525. },
  2526. {
  2527. 1,
  2528. TLS1_TXT_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2529. TLS1_RFC_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2530. TLS1_CK_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2531. SSL_kRSAPSK,
  2532. SSL_aRSA,
  2533. SSL_CAMELLIA128,
  2534. SSL_SHA256,
  2535. TLS1_VERSION, TLS1_2_VERSION,
  2536. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2537. SSL_NOT_DEFAULT | SSL_HIGH,
  2538. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2539. 128,
  2540. 128,
  2541. },
  2542. {
  2543. 1,
  2544. TLS1_TXT_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2545. TLS1_RFC_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2546. TLS1_CK_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2547. SSL_kRSAPSK,
  2548. SSL_aRSA,
  2549. SSL_CAMELLIA256,
  2550. SSL_SHA384,
  2551. TLS1_VERSION, TLS1_2_VERSION,
  2552. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2553. SSL_NOT_DEFAULT | SSL_HIGH,
  2554. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2555. 256,
  2556. 256,
  2557. },
  2558. {
  2559. 1,
  2560. TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2561. TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2562. TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256,
  2563. SSL_kECDHEPSK,
  2564. SSL_aPSK,
  2565. SSL_CAMELLIA128,
  2566. SSL_SHA256,
  2567. TLS1_VERSION, TLS1_2_VERSION,
  2568. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2569. SSL_NOT_DEFAULT | SSL_HIGH,
  2570. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2571. 128,
  2572. 128,
  2573. },
  2574. {
  2575. 1,
  2576. TLS1_TXT_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2577. TLS1_RFC_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2578. TLS1_CK_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384,
  2579. SSL_kECDHEPSK,
  2580. SSL_aPSK,
  2581. SSL_CAMELLIA256,
  2582. SSL_SHA384,
  2583. TLS1_VERSION, TLS1_2_VERSION,
  2584. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2585. SSL_NOT_DEFAULT | SSL_HIGH,
  2586. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2587. 256,
  2588. 256,
  2589. },
  2590. #ifndef OPENSSL_NO_GOST
  2591. {
  2592. 1,
  2593. "GOST2001-GOST89-GOST89",
  2594. "TLS_GOSTR341001_WITH_28147_CNT_IMIT",
  2595. 0x3000081,
  2596. SSL_kGOST,
  2597. SSL_aGOST01,
  2598. SSL_eGOST2814789CNT,
  2599. SSL_GOST89MAC,
  2600. TLS1_VERSION, TLS1_2_VERSION,
  2601. 0, 0,
  2602. SSL_HIGH,
  2603. SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC,
  2604. 256,
  2605. 256,
  2606. },
  2607. {
  2608. 1,
  2609. "GOST2001-NULL-GOST94",
  2610. "TLS_GOSTR341001_WITH_NULL_GOSTR3411",
  2611. 0x3000083,
  2612. SSL_kGOST,
  2613. SSL_aGOST01,
  2614. SSL_eNULL,
  2615. SSL_GOST94,
  2616. TLS1_VERSION, TLS1_2_VERSION,
  2617. 0, 0,
  2618. SSL_STRONG_NONE,
  2619. SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94,
  2620. 0,
  2621. 0,
  2622. },
  2623. {
  2624. 1,
  2625. "IANA-GOST2012-GOST8912-GOST8912",
  2626. NULL,
  2627. 0x0300c102,
  2628. SSL_kGOST,
  2629. SSL_aGOST12 | SSL_aGOST01,
  2630. SSL_eGOST2814789CNT12,
  2631. SSL_GOST89MAC12,
  2632. TLS1_VERSION, TLS1_2_VERSION,
  2633. 0, 0,
  2634. SSL_HIGH,
  2635. SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
  2636. 256,
  2637. 256,
  2638. },
  2639. {
  2640. 1,
  2641. "LEGACY-GOST2012-GOST8912-GOST8912",
  2642. NULL,
  2643. 0x0300ff85,
  2644. SSL_kGOST,
  2645. SSL_aGOST12 | SSL_aGOST01,
  2646. SSL_eGOST2814789CNT12,
  2647. SSL_GOST89MAC12,
  2648. TLS1_VERSION, TLS1_2_VERSION,
  2649. 0, 0,
  2650. SSL_HIGH,
  2651. SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
  2652. 256,
  2653. 256,
  2654. },
  2655. {
  2656. 1,
  2657. "GOST2012-NULL-GOST12",
  2658. NULL,
  2659. 0x0300ff87,
  2660. SSL_kGOST,
  2661. SSL_aGOST12 | SSL_aGOST01,
  2662. SSL_eNULL,
  2663. SSL_GOST12_256,
  2664. TLS1_VERSION, TLS1_2_VERSION,
  2665. 0, 0,
  2666. SSL_STRONG_NONE,
  2667. SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_STREAM_MAC,
  2668. 0,
  2669. 0,
  2670. },
  2671. {
  2672. 1,
  2673. "GOST2012-KUZNYECHIK-KUZNYECHIKOMAC",
  2674. NULL,
  2675. 0x0300C100,
  2676. SSL_kGOST18,
  2677. SSL_aGOST12,
  2678. SSL_KUZNYECHIK,
  2679. SSL_KUZNYECHIKOMAC,
  2680. TLS1_2_VERSION, TLS1_2_VERSION,
  2681. 0, 0,
  2682. SSL_HIGH,
  2683. SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_TLSTREE,
  2684. 256,
  2685. 256,
  2686. },
  2687. {
  2688. 1,
  2689. "GOST2012-MAGMA-MAGMAOMAC",
  2690. NULL,
  2691. 0x0300C101,
  2692. SSL_kGOST18,
  2693. SSL_aGOST12,
  2694. SSL_MAGMA,
  2695. SSL_MAGMAOMAC,
  2696. TLS1_2_VERSION, TLS1_2_VERSION,
  2697. 0, 0,
  2698. SSL_HIGH,
  2699. SSL_HANDSHAKE_MAC_GOST12_256 | TLS1_PRF_GOST12_256 | TLS1_TLSTREE,
  2700. 256,
  2701. 256,
  2702. },
  2703. #endif /* OPENSSL_NO_GOST */
  2704. {
  2705. 1,
  2706. SSL3_TXT_RSA_IDEA_128_SHA,
  2707. SSL3_RFC_RSA_IDEA_128_SHA,
  2708. SSL3_CK_RSA_IDEA_128_SHA,
  2709. SSL_kRSA,
  2710. SSL_aRSA,
  2711. SSL_IDEA,
  2712. SSL_SHA1,
  2713. SSL3_VERSION, TLS1_1_VERSION,
  2714. DTLS1_BAD_VER, DTLS1_VERSION,
  2715. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2716. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2717. 128,
  2718. 128,
  2719. },
  2720. {
  2721. 1,
  2722. TLS1_TXT_RSA_WITH_SEED_SHA,
  2723. TLS1_RFC_RSA_WITH_SEED_SHA,
  2724. TLS1_CK_RSA_WITH_SEED_SHA,
  2725. SSL_kRSA,
  2726. SSL_aRSA,
  2727. SSL_SEED,
  2728. SSL_SHA1,
  2729. SSL3_VERSION, TLS1_2_VERSION,
  2730. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2731. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2732. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2733. 128,
  2734. 128,
  2735. },
  2736. {
  2737. 1,
  2738. TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
  2739. TLS1_RFC_DHE_DSS_WITH_SEED_SHA,
  2740. TLS1_CK_DHE_DSS_WITH_SEED_SHA,
  2741. SSL_kDHE,
  2742. SSL_aDSS,
  2743. SSL_SEED,
  2744. SSL_SHA1,
  2745. SSL3_VERSION, TLS1_2_VERSION,
  2746. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2747. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2748. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2749. 128,
  2750. 128,
  2751. },
  2752. {
  2753. 1,
  2754. TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
  2755. TLS1_RFC_DHE_RSA_WITH_SEED_SHA,
  2756. TLS1_CK_DHE_RSA_WITH_SEED_SHA,
  2757. SSL_kDHE,
  2758. SSL_aRSA,
  2759. SSL_SEED,
  2760. SSL_SHA1,
  2761. SSL3_VERSION, TLS1_2_VERSION,
  2762. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2763. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2764. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2765. 128,
  2766. 128,
  2767. },
  2768. {
  2769. 1,
  2770. TLS1_TXT_ADH_WITH_SEED_SHA,
  2771. TLS1_RFC_ADH_WITH_SEED_SHA,
  2772. TLS1_CK_ADH_WITH_SEED_SHA,
  2773. SSL_kDHE,
  2774. SSL_aNULL,
  2775. SSL_SEED,
  2776. SSL_SHA1,
  2777. SSL3_VERSION, TLS1_2_VERSION,
  2778. DTLS1_BAD_VER, DTLS1_2_VERSION,
  2779. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2780. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2781. 128,
  2782. 128,
  2783. },
  2784. #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  2785. {
  2786. 1,
  2787. SSL3_TXT_RSA_RC4_128_MD5,
  2788. SSL3_RFC_RSA_RC4_128_MD5,
  2789. SSL3_CK_RSA_RC4_128_MD5,
  2790. SSL_kRSA,
  2791. SSL_aRSA,
  2792. SSL_RC4,
  2793. SSL_MD5,
  2794. SSL3_VERSION, TLS1_2_VERSION,
  2795. 0, 0,
  2796. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2797. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2798. 80,
  2799. 128,
  2800. },
  2801. {
  2802. 1,
  2803. SSL3_TXT_RSA_RC4_128_SHA,
  2804. SSL3_RFC_RSA_RC4_128_SHA,
  2805. SSL3_CK_RSA_RC4_128_SHA,
  2806. SSL_kRSA,
  2807. SSL_aRSA,
  2808. SSL_RC4,
  2809. SSL_SHA1,
  2810. SSL3_VERSION, TLS1_2_VERSION,
  2811. 0, 0,
  2812. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2813. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2814. 80,
  2815. 128,
  2816. },
  2817. {
  2818. 1,
  2819. SSL3_TXT_ADH_RC4_128_MD5,
  2820. SSL3_RFC_ADH_RC4_128_MD5,
  2821. SSL3_CK_ADH_RC4_128_MD5,
  2822. SSL_kDHE,
  2823. SSL_aNULL,
  2824. SSL_RC4,
  2825. SSL_MD5,
  2826. SSL3_VERSION, TLS1_2_VERSION,
  2827. 0, 0,
  2828. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2829. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2830. 80,
  2831. 128,
  2832. },
  2833. {
  2834. 1,
  2835. TLS1_TXT_ECDHE_PSK_WITH_RC4_128_SHA,
  2836. TLS1_RFC_ECDHE_PSK_WITH_RC4_128_SHA,
  2837. TLS1_CK_ECDHE_PSK_WITH_RC4_128_SHA,
  2838. SSL_kECDHEPSK,
  2839. SSL_aPSK,
  2840. SSL_RC4,
  2841. SSL_SHA1,
  2842. TLS1_VERSION, TLS1_2_VERSION,
  2843. 0, 0,
  2844. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2845. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2846. 80,
  2847. 128,
  2848. },
  2849. {
  2850. 1,
  2851. TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
  2852. TLS1_RFC_ECDH_anon_WITH_RC4_128_SHA,
  2853. TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
  2854. SSL_kECDHE,
  2855. SSL_aNULL,
  2856. SSL_RC4,
  2857. SSL_SHA1,
  2858. TLS1_VERSION, TLS1_2_VERSION,
  2859. 0, 0,
  2860. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2861. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2862. 80,
  2863. 128,
  2864. },
  2865. {
  2866. 1,
  2867. TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
  2868. TLS1_RFC_ECDHE_ECDSA_WITH_RC4_128_SHA,
  2869. TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
  2870. SSL_kECDHE,
  2871. SSL_aECDSA,
  2872. SSL_RC4,
  2873. SSL_SHA1,
  2874. TLS1_VERSION, TLS1_2_VERSION,
  2875. 0, 0,
  2876. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2877. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2878. 80,
  2879. 128,
  2880. },
  2881. {
  2882. 1,
  2883. TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
  2884. TLS1_RFC_ECDHE_RSA_WITH_RC4_128_SHA,
  2885. TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
  2886. SSL_kECDHE,
  2887. SSL_aRSA,
  2888. SSL_RC4,
  2889. SSL_SHA1,
  2890. TLS1_VERSION, TLS1_2_VERSION,
  2891. 0, 0,
  2892. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2893. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2894. 80,
  2895. 128,
  2896. },
  2897. {
  2898. 1,
  2899. TLS1_TXT_PSK_WITH_RC4_128_SHA,
  2900. TLS1_RFC_PSK_WITH_RC4_128_SHA,
  2901. TLS1_CK_PSK_WITH_RC4_128_SHA,
  2902. SSL_kPSK,
  2903. SSL_aPSK,
  2904. SSL_RC4,
  2905. SSL_SHA1,
  2906. SSL3_VERSION, TLS1_2_VERSION,
  2907. 0, 0,
  2908. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2909. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2910. 80,
  2911. 128,
  2912. },
  2913. {
  2914. 1,
  2915. TLS1_TXT_RSA_PSK_WITH_RC4_128_SHA,
  2916. TLS1_RFC_RSA_PSK_WITH_RC4_128_SHA,
  2917. TLS1_CK_RSA_PSK_WITH_RC4_128_SHA,
  2918. SSL_kRSAPSK,
  2919. SSL_aRSA,
  2920. SSL_RC4,
  2921. SSL_SHA1,
  2922. SSL3_VERSION, TLS1_2_VERSION,
  2923. 0, 0,
  2924. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2925. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2926. 80,
  2927. 128,
  2928. },
  2929. {
  2930. 1,
  2931. TLS1_TXT_DHE_PSK_WITH_RC4_128_SHA,
  2932. TLS1_RFC_DHE_PSK_WITH_RC4_128_SHA,
  2933. TLS1_CK_DHE_PSK_WITH_RC4_128_SHA,
  2934. SSL_kDHEPSK,
  2935. SSL_aPSK,
  2936. SSL_RC4,
  2937. SSL_SHA1,
  2938. SSL3_VERSION, TLS1_2_VERSION,
  2939. 0, 0,
  2940. SSL_NOT_DEFAULT | SSL_MEDIUM,
  2941. SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF,
  2942. 80,
  2943. 128,
  2944. },
  2945. #endif /* OPENSSL_NO_WEAK_SSL_CIPHERS */
  2946. {
  2947. 1,
  2948. TLS1_TXT_RSA_WITH_ARIA_128_GCM_SHA256,
  2949. TLS1_RFC_RSA_WITH_ARIA_128_GCM_SHA256,
  2950. TLS1_CK_RSA_WITH_ARIA_128_GCM_SHA256,
  2951. SSL_kRSA,
  2952. SSL_aRSA,
  2953. SSL_ARIA128GCM,
  2954. SSL_AEAD,
  2955. TLS1_2_VERSION, TLS1_2_VERSION,
  2956. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2957. SSL_NOT_DEFAULT | SSL_HIGH,
  2958. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2959. 128,
  2960. 128,
  2961. },
  2962. {
  2963. 1,
  2964. TLS1_TXT_RSA_WITH_ARIA_256_GCM_SHA384,
  2965. TLS1_RFC_RSA_WITH_ARIA_256_GCM_SHA384,
  2966. TLS1_CK_RSA_WITH_ARIA_256_GCM_SHA384,
  2967. SSL_kRSA,
  2968. SSL_aRSA,
  2969. SSL_ARIA256GCM,
  2970. SSL_AEAD,
  2971. TLS1_2_VERSION, TLS1_2_VERSION,
  2972. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2973. SSL_NOT_DEFAULT | SSL_HIGH,
  2974. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  2975. 256,
  2976. 256,
  2977. },
  2978. {
  2979. 1,
  2980. TLS1_TXT_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
  2981. TLS1_RFC_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
  2982. TLS1_CK_DHE_RSA_WITH_ARIA_128_GCM_SHA256,
  2983. SSL_kDHE,
  2984. SSL_aRSA,
  2985. SSL_ARIA128GCM,
  2986. SSL_AEAD,
  2987. TLS1_2_VERSION, TLS1_2_VERSION,
  2988. DTLS1_2_VERSION, DTLS1_2_VERSION,
  2989. SSL_NOT_DEFAULT | SSL_HIGH,
  2990. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  2991. 128,
  2992. 128,
  2993. },
  2994. {
  2995. 1,
  2996. TLS1_TXT_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
  2997. TLS1_RFC_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
  2998. TLS1_CK_DHE_RSA_WITH_ARIA_256_GCM_SHA384,
  2999. SSL_kDHE,
  3000. SSL_aRSA,
  3001. SSL_ARIA256GCM,
  3002. SSL_AEAD,
  3003. TLS1_2_VERSION, TLS1_2_VERSION,
  3004. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3005. SSL_NOT_DEFAULT | SSL_HIGH,
  3006. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3007. 256,
  3008. 256,
  3009. },
  3010. {
  3011. 1,
  3012. TLS1_TXT_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
  3013. TLS1_RFC_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
  3014. TLS1_CK_DHE_DSS_WITH_ARIA_128_GCM_SHA256,
  3015. SSL_kDHE,
  3016. SSL_aDSS,
  3017. SSL_ARIA128GCM,
  3018. SSL_AEAD,
  3019. TLS1_2_VERSION, TLS1_2_VERSION,
  3020. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3021. SSL_NOT_DEFAULT | SSL_HIGH,
  3022. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3023. 128,
  3024. 128,
  3025. },
  3026. {
  3027. 1,
  3028. TLS1_TXT_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
  3029. TLS1_RFC_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
  3030. TLS1_CK_DHE_DSS_WITH_ARIA_256_GCM_SHA384,
  3031. SSL_kDHE,
  3032. SSL_aDSS,
  3033. SSL_ARIA256GCM,
  3034. SSL_AEAD,
  3035. TLS1_2_VERSION, TLS1_2_VERSION,
  3036. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3037. SSL_NOT_DEFAULT | SSL_HIGH,
  3038. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3039. 256,
  3040. 256,
  3041. },
  3042. {
  3043. 1,
  3044. TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
  3045. TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
  3046. TLS1_CK_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256,
  3047. SSL_kECDHE,
  3048. SSL_aECDSA,
  3049. SSL_ARIA128GCM,
  3050. SSL_AEAD,
  3051. TLS1_2_VERSION, TLS1_2_VERSION,
  3052. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3053. SSL_NOT_DEFAULT | SSL_HIGH,
  3054. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3055. 128,
  3056. 128,
  3057. },
  3058. {
  3059. 1,
  3060. TLS1_TXT_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
  3061. TLS1_RFC_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
  3062. TLS1_CK_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384,
  3063. SSL_kECDHE,
  3064. SSL_aECDSA,
  3065. SSL_ARIA256GCM,
  3066. SSL_AEAD,
  3067. TLS1_2_VERSION, TLS1_2_VERSION,
  3068. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3069. SSL_NOT_DEFAULT | SSL_HIGH,
  3070. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3071. 256,
  3072. 256,
  3073. },
  3074. {
  3075. 1,
  3076. TLS1_TXT_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
  3077. TLS1_RFC_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
  3078. TLS1_CK_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256,
  3079. SSL_kECDHE,
  3080. SSL_aRSA,
  3081. SSL_ARIA128GCM,
  3082. SSL_AEAD,
  3083. TLS1_2_VERSION, TLS1_2_VERSION,
  3084. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3085. SSL_NOT_DEFAULT | SSL_HIGH,
  3086. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3087. 128,
  3088. 128,
  3089. },
  3090. {
  3091. 1,
  3092. TLS1_TXT_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
  3093. TLS1_RFC_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
  3094. TLS1_CK_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384,
  3095. SSL_kECDHE,
  3096. SSL_aRSA,
  3097. SSL_ARIA256GCM,
  3098. SSL_AEAD,
  3099. TLS1_2_VERSION, TLS1_2_VERSION,
  3100. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3101. SSL_NOT_DEFAULT | SSL_HIGH,
  3102. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3103. 256,
  3104. 256,
  3105. },
  3106. {
  3107. 1,
  3108. TLS1_TXT_PSK_WITH_ARIA_128_GCM_SHA256,
  3109. TLS1_RFC_PSK_WITH_ARIA_128_GCM_SHA256,
  3110. TLS1_CK_PSK_WITH_ARIA_128_GCM_SHA256,
  3111. SSL_kPSK,
  3112. SSL_aPSK,
  3113. SSL_ARIA128GCM,
  3114. SSL_AEAD,
  3115. TLS1_2_VERSION, TLS1_2_VERSION,
  3116. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3117. SSL_NOT_DEFAULT | SSL_HIGH,
  3118. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3119. 128,
  3120. 128,
  3121. },
  3122. {
  3123. 1,
  3124. TLS1_TXT_PSK_WITH_ARIA_256_GCM_SHA384,
  3125. TLS1_RFC_PSK_WITH_ARIA_256_GCM_SHA384,
  3126. TLS1_CK_PSK_WITH_ARIA_256_GCM_SHA384,
  3127. SSL_kPSK,
  3128. SSL_aPSK,
  3129. SSL_ARIA256GCM,
  3130. SSL_AEAD,
  3131. TLS1_2_VERSION, TLS1_2_VERSION,
  3132. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3133. SSL_NOT_DEFAULT | SSL_HIGH,
  3134. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3135. 256,
  3136. 256,
  3137. },
  3138. {
  3139. 1,
  3140. TLS1_TXT_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
  3141. TLS1_RFC_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
  3142. TLS1_CK_DHE_PSK_WITH_ARIA_128_GCM_SHA256,
  3143. SSL_kDHEPSK,
  3144. SSL_aPSK,
  3145. SSL_ARIA128GCM,
  3146. SSL_AEAD,
  3147. TLS1_2_VERSION, TLS1_2_VERSION,
  3148. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3149. SSL_NOT_DEFAULT | SSL_HIGH,
  3150. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3151. 128,
  3152. 128,
  3153. },
  3154. {
  3155. 1,
  3156. TLS1_TXT_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
  3157. TLS1_RFC_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
  3158. TLS1_CK_DHE_PSK_WITH_ARIA_256_GCM_SHA384,
  3159. SSL_kDHEPSK,
  3160. SSL_aPSK,
  3161. SSL_ARIA256GCM,
  3162. SSL_AEAD,
  3163. TLS1_2_VERSION, TLS1_2_VERSION,
  3164. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3165. SSL_NOT_DEFAULT | SSL_HIGH,
  3166. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3167. 256,
  3168. 256,
  3169. },
  3170. {
  3171. 1,
  3172. TLS1_TXT_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
  3173. TLS1_RFC_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
  3174. TLS1_CK_RSA_PSK_WITH_ARIA_128_GCM_SHA256,
  3175. SSL_kRSAPSK,
  3176. SSL_aRSA,
  3177. SSL_ARIA128GCM,
  3178. SSL_AEAD,
  3179. TLS1_2_VERSION, TLS1_2_VERSION,
  3180. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3181. SSL_NOT_DEFAULT | SSL_HIGH,
  3182. SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256,
  3183. 128,
  3184. 128,
  3185. },
  3186. {
  3187. 1,
  3188. TLS1_TXT_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
  3189. TLS1_RFC_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
  3190. TLS1_CK_RSA_PSK_WITH_ARIA_256_GCM_SHA384,
  3191. SSL_kRSAPSK,
  3192. SSL_aRSA,
  3193. SSL_ARIA256GCM,
  3194. SSL_AEAD,
  3195. TLS1_2_VERSION, TLS1_2_VERSION,
  3196. DTLS1_2_VERSION, DTLS1_2_VERSION,
  3197. SSL_NOT_DEFAULT | SSL_HIGH,
  3198. SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384,
  3199. 256,
  3200. 256,
  3201. },
  3202. };
  3203. /*
  3204. * The list of known Signalling Cipher-Suite Value "ciphers", non-valid
  3205. * values stuffed into the ciphers field of the wire protocol for signalling
  3206. * purposes.
  3207. */
  3208. static SSL_CIPHER ssl3_scsvs[] = {
  3209. {
  3210. 0,
  3211. "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
  3212. "TLS_EMPTY_RENEGOTIATION_INFO_SCSV",
  3213. SSL3_CK_SCSV,
  3214. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3215. },
  3216. {
  3217. 0,
  3218. "TLS_FALLBACK_SCSV",
  3219. "TLS_FALLBACK_SCSV",
  3220. SSL3_CK_FALLBACK_SCSV,
  3221. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  3222. },
  3223. };
  3224. static int cipher_compare(const void *a, const void *b)
  3225. {
  3226. const SSL_CIPHER *ap = (const SSL_CIPHER *)a;
  3227. const SSL_CIPHER *bp = (const SSL_CIPHER *)b;
  3228. if (ap->id == bp->id)
  3229. return 0;
  3230. return ap->id < bp->id ? -1 : 1;
  3231. }
  3232. void ssl_sort_cipher_list(void)
  3233. {
  3234. qsort(tls13_ciphers, TLS13_NUM_CIPHERS, sizeof(tls13_ciphers[0]),
  3235. cipher_compare);
  3236. qsort(ssl3_ciphers, SSL3_NUM_CIPHERS, sizeof(ssl3_ciphers[0]),
  3237. cipher_compare);
  3238. qsort(ssl3_scsvs, SSL3_NUM_SCSVS, sizeof(ssl3_scsvs[0]), cipher_compare);
  3239. }
  3240. static int ssl_undefined_function_1(SSL *ssl, unsigned char *r, size_t s,
  3241. const char * t, size_t u,
  3242. const unsigned char * v, size_t w, int x)
  3243. {
  3244. (void)r;
  3245. (void)s;
  3246. (void)t;
  3247. (void)u;
  3248. (void)v;
  3249. (void)w;
  3250. (void)x;
  3251. return ssl_undefined_function(ssl);
  3252. }
  3253. const SSL3_ENC_METHOD SSLv3_enc_data = {
  3254. ssl3_enc,
  3255. n_ssl3_mac,
  3256. ssl3_setup_key_block,
  3257. ssl3_generate_master_secret,
  3258. ssl3_change_cipher_state,
  3259. ssl3_final_finish_mac,
  3260. SSL3_MD_CLIENT_FINISHED_CONST, 4,
  3261. SSL3_MD_SERVER_FINISHED_CONST, 4,
  3262. ssl3_alert_code,
  3263. ssl_undefined_function_1,
  3264. 0,
  3265. ssl3_set_handshake_header,
  3266. tls_close_construct_packet,
  3267. ssl3_handshake_write
  3268. };
  3269. long ssl3_default_timeout(void)
  3270. {
  3271. /*
  3272. * 2 hours, the 24 hours mentioned in the SSLv3 spec is way too long for
  3273. * http, the cache would over fill
  3274. */
  3275. return (60 * 60 * 2);
  3276. }
  3277. int ssl3_num_ciphers(void)
  3278. {
  3279. return SSL3_NUM_CIPHERS;
  3280. }
  3281. const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
  3282. {
  3283. if (u < SSL3_NUM_CIPHERS)
  3284. return &(ssl3_ciphers[SSL3_NUM_CIPHERS - 1 - u]);
  3285. else
  3286. return NULL;
  3287. }
  3288. int ssl3_set_handshake_header(SSL *s, WPACKET *pkt, int htype)
  3289. {
  3290. /* No header in the event of a CCS */
  3291. if (htype == SSL3_MT_CHANGE_CIPHER_SPEC)
  3292. return 1;
  3293. /* Set the content type and 3 bytes for the message len */
  3294. if (!WPACKET_put_bytes_u8(pkt, htype)
  3295. || !WPACKET_start_sub_packet_u24(pkt))
  3296. return 0;
  3297. return 1;
  3298. }
  3299. int ssl3_handshake_write(SSL *s)
  3300. {
  3301. return ssl3_do_write(s, SSL3_RT_HANDSHAKE);
  3302. }
  3303. int ssl3_new(SSL *s)
  3304. {
  3305. #ifndef OPENSSL_NO_SRP
  3306. if (!ssl_srp_ctx_init_intern(s))
  3307. return 0;
  3308. #endif
  3309. if (!s->method->ssl_clear(s))
  3310. return 0;
  3311. return 1;
  3312. }
  3313. void ssl3_free(SSL *s)
  3314. {
  3315. if (s == NULL)
  3316. return;
  3317. ssl3_cleanup_key_block(s);
  3318. EVP_PKEY_free(s->s3.peer_tmp);
  3319. s->s3.peer_tmp = NULL;
  3320. EVP_PKEY_free(s->s3.tmp.pkey);
  3321. s->s3.tmp.pkey = NULL;
  3322. ssl_evp_cipher_free(s->s3.tmp.new_sym_enc);
  3323. ssl_evp_md_free(s->s3.tmp.new_hash);
  3324. OPENSSL_free(s->s3.tmp.ctype);
  3325. sk_X509_NAME_pop_free(s->s3.tmp.peer_ca_names, X509_NAME_free);
  3326. OPENSSL_free(s->s3.tmp.ciphers_raw);
  3327. OPENSSL_clear_free(s->s3.tmp.pms, s->s3.tmp.pmslen);
  3328. OPENSSL_free(s->s3.tmp.peer_sigalgs);
  3329. OPENSSL_free(s->s3.tmp.peer_cert_sigalgs);
  3330. ssl3_free_digest_list(s);
  3331. OPENSSL_free(s->s3.alpn_selected);
  3332. OPENSSL_free(s->s3.alpn_proposed);
  3333. #ifndef OPENSSL_NO_SRP
  3334. ssl_srp_ctx_free_intern(s);
  3335. #endif
  3336. memset(&s->s3, 0, sizeof(s->s3));
  3337. }
  3338. int ssl3_clear(SSL *s)
  3339. {
  3340. ssl3_cleanup_key_block(s);
  3341. OPENSSL_free(s->s3.tmp.ctype);
  3342. sk_X509_NAME_pop_free(s->s3.tmp.peer_ca_names, X509_NAME_free);
  3343. OPENSSL_free(s->s3.tmp.ciphers_raw);
  3344. OPENSSL_clear_free(s->s3.tmp.pms, s->s3.tmp.pmslen);
  3345. OPENSSL_free(s->s3.tmp.peer_sigalgs);
  3346. OPENSSL_free(s->s3.tmp.peer_cert_sigalgs);
  3347. EVP_PKEY_free(s->s3.tmp.pkey);
  3348. EVP_PKEY_free(s->s3.peer_tmp);
  3349. ssl3_free_digest_list(s);
  3350. OPENSSL_free(s->s3.alpn_selected);
  3351. OPENSSL_free(s->s3.alpn_proposed);
  3352. /* NULL/zero-out everything in the s3 struct */
  3353. memset(&s->s3, 0, sizeof(s->s3));
  3354. if (!ssl_free_wbio_buffer(s))
  3355. return 0;
  3356. s->version = SSL3_VERSION;
  3357. #if !defined(OPENSSL_NO_NEXTPROTONEG)
  3358. OPENSSL_free(s->ext.npn);
  3359. s->ext.npn = NULL;
  3360. s->ext.npn_len = 0;
  3361. #endif
  3362. return 1;
  3363. }
  3364. #ifndef OPENSSL_NO_SRP
  3365. static char *srp_password_from_info_cb(SSL *s, void *arg)
  3366. {
  3367. return OPENSSL_strdup(s->srp_ctx.info);
  3368. }
  3369. #endif
  3370. static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len);
  3371. long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
  3372. {
  3373. int ret = 0;
  3374. switch (cmd) {
  3375. case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
  3376. break;
  3377. case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
  3378. ret = s->s3.num_renegotiations;
  3379. break;
  3380. case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
  3381. ret = s->s3.num_renegotiations;
  3382. s->s3.num_renegotiations = 0;
  3383. break;
  3384. case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
  3385. ret = s->s3.total_renegotiations;
  3386. break;
  3387. case SSL_CTRL_GET_FLAGS:
  3388. ret = (int)(s->s3.flags);
  3389. break;
  3390. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3391. case SSL_CTRL_SET_TMP_DH:
  3392. {
  3393. EVP_PKEY *pkdh = NULL;
  3394. if (parg == NULL) {
  3395. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3396. return 0;
  3397. }
  3398. pkdh = ssl_dh_to_pkey(parg);
  3399. if (pkdh == NULL) {
  3400. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3401. return 0;
  3402. }
  3403. if (!SSL_set0_tmp_dh_pkey(s, pkdh)) {
  3404. EVP_PKEY_free(pkdh);
  3405. return 0;
  3406. }
  3407. return 1;
  3408. }
  3409. break;
  3410. case SSL_CTRL_SET_TMP_DH_CB:
  3411. {
  3412. ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3413. return ret;
  3414. }
  3415. #endif
  3416. case SSL_CTRL_SET_DH_AUTO:
  3417. s->cert->dh_tmp_auto = larg;
  3418. return 1;
  3419. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3420. case SSL_CTRL_SET_TMP_ECDH:
  3421. {
  3422. if (parg == NULL) {
  3423. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3424. return 0;
  3425. }
  3426. return ssl_set_tmp_ecdh_groups(&s->ext.supportedgroups,
  3427. &s->ext.supportedgroups_len,
  3428. parg);
  3429. }
  3430. #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  3431. case SSL_CTRL_SET_TLSEXT_HOSTNAME:
  3432. /*
  3433. * This API is only used for a client to set what SNI it will request
  3434. * from the server, but we currently allow it to be used on servers
  3435. * as well, which is a programming error. Currently we just clear
  3436. * the field in SSL_do_handshake() for server SSLs, but when we can
  3437. * make ABI-breaking changes, we may want to make use of this API
  3438. * an error on server SSLs.
  3439. */
  3440. if (larg == TLSEXT_NAMETYPE_host_name) {
  3441. size_t len;
  3442. OPENSSL_free(s->ext.hostname);
  3443. s->ext.hostname = NULL;
  3444. ret = 1;
  3445. if (parg == NULL)
  3446. break;
  3447. len = strlen((char *)parg);
  3448. if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
  3449. ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
  3450. return 0;
  3451. }
  3452. if ((s->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
  3453. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3454. return 0;
  3455. }
  3456. } else {
  3457. ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
  3458. return 0;
  3459. }
  3460. break;
  3461. case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
  3462. s->ext.debug_arg = parg;
  3463. ret = 1;
  3464. break;
  3465. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  3466. ret = s->ext.status_type;
  3467. break;
  3468. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  3469. s->ext.status_type = larg;
  3470. ret = 1;
  3471. break;
  3472. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
  3473. *(STACK_OF(X509_EXTENSION) **)parg = s->ext.ocsp.exts;
  3474. ret = 1;
  3475. break;
  3476. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
  3477. s->ext.ocsp.exts = parg;
  3478. ret = 1;
  3479. break;
  3480. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
  3481. *(STACK_OF(OCSP_RESPID) **)parg = s->ext.ocsp.ids;
  3482. ret = 1;
  3483. break;
  3484. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
  3485. s->ext.ocsp.ids = parg;
  3486. ret = 1;
  3487. break;
  3488. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3489. *(unsigned char **)parg = s->ext.ocsp.resp;
  3490. if (s->ext.ocsp.resp_len == 0
  3491. || s->ext.ocsp.resp_len > LONG_MAX)
  3492. return -1;
  3493. return (long)s->ext.ocsp.resp_len;
  3494. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3495. OPENSSL_free(s->ext.ocsp.resp);
  3496. s->ext.ocsp.resp = parg;
  3497. s->ext.ocsp.resp_len = larg;
  3498. ret = 1;
  3499. break;
  3500. case SSL_CTRL_CHAIN:
  3501. if (larg)
  3502. return ssl_cert_set1_chain(s, NULL, (STACK_OF(X509) *)parg);
  3503. else
  3504. return ssl_cert_set0_chain(s, NULL, (STACK_OF(X509) *)parg);
  3505. case SSL_CTRL_CHAIN_CERT:
  3506. if (larg)
  3507. return ssl_cert_add1_chain_cert(s, NULL, (X509 *)parg);
  3508. else
  3509. return ssl_cert_add0_chain_cert(s, NULL, (X509 *)parg);
  3510. case SSL_CTRL_GET_CHAIN_CERTS:
  3511. *(STACK_OF(X509) **)parg = s->cert->key->chain;
  3512. ret = 1;
  3513. break;
  3514. case SSL_CTRL_SELECT_CURRENT_CERT:
  3515. return ssl_cert_select_current(s->cert, (X509 *)parg);
  3516. case SSL_CTRL_SET_CURRENT_CERT:
  3517. if (larg == SSL_CERT_SET_SERVER) {
  3518. const SSL_CIPHER *cipher;
  3519. if (!s->server)
  3520. return 0;
  3521. cipher = s->s3.tmp.new_cipher;
  3522. if (cipher == NULL)
  3523. return 0;
  3524. /*
  3525. * No certificate for unauthenticated ciphersuites or using SRP
  3526. * authentication
  3527. */
  3528. if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
  3529. return 2;
  3530. if (s->s3.tmp.cert == NULL)
  3531. return 0;
  3532. s->cert->key = s->s3.tmp.cert;
  3533. return 1;
  3534. }
  3535. return ssl_cert_set_current(s->cert, larg);
  3536. case SSL_CTRL_GET_GROUPS:
  3537. {
  3538. uint16_t *clist;
  3539. size_t clistlen;
  3540. if (!s->session)
  3541. return 0;
  3542. clist = s->ext.peer_supportedgroups;
  3543. clistlen = s->ext.peer_supportedgroups_len;
  3544. if (parg) {
  3545. size_t i;
  3546. int *cptr = parg;
  3547. for (i = 0; i < clistlen; i++) {
  3548. uint16_t cid = SSL_IS_TLS13(s)
  3549. ? ssl_group_id_tls13_to_internal(clist[i])
  3550. : clist[i];
  3551. const TLS_GROUP_INFO *cinf
  3552. = tls1_group_id_lookup(s->ctx, cid);
  3553. if (cinf != NULL)
  3554. cptr[i] = tls1_group_id2nid(cinf->group_id, 1);
  3555. else
  3556. cptr[i] = TLSEXT_nid_unknown | clist[i];
  3557. }
  3558. }
  3559. return (int)clistlen;
  3560. }
  3561. case SSL_CTRL_SET_GROUPS:
  3562. return tls1_set_groups(&s->ext.supportedgroups,
  3563. &s->ext.supportedgroups_len, parg, larg);
  3564. case SSL_CTRL_SET_GROUPS_LIST:
  3565. return tls1_set_groups_list(s->ctx, &s->ext.supportedgroups,
  3566. &s->ext.supportedgroups_len, parg);
  3567. case SSL_CTRL_GET_SHARED_GROUP:
  3568. {
  3569. uint16_t id = tls1_shared_group(s, larg);
  3570. if (larg != -1)
  3571. return tls1_group_id2nid(id, 1);
  3572. return id;
  3573. }
  3574. case SSL_CTRL_GET_NEGOTIATED_GROUP:
  3575. {
  3576. unsigned int id;
  3577. if (SSL_IS_TLS13(s) && s->s3.did_kex)
  3578. id = s->s3.group_id;
  3579. else
  3580. id = s->session->kex_group;
  3581. ret = tls1_group_id2nid(id, 1);
  3582. break;
  3583. }
  3584. case SSL_CTRL_SET_SIGALGS:
  3585. return tls1_set_sigalgs(s->cert, parg, larg, 0);
  3586. case SSL_CTRL_SET_SIGALGS_LIST:
  3587. return tls1_set_sigalgs_list(s->cert, parg, 0);
  3588. case SSL_CTRL_SET_CLIENT_SIGALGS:
  3589. return tls1_set_sigalgs(s->cert, parg, larg, 1);
  3590. case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  3591. return tls1_set_sigalgs_list(s->cert, parg, 1);
  3592. case SSL_CTRL_GET_CLIENT_CERT_TYPES:
  3593. {
  3594. const unsigned char **pctype = parg;
  3595. if (s->server || !s->s3.tmp.cert_req)
  3596. return 0;
  3597. if (pctype)
  3598. *pctype = s->s3.tmp.ctype;
  3599. return s->s3.tmp.ctype_len;
  3600. }
  3601. case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  3602. if (!s->server)
  3603. return 0;
  3604. return ssl3_set_req_cert_type(s->cert, parg, larg);
  3605. case SSL_CTRL_BUILD_CERT_CHAIN:
  3606. return ssl_build_cert_chain(s, NULL, larg);
  3607. case SSL_CTRL_SET_VERIFY_CERT_STORE:
  3608. return ssl_cert_set_cert_store(s->cert, parg, 0, larg);
  3609. case SSL_CTRL_SET_CHAIN_CERT_STORE:
  3610. return ssl_cert_set_cert_store(s->cert, parg, 1, larg);
  3611. case SSL_CTRL_GET_VERIFY_CERT_STORE:
  3612. return ssl_cert_get_cert_store(s->cert, parg, 0);
  3613. case SSL_CTRL_GET_CHAIN_CERT_STORE:
  3614. return ssl_cert_get_cert_store(s->cert, parg, 1);
  3615. case SSL_CTRL_GET_PEER_SIGNATURE_NID:
  3616. if (s->s3.tmp.peer_sigalg == NULL)
  3617. return 0;
  3618. *(int *)parg = s->s3.tmp.peer_sigalg->hash;
  3619. return 1;
  3620. case SSL_CTRL_GET_SIGNATURE_NID:
  3621. if (s->s3.tmp.sigalg == NULL)
  3622. return 0;
  3623. *(int *)parg = s->s3.tmp.sigalg->hash;
  3624. return 1;
  3625. case SSL_CTRL_GET_PEER_TMP_KEY:
  3626. if (s->session == NULL || s->s3.peer_tmp == NULL) {
  3627. return 0;
  3628. } else {
  3629. EVP_PKEY_up_ref(s->s3.peer_tmp);
  3630. *(EVP_PKEY **)parg = s->s3.peer_tmp;
  3631. return 1;
  3632. }
  3633. case SSL_CTRL_GET_TMP_KEY:
  3634. if (s->session == NULL || s->s3.tmp.pkey == NULL) {
  3635. return 0;
  3636. } else {
  3637. EVP_PKEY_up_ref(s->s3.tmp.pkey);
  3638. *(EVP_PKEY **)parg = s->s3.tmp.pkey;
  3639. return 1;
  3640. }
  3641. case SSL_CTRL_GET_EC_POINT_FORMATS:
  3642. {
  3643. const unsigned char **pformat = parg;
  3644. if (s->ext.peer_ecpointformats == NULL)
  3645. return 0;
  3646. *pformat = s->ext.peer_ecpointformats;
  3647. return (int)s->ext.peer_ecpointformats_len;
  3648. }
  3649. case SSL_CTRL_GET_IANA_GROUPS:
  3650. {
  3651. if (parg != NULL) {
  3652. *(uint16_t **)parg = (uint16_t *)s->ext.peer_supportedgroups;
  3653. }
  3654. return (int)s->ext.peer_supportedgroups_len;
  3655. }
  3656. default:
  3657. break;
  3658. }
  3659. return ret;
  3660. }
  3661. long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
  3662. {
  3663. int ret = 0;
  3664. switch (cmd) {
  3665. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3666. case SSL_CTRL_SET_TMP_DH_CB:
  3667. s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3668. ret = 1;
  3669. break;
  3670. #endif
  3671. case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
  3672. s->ext.debug_cb = (void (*)(SSL *, int, int,
  3673. const unsigned char *, int, void *))fp;
  3674. ret = 1;
  3675. break;
  3676. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3677. s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3678. ret = 1;
  3679. break;
  3680. default:
  3681. break;
  3682. }
  3683. return ret;
  3684. }
  3685. long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  3686. {
  3687. switch (cmd) {
  3688. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3689. case SSL_CTRL_SET_TMP_DH:
  3690. {
  3691. EVP_PKEY *pkdh = NULL;
  3692. if (parg == NULL) {
  3693. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3694. return 0;
  3695. }
  3696. pkdh = ssl_dh_to_pkey(parg);
  3697. if (pkdh == NULL) {
  3698. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3699. return 0;
  3700. }
  3701. if (!SSL_CTX_set0_tmp_dh_pkey(ctx, pkdh)) {
  3702. EVP_PKEY_free(pkdh);
  3703. return 0;
  3704. }
  3705. return 1;
  3706. }
  3707. case SSL_CTRL_SET_TMP_DH_CB:
  3708. {
  3709. ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3710. return 0;
  3711. }
  3712. #endif
  3713. case SSL_CTRL_SET_DH_AUTO:
  3714. ctx->cert->dh_tmp_auto = larg;
  3715. return 1;
  3716. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3717. case SSL_CTRL_SET_TMP_ECDH:
  3718. {
  3719. if (parg == NULL) {
  3720. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3721. return 0;
  3722. }
  3723. return ssl_set_tmp_ecdh_groups(&ctx->ext.supportedgroups,
  3724. &ctx->ext.supportedgroups_len,
  3725. parg);
  3726. }
  3727. #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  3728. case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
  3729. ctx->ext.servername_arg = parg;
  3730. break;
  3731. case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
  3732. case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
  3733. {
  3734. unsigned char *keys = parg;
  3735. long tick_keylen = (sizeof(ctx->ext.tick_key_name) +
  3736. sizeof(ctx->ext.secure->tick_hmac_key) +
  3737. sizeof(ctx->ext.secure->tick_aes_key));
  3738. if (keys == NULL)
  3739. return tick_keylen;
  3740. if (larg != tick_keylen) {
  3741. ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
  3742. return 0;
  3743. }
  3744. if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
  3745. memcpy(ctx->ext.tick_key_name, keys,
  3746. sizeof(ctx->ext.tick_key_name));
  3747. memcpy(ctx->ext.secure->tick_hmac_key,
  3748. keys + sizeof(ctx->ext.tick_key_name),
  3749. sizeof(ctx->ext.secure->tick_hmac_key));
  3750. memcpy(ctx->ext.secure->tick_aes_key,
  3751. keys + sizeof(ctx->ext.tick_key_name) +
  3752. sizeof(ctx->ext.secure->tick_hmac_key),
  3753. sizeof(ctx->ext.secure->tick_aes_key));
  3754. } else {
  3755. memcpy(keys, ctx->ext.tick_key_name,
  3756. sizeof(ctx->ext.tick_key_name));
  3757. memcpy(keys + sizeof(ctx->ext.tick_key_name),
  3758. ctx->ext.secure->tick_hmac_key,
  3759. sizeof(ctx->ext.secure->tick_hmac_key));
  3760. memcpy(keys + sizeof(ctx->ext.tick_key_name) +
  3761. sizeof(ctx->ext.secure->tick_hmac_key),
  3762. ctx->ext.secure->tick_aes_key,
  3763. sizeof(ctx->ext.secure->tick_aes_key));
  3764. }
  3765. return 1;
  3766. }
  3767. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  3768. return ctx->ext.status_type;
  3769. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  3770. ctx->ext.status_type = larg;
  3771. break;
  3772. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
  3773. ctx->ext.status_arg = parg;
  3774. return 1;
  3775. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
  3776. *(void**)parg = ctx->ext.status_arg;
  3777. break;
  3778. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
  3779. *(int (**)(SSL*, void*))parg = ctx->ext.status_cb;
  3780. break;
  3781. #ifndef OPENSSL_NO_SRP
  3782. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
  3783. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3784. OPENSSL_free(ctx->srp_ctx.login);
  3785. ctx->srp_ctx.login = NULL;
  3786. if (parg == NULL)
  3787. break;
  3788. if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
  3789. ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME);
  3790. return 0;
  3791. }
  3792. if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
  3793. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3794. return 0;
  3795. }
  3796. break;
  3797. case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
  3798. ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
  3799. srp_password_from_info_cb;
  3800. if (ctx->srp_ctx.info != NULL)
  3801. OPENSSL_free(ctx->srp_ctx.info);
  3802. if ((ctx->srp_ctx.info = OPENSSL_strdup((char *)parg)) == NULL) {
  3803. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3804. return 0;
  3805. }
  3806. break;
  3807. case SSL_CTRL_SET_SRP_ARG:
  3808. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3809. ctx->srp_ctx.SRP_cb_arg = parg;
  3810. break;
  3811. case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
  3812. ctx->srp_ctx.strength = larg;
  3813. break;
  3814. #endif
  3815. case SSL_CTRL_SET_GROUPS:
  3816. return tls1_set_groups(&ctx->ext.supportedgroups,
  3817. &ctx->ext.supportedgroups_len,
  3818. parg, larg);
  3819. case SSL_CTRL_SET_GROUPS_LIST:
  3820. return tls1_set_groups_list(ctx, &ctx->ext.supportedgroups,
  3821. &ctx->ext.supportedgroups_len,
  3822. parg);
  3823. case SSL_CTRL_SET_SIGALGS:
  3824. return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
  3825. case SSL_CTRL_SET_SIGALGS_LIST:
  3826. return tls1_set_sigalgs_list(ctx->cert, parg, 0);
  3827. case SSL_CTRL_SET_CLIENT_SIGALGS:
  3828. return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
  3829. case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  3830. return tls1_set_sigalgs_list(ctx->cert, parg, 1);
  3831. case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  3832. return ssl3_set_req_cert_type(ctx->cert, parg, larg);
  3833. case SSL_CTRL_BUILD_CERT_CHAIN:
  3834. return ssl_build_cert_chain(NULL, ctx, larg);
  3835. case SSL_CTRL_SET_VERIFY_CERT_STORE:
  3836. return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
  3837. case SSL_CTRL_SET_CHAIN_CERT_STORE:
  3838. return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
  3839. case SSL_CTRL_GET_VERIFY_CERT_STORE:
  3840. return ssl_cert_get_cert_store(ctx->cert, parg, 0);
  3841. case SSL_CTRL_GET_CHAIN_CERT_STORE:
  3842. return ssl_cert_get_cert_store(ctx->cert, parg, 1);
  3843. /* A Thawte special :-) */
  3844. case SSL_CTRL_EXTRA_CHAIN_CERT:
  3845. if (ctx->extra_certs == NULL) {
  3846. if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
  3847. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3848. return 0;
  3849. }
  3850. }
  3851. if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
  3852. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3853. return 0;
  3854. }
  3855. break;
  3856. case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
  3857. if (ctx->extra_certs == NULL && larg == 0)
  3858. *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
  3859. else
  3860. *(STACK_OF(X509) **)parg = ctx->extra_certs;
  3861. break;
  3862. case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
  3863. OSSL_STACK_OF_X509_free(ctx->extra_certs);
  3864. ctx->extra_certs = NULL;
  3865. break;
  3866. case SSL_CTRL_CHAIN:
  3867. if (larg)
  3868. return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
  3869. else
  3870. return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
  3871. case SSL_CTRL_CHAIN_CERT:
  3872. if (larg)
  3873. return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
  3874. else
  3875. return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
  3876. case SSL_CTRL_GET_CHAIN_CERTS:
  3877. *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
  3878. break;
  3879. case SSL_CTRL_SELECT_CURRENT_CERT:
  3880. return ssl_cert_select_current(ctx->cert, (X509 *)parg);
  3881. case SSL_CTRL_SET_CURRENT_CERT:
  3882. return ssl_cert_set_current(ctx->cert, larg);
  3883. default:
  3884. return 0;
  3885. }
  3886. return 1;
  3887. }
  3888. long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
  3889. {
  3890. switch (cmd) {
  3891. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3892. case SSL_CTRL_SET_TMP_DH_CB:
  3893. {
  3894. ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3895. }
  3896. break;
  3897. #endif
  3898. case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
  3899. ctx->ext.servername_cb = (int (*)(SSL *, int *, void *))fp;
  3900. break;
  3901. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
  3902. ctx->ext.status_cb = (int (*)(SSL *, void *))fp;
  3903. break;
  3904. # ifndef OPENSSL_NO_DEPRECATED_3_0
  3905. case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
  3906. ctx->ext.ticket_key_cb = (int (*)(SSL *, unsigned char *,
  3907. unsigned char *,
  3908. EVP_CIPHER_CTX *,
  3909. HMAC_CTX *, int))fp;
  3910. break;
  3911. #endif
  3912. #ifndef OPENSSL_NO_SRP
  3913. case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
  3914. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3915. ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
  3916. break;
  3917. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
  3918. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3919. ctx->srp_ctx.TLS_ext_srp_username_callback =
  3920. (int (*)(SSL *, int *, void *))fp;
  3921. break;
  3922. case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
  3923. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3924. ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
  3925. (char *(*)(SSL *, void *))fp;
  3926. break;
  3927. #endif
  3928. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3929. {
  3930. ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3931. }
  3932. break;
  3933. default:
  3934. return 0;
  3935. }
  3936. return 1;
  3937. }
  3938. int SSL_CTX_set_tlsext_ticket_key_evp_cb
  3939. (SSL_CTX *ctx, int (*fp)(SSL *, unsigned char *, unsigned char *,
  3940. EVP_CIPHER_CTX *, EVP_MAC_CTX *, int))
  3941. {
  3942. ctx->ext.ticket_key_evp_cb = fp;
  3943. return 1;
  3944. }
  3945. const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
  3946. {
  3947. SSL_CIPHER c;
  3948. const SSL_CIPHER *cp;
  3949. c.id = id;
  3950. cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
  3951. if (cp != NULL)
  3952. return cp;
  3953. cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  3954. if (cp != NULL)
  3955. return cp;
  3956. return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
  3957. }
  3958. const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
  3959. {
  3960. SSL_CIPHER *tbl;
  3961. SSL_CIPHER *alltabs[] = {tls13_ciphers, ssl3_ciphers, ssl3_scsvs};
  3962. size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS,
  3963. SSL3_NUM_SCSVS};
  3964. /* this is not efficient, necessary to optimize this? */
  3965. for (j = 0; j < OSSL_NELEM(alltabs); j++) {
  3966. for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
  3967. if (tbl->stdname == NULL)
  3968. continue;
  3969. if (strcmp(stdname, tbl->stdname) == 0) {
  3970. return tbl;
  3971. }
  3972. }
  3973. }
  3974. return NULL;
  3975. }
  3976. /*
  3977. * This function needs to check if the ciphers required are actually
  3978. * available
  3979. */
  3980. const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
  3981. {
  3982. return ssl3_get_cipher_by_id(SSL3_CK_CIPHERSUITE_FLAG
  3983. | ((uint32_t)p[0] << 8L)
  3984. | (uint32_t)p[1]);
  3985. }
  3986. int ssl3_put_cipher_by_char(const SSL_CIPHER *c, WPACKET *pkt, size_t *len)
  3987. {
  3988. if ((c->id & 0xff000000) != SSL3_CK_CIPHERSUITE_FLAG) {
  3989. *len = 0;
  3990. return 1;
  3991. }
  3992. if (!WPACKET_put_bytes_u16(pkt, c->id & 0xffff))
  3993. return 0;
  3994. *len = 2;
  3995. return 1;
  3996. }
  3997. /*
  3998. * ssl3_choose_cipher - choose a cipher from those offered by the client
  3999. * @s: SSL connection
  4000. * @clnt: ciphers offered by the client
  4001. * @srvr: ciphers enabled on the server?
  4002. *
  4003. * Returns the selected cipher or NULL when no common ciphers.
  4004. */
  4005. const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
  4006. STACK_OF(SSL_CIPHER) *srvr)
  4007. {
  4008. const SSL_CIPHER *c, *ret = NULL;
  4009. STACK_OF(SSL_CIPHER) *prio, *allow;
  4010. int i, ii, ok, prefer_sha256 = 0;
  4011. unsigned long alg_k = 0, alg_a = 0, mask_k = 0, mask_a = 0;
  4012. STACK_OF(SSL_CIPHER) *prio_chacha = NULL;
  4013. /* Let's see which ciphers we can support */
  4014. /*
  4015. * Do not set the compare functions, because this may lead to a
  4016. * reordering by "id". We want to keep the original ordering. We may pay
  4017. * a price in performance during sk_SSL_CIPHER_find(), but would have to
  4018. * pay with the price of sk_SSL_CIPHER_dup().
  4019. */
  4020. OSSL_TRACE_BEGIN(TLS_CIPHER) {
  4021. BIO_printf(trc_out, "Server has %d from %p:\n",
  4022. sk_SSL_CIPHER_num(srvr), (void *)srvr);
  4023. for (i = 0; i < sk_SSL_CIPHER_num(srvr); ++i) {
  4024. c = sk_SSL_CIPHER_value(srvr, i);
  4025. BIO_printf(trc_out, "%p:%s\n", (void *)c, c->name);
  4026. }
  4027. BIO_printf(trc_out, "Client sent %d from %p:\n",
  4028. sk_SSL_CIPHER_num(clnt), (void *)clnt);
  4029. for (i = 0; i < sk_SSL_CIPHER_num(clnt); ++i) {
  4030. c = sk_SSL_CIPHER_value(clnt, i);
  4031. BIO_printf(trc_out, "%p:%s\n", (void *)c, c->name);
  4032. }
  4033. } OSSL_TRACE_END(TLS_CIPHER);
  4034. /* SUITE-B takes precedence over server preference and ChaCha priortiy */
  4035. if (tls1_suiteb(s)) {
  4036. prio = srvr;
  4037. allow = clnt;
  4038. } else if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
  4039. prio = srvr;
  4040. allow = clnt;
  4041. /* If ChaCha20 is at the top of the client preference list,
  4042. and there are ChaCha20 ciphers in the server list, then
  4043. temporarily prioritize all ChaCha20 ciphers in the servers list. */
  4044. if (s->options & SSL_OP_PRIORITIZE_CHACHA && sk_SSL_CIPHER_num(clnt) > 0) {
  4045. c = sk_SSL_CIPHER_value(clnt, 0);
  4046. if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
  4047. /* ChaCha20 is client preferred, check server... */
  4048. int num = sk_SSL_CIPHER_num(srvr);
  4049. int found = 0;
  4050. for (i = 0; i < num; i++) {
  4051. c = sk_SSL_CIPHER_value(srvr, i);
  4052. if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
  4053. found = 1;
  4054. break;
  4055. }
  4056. }
  4057. if (found) {
  4058. prio_chacha = sk_SSL_CIPHER_new_reserve(NULL, num);
  4059. /* if reserve fails, then there's likely a memory issue */
  4060. if (prio_chacha != NULL) {
  4061. /* Put all ChaCha20 at the top, starting with the one we just found */
  4062. sk_SSL_CIPHER_push(prio_chacha, c);
  4063. for (i++; i < num; i++) {
  4064. c = sk_SSL_CIPHER_value(srvr, i);
  4065. if (c->algorithm_enc == SSL_CHACHA20POLY1305)
  4066. sk_SSL_CIPHER_push(prio_chacha, c);
  4067. }
  4068. /* Pull in the rest */
  4069. for (i = 0; i < num; i++) {
  4070. c = sk_SSL_CIPHER_value(srvr, i);
  4071. if (c->algorithm_enc != SSL_CHACHA20POLY1305)
  4072. sk_SSL_CIPHER_push(prio_chacha, c);
  4073. }
  4074. prio = prio_chacha;
  4075. }
  4076. }
  4077. }
  4078. }
  4079. } else {
  4080. prio = clnt;
  4081. allow = srvr;
  4082. }
  4083. if (SSL_IS_TLS13(s)) {
  4084. #ifndef OPENSSL_NO_PSK
  4085. int j;
  4086. /*
  4087. * If we allow "old" style PSK callbacks, and we have no certificate (so
  4088. * we're not going to succeed without a PSK anyway), and we're in
  4089. * TLSv1.3 then the default hash for a PSK is SHA-256 (as per the
  4090. * TLSv1.3 spec). Therefore we should prioritise ciphersuites using
  4091. * that.
  4092. */
  4093. if (s->psk_server_callback != NULL) {
  4094. for (j = 0; j < SSL_PKEY_NUM && !ssl_has_cert(s, j); j++);
  4095. if (j == SSL_PKEY_NUM) {
  4096. /* There are no certificates */
  4097. prefer_sha256 = 1;
  4098. }
  4099. }
  4100. #endif
  4101. } else {
  4102. tls1_set_cert_validity(s);
  4103. ssl_set_masks(s);
  4104. }
  4105. for (i = 0; i < sk_SSL_CIPHER_num(prio); i++) {
  4106. c = sk_SSL_CIPHER_value(prio, i);
  4107. /* Skip ciphers not supported by the protocol version */
  4108. if (!SSL_IS_DTLS(s) &&
  4109. ((s->version < c->min_tls) || (s->version > c->max_tls)))
  4110. continue;
  4111. if (SSL_IS_DTLS(s) &&
  4112. (DTLS_VERSION_LT(s->version, c->min_dtls) ||
  4113. DTLS_VERSION_GT(s->version, c->max_dtls)))
  4114. continue;
  4115. /*
  4116. * Since TLS 1.3 ciphersuites can be used with any auth or
  4117. * key exchange scheme skip tests.
  4118. */
  4119. if (!SSL_IS_TLS13(s)) {
  4120. mask_k = s->s3.tmp.mask_k;
  4121. mask_a = s->s3.tmp.mask_a;
  4122. #ifndef OPENSSL_NO_SRP
  4123. if (s->srp_ctx.srp_Mask & SSL_kSRP) {
  4124. mask_k |= SSL_kSRP;
  4125. mask_a |= SSL_aSRP;
  4126. }
  4127. #endif
  4128. alg_k = c->algorithm_mkey;
  4129. alg_a = c->algorithm_auth;
  4130. #ifndef OPENSSL_NO_PSK
  4131. /* with PSK there must be server callback set */
  4132. if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
  4133. continue;
  4134. #endif /* OPENSSL_NO_PSK */
  4135. ok = (alg_k & mask_k) && (alg_a & mask_a);
  4136. OSSL_TRACE7(TLS_CIPHER,
  4137. "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",
  4138. ok, alg_k, alg_a, mask_k, mask_a, (void *)c, c->name);
  4139. /*
  4140. * if we are considering an ECC cipher suite that uses an ephemeral
  4141. * EC key check it
  4142. */
  4143. if (alg_k & SSL_kECDHE)
  4144. ok = ok && tls1_check_ec_tmp_key(s, c->id);
  4145. if (!ok)
  4146. continue;
  4147. }
  4148. ii = sk_SSL_CIPHER_find(allow, c);
  4149. if (ii >= 0) {
  4150. /* Check security callback permits this cipher */
  4151. if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
  4152. c->strength_bits, 0, (void *)c))
  4153. continue;
  4154. if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
  4155. && s->s3.is_probably_safari) {
  4156. if (!ret)
  4157. ret = sk_SSL_CIPHER_value(allow, ii);
  4158. continue;
  4159. }
  4160. if (prefer_sha256) {
  4161. const SSL_CIPHER *tmp = sk_SSL_CIPHER_value(allow, ii);
  4162. const EVP_MD *md = ssl_md(s->ctx, tmp->algorithm2);
  4163. if (md != NULL
  4164. && EVP_MD_is_a(md, OSSL_DIGEST_NAME_SHA2_256)) {
  4165. ret = tmp;
  4166. break;
  4167. }
  4168. if (ret == NULL)
  4169. ret = tmp;
  4170. continue;
  4171. }
  4172. ret = sk_SSL_CIPHER_value(allow, ii);
  4173. break;
  4174. }
  4175. }
  4176. sk_SSL_CIPHER_free(prio_chacha);
  4177. return ret;
  4178. }
  4179. int ssl3_get_req_cert_type(SSL *s, WPACKET *pkt)
  4180. {
  4181. uint32_t alg_k, alg_a = 0;
  4182. /* If we have custom certificate types set, use them */
  4183. if (s->cert->ctype)
  4184. return WPACKET_memcpy(pkt, s->cert->ctype, s->cert->ctype_len);
  4185. /* Get mask of algorithms disabled by signature list */
  4186. ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);
  4187. alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
  4188. #ifndef OPENSSL_NO_GOST
  4189. if (s->version >= TLS1_VERSION && (alg_k & SSL_kGOST))
  4190. if (!WPACKET_put_bytes_u8(pkt, TLS_CT_GOST01_SIGN)
  4191. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_SIGN)
  4192. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_512_SIGN)
  4193. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_LEGACY_SIGN)
  4194. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_LEGACY_512_SIGN))
  4195. return 0;
  4196. if (s->version >= TLS1_2_VERSION && (alg_k & SSL_kGOST18))
  4197. if (!WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_SIGN)
  4198. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_512_SIGN))
  4199. return 0;
  4200. #endif
  4201. if ((s->version == SSL3_VERSION) && (alg_k & SSL_kDHE)) {
  4202. if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_EPHEMERAL_DH))
  4203. return 0;
  4204. if (!(alg_a & SSL_aDSS)
  4205. && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_EPHEMERAL_DH))
  4206. return 0;
  4207. }
  4208. if (!(alg_a & SSL_aRSA) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_SIGN))
  4209. return 0;
  4210. if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN))
  4211. return 0;
  4212. /*
  4213. * ECDSA certs can be used with RSA cipher suites too so we don't
  4214. * need to check for SSL_kECDH or SSL_kECDHE
  4215. */
  4216. if (s->version >= TLS1_VERSION
  4217. && !(alg_a & SSL_aECDSA)
  4218. && !WPACKET_put_bytes_u8(pkt, TLS_CT_ECDSA_SIGN))
  4219. return 0;
  4220. return 1;
  4221. }
  4222. static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
  4223. {
  4224. OPENSSL_free(c->ctype);
  4225. c->ctype = NULL;
  4226. c->ctype_len = 0;
  4227. if (p == NULL || len == 0)
  4228. return 1;
  4229. if (len > 0xff)
  4230. return 0;
  4231. c->ctype = OPENSSL_memdup(p, len);
  4232. if (c->ctype == NULL)
  4233. return 0;
  4234. c->ctype_len = len;
  4235. return 1;
  4236. }
  4237. int ssl3_shutdown(SSL *s)
  4238. {
  4239. int ret;
  4240. /*
  4241. * Don't do anything much if we have not done the handshake or we don't
  4242. * want to send messages :-)
  4243. */
  4244. if (s->quiet_shutdown || SSL_in_before(s)) {
  4245. s->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
  4246. return 1;
  4247. }
  4248. if (!(s->shutdown & SSL_SENT_SHUTDOWN)) {
  4249. s->shutdown |= SSL_SENT_SHUTDOWN;
  4250. ssl3_send_alert(s, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
  4251. /*
  4252. * our shutdown alert has been sent now, and if it still needs to be
  4253. * written, s->s3.alert_dispatch will be true
  4254. */
  4255. if (s->s3.alert_dispatch)
  4256. return -1; /* return WANT_WRITE */
  4257. } else if (s->s3.alert_dispatch) {
  4258. /* resend it if not sent */
  4259. ret = s->method->ssl_dispatch_alert(s);
  4260. if (ret == -1) {
  4261. /*
  4262. * we only get to return -1 here the 2nd/Nth invocation, we must
  4263. * have already signalled return 0 upon a previous invocation,
  4264. * return WANT_WRITE
  4265. */
  4266. return ret;
  4267. }
  4268. } else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
  4269. size_t readbytes;
  4270. /*
  4271. * If we are waiting for a close from our peer, we are closed
  4272. */
  4273. s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0, &readbytes);
  4274. if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) {
  4275. return -1; /* return WANT_READ */
  4276. }
  4277. }
  4278. if ((s->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
  4279. !s->s3.alert_dispatch)
  4280. return 1;
  4281. else
  4282. return 0;
  4283. }
  4284. int ssl3_write(SSL *s, const void *buf, size_t len, size_t *written)
  4285. {
  4286. clear_sys_error();
  4287. if (s->s3.renegotiate)
  4288. ssl3_renegotiate_check(s, 0);
  4289. return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len,
  4290. written);
  4291. }
  4292. static int ssl3_read_internal(SSL *s, void *buf, size_t len, int peek,
  4293. size_t *readbytes)
  4294. {
  4295. int ret;
  4296. clear_sys_error();
  4297. if (s->s3.renegotiate)
  4298. ssl3_renegotiate_check(s, 0);
  4299. s->s3.in_read_app_data = 1;
  4300. ret =
  4301. s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
  4302. peek, readbytes);
  4303. if ((ret == -1) && (s->s3.in_read_app_data == 2)) {
  4304. /*
  4305. * ssl3_read_bytes decided to call s->handshake_func, which called
  4306. * ssl3_read_bytes to read handshake data. However, ssl3_read_bytes
  4307. * actually found application data and thinks that application data
  4308. * makes sense here; so disable handshake processing and try to read
  4309. * application data again.
  4310. */
  4311. ossl_statem_set_in_handshake(s, 1);
  4312. ret =
  4313. s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
  4314. len, peek, readbytes);
  4315. ossl_statem_set_in_handshake(s, 0);
  4316. } else
  4317. s->s3.in_read_app_data = 0;
  4318. return ret;
  4319. }
  4320. int ssl3_read(SSL *s, void *buf, size_t len, size_t *readbytes)
  4321. {
  4322. return ssl3_read_internal(s, buf, len, 0, readbytes);
  4323. }
  4324. int ssl3_peek(SSL *s, void *buf, size_t len, size_t *readbytes)
  4325. {
  4326. return ssl3_read_internal(s, buf, len, 1, readbytes);
  4327. }
  4328. int ssl3_renegotiate(SSL *s)
  4329. {
  4330. if (s->handshake_func == NULL)
  4331. return 1;
  4332. s->s3.renegotiate = 1;
  4333. return 1;
  4334. }
  4335. /*
  4336. * Check if we are waiting to do a renegotiation and if so whether now is a
  4337. * good time to do it. If |initok| is true then we are being called from inside
  4338. * the state machine so ignore the result of SSL_in_init(s). Otherwise we
  4339. * should not do a renegotiation if SSL_in_init(s) is true. Returns 1 if we
  4340. * should do a renegotiation now and sets up the state machine for it. Otherwise
  4341. * returns 0.
  4342. */
  4343. int ssl3_renegotiate_check(SSL *s, int initok)
  4344. {
  4345. int ret = 0;
  4346. if (s->s3.renegotiate) {
  4347. if (!RECORD_LAYER_read_pending(&s->rlayer)
  4348. && !RECORD_LAYER_write_pending(&s->rlayer)
  4349. && (initok || !SSL_in_init(s))) {
  4350. /*
  4351. * if we are the server, and we have sent a 'RENEGOTIATE'
  4352. * message, we need to set the state machine into the renegotiate
  4353. * state.
  4354. */
  4355. ossl_statem_set_renegotiate(s);
  4356. s->s3.renegotiate = 0;
  4357. s->s3.num_renegotiations++;
  4358. s->s3.total_renegotiations++;
  4359. ret = 1;
  4360. }
  4361. }
  4362. return ret;
  4363. }
  4364. /*
  4365. * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
  4366. * handshake macs if required.
  4367. *
  4368. * If PSK and using SHA384 for TLS < 1.2 switch to default.
  4369. */
  4370. long ssl_get_algorithm2(SSL *s)
  4371. {
  4372. long alg2;
  4373. if (s->s3.tmp.new_cipher == NULL)
  4374. return -1;
  4375. alg2 = s->s3.tmp.new_cipher->algorithm2;
  4376. if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
  4377. if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
  4378. return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
  4379. } else if (s->s3.tmp.new_cipher->algorithm_mkey & SSL_PSK) {
  4380. if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384))
  4381. return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF;
  4382. }
  4383. return alg2;
  4384. }
  4385. /*
  4386. * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
  4387. * failure, 1 on success.
  4388. */
  4389. int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, size_t len,
  4390. DOWNGRADE dgrd)
  4391. {
  4392. int send_time = 0, ret;
  4393. if (len < 4)
  4394. return 0;
  4395. if (server)
  4396. send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
  4397. else
  4398. send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
  4399. if (send_time) {
  4400. unsigned long Time = (unsigned long)time(NULL);
  4401. unsigned char *p = result;
  4402. l2n(Time, p);
  4403. ret = RAND_bytes_ex(s->ctx->libctx, p, len - 4, 0);
  4404. } else {
  4405. ret = RAND_bytes_ex(s->ctx->libctx, result, len, 0);
  4406. }
  4407. if (ret > 0) {
  4408. if (!ossl_assert(sizeof(tls11downgrade) < len)
  4409. || !ossl_assert(sizeof(tls12downgrade) < len))
  4410. return 0;
  4411. if (dgrd == DOWNGRADE_TO_1_2)
  4412. memcpy(result + len - sizeof(tls12downgrade), tls12downgrade,
  4413. sizeof(tls12downgrade));
  4414. else if (dgrd == DOWNGRADE_TO_1_1)
  4415. memcpy(result + len - sizeof(tls11downgrade), tls11downgrade,
  4416. sizeof(tls11downgrade));
  4417. }
  4418. return ret;
  4419. }
  4420. int ssl_generate_master_secret(SSL *s, unsigned char *pms, size_t pmslen,
  4421. int free_pms)
  4422. {
  4423. unsigned long alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
  4424. int ret = 0;
  4425. if (alg_k & SSL_PSK) {
  4426. #ifndef OPENSSL_NO_PSK
  4427. unsigned char *pskpms, *t;
  4428. size_t psklen = s->s3.tmp.psklen;
  4429. size_t pskpmslen;
  4430. /* create PSK premaster_secret */
  4431. /* For plain PSK "other_secret" is psklen zeroes */
  4432. if (alg_k & SSL_kPSK)
  4433. pmslen = psklen;
  4434. pskpmslen = 4 + pmslen + psklen;
  4435. pskpms = OPENSSL_malloc(pskpmslen);
  4436. if (pskpms == NULL)
  4437. goto err;
  4438. t = pskpms;
  4439. s2n(pmslen, t);
  4440. if (alg_k & SSL_kPSK)
  4441. memset(t, 0, pmslen);
  4442. else
  4443. memcpy(t, pms, pmslen);
  4444. t += pmslen;
  4445. s2n(psklen, t);
  4446. memcpy(t, s->s3.tmp.psk, psklen);
  4447. OPENSSL_clear_free(s->s3.tmp.psk, psklen);
  4448. s->s3.tmp.psk = NULL;
  4449. s->s3.tmp.psklen = 0;
  4450. if (!s->method->ssl3_enc->generate_master_secret(s,
  4451. s->session->master_key, pskpms, pskpmslen,
  4452. &s->session->master_key_length)) {
  4453. OPENSSL_clear_free(pskpms, pskpmslen);
  4454. /* SSLfatal() already called */
  4455. goto err;
  4456. }
  4457. OPENSSL_clear_free(pskpms, pskpmslen);
  4458. #else
  4459. /* Should never happen */
  4460. goto err;
  4461. #endif
  4462. } else {
  4463. if (!s->method->ssl3_enc->generate_master_secret(s,
  4464. s->session->master_key, pms, pmslen,
  4465. &s->session->master_key_length)) {
  4466. /* SSLfatal() already called */
  4467. goto err;
  4468. }
  4469. }
  4470. ret = 1;
  4471. err:
  4472. if (pms) {
  4473. if (free_pms)
  4474. OPENSSL_clear_free(pms, pmslen);
  4475. else
  4476. OPENSSL_cleanse(pms, pmslen);
  4477. }
  4478. if (s->server == 0) {
  4479. s->s3.tmp.pms = NULL;
  4480. s->s3.tmp.pmslen = 0;
  4481. }
  4482. return ret;
  4483. }
  4484. /* Generate a private key from parameters */
  4485. EVP_PKEY *ssl_generate_pkey(SSL *s, EVP_PKEY *pm)
  4486. {
  4487. EVP_PKEY_CTX *pctx = NULL;
  4488. EVP_PKEY *pkey = NULL;
  4489. if (pm == NULL)
  4490. return NULL;
  4491. pctx = EVP_PKEY_CTX_new_from_pkey(s->ctx->libctx, pm, s->ctx->propq);
  4492. if (pctx == NULL)
  4493. goto err;
  4494. if (EVP_PKEY_keygen_init(pctx) <= 0)
  4495. goto err;
  4496. if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
  4497. EVP_PKEY_free(pkey);
  4498. pkey = NULL;
  4499. }
  4500. err:
  4501. EVP_PKEY_CTX_free(pctx);
  4502. return pkey;
  4503. }
  4504. /* Generate a private key from a group ID */
  4505. EVP_PKEY *ssl_generate_pkey_group(SSL *s, uint16_t id)
  4506. {
  4507. const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(s->ctx, id);
  4508. EVP_PKEY_CTX *pctx = NULL;
  4509. EVP_PKEY *pkey = NULL;
  4510. if (ginf == NULL) {
  4511. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4512. goto err;
  4513. }
  4514. pctx = EVP_PKEY_CTX_new_from_name(s->ctx->libctx, ginf->algorithm,
  4515. s->ctx->propq);
  4516. if (pctx == NULL) {
  4517. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4518. goto err;
  4519. }
  4520. if (EVP_PKEY_keygen_init(pctx) <= 0) {
  4521. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4522. goto err;
  4523. }
  4524. if (EVP_PKEY_CTX_set_group_name(pctx, ginf->realname) <= 0) {
  4525. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4526. goto err;
  4527. }
  4528. if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
  4529. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4530. EVP_PKEY_free(pkey);
  4531. pkey = NULL;
  4532. }
  4533. err:
  4534. EVP_PKEY_CTX_free(pctx);
  4535. return pkey;
  4536. }
  4537. /*
  4538. * Generate parameters from a group ID
  4539. */
  4540. EVP_PKEY *ssl_generate_param_group(SSL *s, uint16_t id)
  4541. {
  4542. EVP_PKEY_CTX *pctx = NULL;
  4543. EVP_PKEY *pkey = NULL;
  4544. const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(s->ctx, id);
  4545. if (ginf == NULL)
  4546. goto err;
  4547. pctx = EVP_PKEY_CTX_new_from_name(s->ctx->libctx, ginf->algorithm,
  4548. s->ctx->propq);
  4549. if (pctx == NULL)
  4550. goto err;
  4551. if (EVP_PKEY_paramgen_init(pctx) <= 0)
  4552. goto err;
  4553. if (EVP_PKEY_CTX_set_group_name(pctx, ginf->realname) <= 0) {
  4554. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4555. goto err;
  4556. }
  4557. if (EVP_PKEY_paramgen(pctx, &pkey) <= 0) {
  4558. EVP_PKEY_free(pkey);
  4559. pkey = NULL;
  4560. }
  4561. err:
  4562. EVP_PKEY_CTX_free(pctx);
  4563. return pkey;
  4564. }
  4565. /* Generate secrets from pms */
  4566. int ssl_gensecret(SSL *s, unsigned char *pms, size_t pmslen)
  4567. {
  4568. int rv = 0;
  4569. /* SSLfatal() called as appropriate in the below functions */
  4570. if (SSL_IS_TLS13(s)) {
  4571. /*
  4572. * If we are resuming then we already generated the early secret
  4573. * when we created the ClientHello, so don't recreate it.
  4574. */
  4575. if (!s->hit)
  4576. rv = tls13_generate_secret(s, ssl_handshake_md(s), NULL, NULL,
  4577. 0,
  4578. (unsigned char *)&s->early_secret);
  4579. else
  4580. rv = 1;
  4581. rv = rv && tls13_generate_handshake_secret(s, pms, pmslen);
  4582. } else {
  4583. rv = ssl_generate_master_secret(s, pms, pmslen, 0);
  4584. }
  4585. return rv;
  4586. }
  4587. /* Derive secrets for ECDH/DH */
  4588. int ssl_derive(SSL *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gensecret)
  4589. {
  4590. int rv = 0;
  4591. unsigned char *pms = NULL;
  4592. size_t pmslen = 0;
  4593. EVP_PKEY_CTX *pctx;
  4594. if (privkey == NULL || pubkey == NULL) {
  4595. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4596. return 0;
  4597. }
  4598. pctx = EVP_PKEY_CTX_new_from_pkey(s->ctx->libctx, privkey, s->ctx->propq);
  4599. if (EVP_PKEY_derive_init(pctx) <= 0
  4600. || EVP_PKEY_derive_set_peer(pctx, pubkey) <= 0
  4601. || EVP_PKEY_derive(pctx, NULL, &pmslen) <= 0) {
  4602. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4603. goto err;
  4604. }
  4605. if (SSL_IS_TLS13(s) && EVP_PKEY_is_a(privkey, "DH"))
  4606. EVP_PKEY_CTX_set_dh_pad(pctx, 1);
  4607. pms = OPENSSL_malloc(pmslen);
  4608. if (pms == NULL) {
  4609. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4610. goto err;
  4611. }
  4612. if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0) {
  4613. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4614. goto err;
  4615. }
  4616. if (gensecret) {
  4617. /* SSLfatal() called as appropriate in the below functions */
  4618. rv = ssl_gensecret(s, pms, pmslen);
  4619. } else {
  4620. /* Save premaster secret */
  4621. s->s3.tmp.pms = pms;
  4622. s->s3.tmp.pmslen = pmslen;
  4623. pms = NULL;
  4624. rv = 1;
  4625. }
  4626. err:
  4627. OPENSSL_clear_free(pms, pmslen);
  4628. EVP_PKEY_CTX_free(pctx);
  4629. return rv;
  4630. }
  4631. /* Decapsulate secrets for KEM */
  4632. int ssl_decapsulate(SSL *s, EVP_PKEY *privkey,
  4633. const unsigned char *ct, size_t ctlen,
  4634. int gensecret)
  4635. {
  4636. int rv = 0;
  4637. unsigned char *pms = NULL;
  4638. size_t pmslen = 0;
  4639. EVP_PKEY_CTX *pctx;
  4640. if (privkey == NULL) {
  4641. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4642. return 0;
  4643. }
  4644. pctx = EVP_PKEY_CTX_new_from_pkey(s->ctx->libctx, privkey, s->ctx->propq);
  4645. if (EVP_PKEY_decapsulate_init(pctx, NULL) <= 0
  4646. || EVP_PKEY_decapsulate(pctx, NULL, &pmslen, ct, ctlen) <= 0) {
  4647. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4648. goto err;
  4649. }
  4650. pms = OPENSSL_malloc(pmslen);
  4651. if (pms == NULL) {
  4652. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4653. goto err;
  4654. }
  4655. if (EVP_PKEY_decapsulate(pctx, pms, &pmslen, ct, ctlen) <= 0) {
  4656. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4657. goto err;
  4658. }
  4659. if (gensecret) {
  4660. /* SSLfatal() called as appropriate in the below functions */
  4661. rv = ssl_gensecret(s, pms, pmslen);
  4662. } else {
  4663. /* Save premaster secret */
  4664. s->s3.tmp.pms = pms;
  4665. s->s3.tmp.pmslen = pmslen;
  4666. pms = NULL;
  4667. rv = 1;
  4668. }
  4669. err:
  4670. OPENSSL_clear_free(pms, pmslen);
  4671. EVP_PKEY_CTX_free(pctx);
  4672. return rv;
  4673. }
  4674. int ssl_encapsulate(SSL *s, EVP_PKEY *pubkey,
  4675. unsigned char **ctp, size_t *ctlenp,
  4676. int gensecret)
  4677. {
  4678. int rv = 0;
  4679. unsigned char *pms = NULL, *ct = NULL;
  4680. size_t pmslen = 0, ctlen = 0;
  4681. EVP_PKEY_CTX *pctx;
  4682. if (pubkey == NULL) {
  4683. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4684. return 0;
  4685. }
  4686. pctx = EVP_PKEY_CTX_new_from_pkey(s->ctx->libctx, pubkey, s->ctx->propq);
  4687. if (EVP_PKEY_encapsulate_init(pctx, NULL) <= 0
  4688. || EVP_PKEY_encapsulate(pctx, NULL, &ctlen, NULL, &pmslen) <= 0
  4689. || pmslen == 0 || ctlen == 0) {
  4690. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4691. goto err;
  4692. }
  4693. pms = OPENSSL_malloc(pmslen);
  4694. ct = OPENSSL_malloc(ctlen);
  4695. if (pms == NULL || ct == NULL) {
  4696. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4697. goto err;
  4698. }
  4699. if (EVP_PKEY_encapsulate(pctx, ct, &ctlen, pms, &pmslen) <= 0) {
  4700. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4701. goto err;
  4702. }
  4703. if (gensecret) {
  4704. /* SSLfatal() called as appropriate in the below functions */
  4705. rv = ssl_gensecret(s, pms, pmslen);
  4706. } else {
  4707. /* Save premaster secret */
  4708. s->s3.tmp.pms = pms;
  4709. s->s3.tmp.pmslen = pmslen;
  4710. pms = NULL;
  4711. rv = 1;
  4712. }
  4713. if (rv > 0) {
  4714. /* Pass ownership of ct to caller */
  4715. *ctp = ct;
  4716. *ctlenp = ctlen;
  4717. ct = NULL;
  4718. }
  4719. err:
  4720. OPENSSL_clear_free(pms, pmslen);
  4721. OPENSSL_free(ct);
  4722. EVP_PKEY_CTX_free(pctx);
  4723. return rv;
  4724. }
  4725. const char *SSL_group_to_name(SSL *s, int nid) {
  4726. int group_id = 0;
  4727. const TLS_GROUP_INFO *cinf = NULL;
  4728. /* first convert to real group id for internal and external IDs */
  4729. if (nid & TLSEXT_nid_unknown)
  4730. group_id = nid & 0xFFFF;
  4731. else
  4732. group_id = tls1_nid2group_id(nid);
  4733. /* then look up */
  4734. cinf = tls1_group_id_lookup(s->ctx, group_id);
  4735. if (cinf != NULL)
  4736. return cinf->tlsname;
  4737. return NULL;
  4738. }