s3_lib.c 131 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036
  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 sslcon_undefined_function_1(SSL_CONNECTION *sc, unsigned char *r,
  3241. size_t s, 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_CONNECTION_GET_SSL(sc));
  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. sslcon_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_CONNECTION *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_CONNECTION *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. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3307. if (sc == NULL)
  3308. return 0;
  3309. if (!ssl_srp_ctx_init_intern(sc))
  3310. return 0;
  3311. #endif
  3312. if (!s->method->ssl_clear(s))
  3313. return 0;
  3314. return 1;
  3315. }
  3316. void ssl3_free(SSL *s)
  3317. {
  3318. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3319. if (sc == NULL)
  3320. return;
  3321. ssl3_cleanup_key_block(sc);
  3322. EVP_PKEY_free(sc->s3.peer_tmp);
  3323. sc->s3.peer_tmp = NULL;
  3324. EVP_PKEY_free(sc->s3.tmp.pkey);
  3325. sc->s3.tmp.pkey = NULL;
  3326. ssl_evp_cipher_free(sc->s3.tmp.new_sym_enc);
  3327. ssl_evp_md_free(sc->s3.tmp.new_hash);
  3328. OPENSSL_free(sc->s3.tmp.ctype);
  3329. sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free);
  3330. OPENSSL_free(sc->s3.tmp.ciphers_raw);
  3331. OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen);
  3332. OPENSSL_free(sc->s3.tmp.peer_sigalgs);
  3333. OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
  3334. ssl3_free_digest_list(sc);
  3335. OPENSSL_free(sc->s3.alpn_selected);
  3336. OPENSSL_free(sc->s3.alpn_proposed);
  3337. #ifndef OPENSSL_NO_SRP
  3338. ssl_srp_ctx_free_intern(sc);
  3339. #endif
  3340. memset(&sc->s3, 0, sizeof(sc->s3));
  3341. }
  3342. int ssl3_clear(SSL *s)
  3343. {
  3344. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3345. if (sc == NULL)
  3346. return 0;
  3347. ssl3_cleanup_key_block(sc);
  3348. OPENSSL_free(sc->s3.tmp.ctype);
  3349. sk_X509_NAME_pop_free(sc->s3.tmp.peer_ca_names, X509_NAME_free);
  3350. OPENSSL_free(sc->s3.tmp.ciphers_raw);
  3351. OPENSSL_clear_free(sc->s3.tmp.pms, sc->s3.tmp.pmslen);
  3352. OPENSSL_free(sc->s3.tmp.peer_sigalgs);
  3353. OPENSSL_free(sc->s3.tmp.peer_cert_sigalgs);
  3354. EVP_PKEY_free(sc->s3.tmp.pkey);
  3355. EVP_PKEY_free(sc->s3.peer_tmp);
  3356. ssl3_free_digest_list(sc);
  3357. OPENSSL_free(sc->s3.alpn_selected);
  3358. OPENSSL_free(sc->s3.alpn_proposed);
  3359. /* NULL/zero-out everything in the s3 struct */
  3360. memset(&sc->s3, 0, sizeof(sc->s3));
  3361. if (!ssl_free_wbio_buffer(sc))
  3362. return 0;
  3363. sc->version = SSL3_VERSION;
  3364. #if !defined(OPENSSL_NO_NEXTPROTONEG)
  3365. OPENSSL_free(sc->ext.npn);
  3366. sc->ext.npn = NULL;
  3367. sc->ext.npn_len = 0;
  3368. #endif
  3369. return 1;
  3370. }
  3371. #ifndef OPENSSL_NO_SRP
  3372. static char *srp_password_from_info_cb(SSL *s, void *arg)
  3373. {
  3374. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3375. if (sc == NULL)
  3376. return NULL;
  3377. return OPENSSL_strdup(sc->srp_ctx.info);
  3378. }
  3379. #endif
  3380. static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len);
  3381. long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
  3382. {
  3383. int ret = 0;
  3384. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3385. if (sc == NULL)
  3386. return ret;
  3387. switch (cmd) {
  3388. case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
  3389. break;
  3390. case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
  3391. ret = sc->s3.num_renegotiations;
  3392. break;
  3393. case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
  3394. ret = sc->s3.num_renegotiations;
  3395. sc->s3.num_renegotiations = 0;
  3396. break;
  3397. case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
  3398. ret = sc->s3.total_renegotiations;
  3399. break;
  3400. case SSL_CTRL_GET_FLAGS:
  3401. ret = (int)(sc->s3.flags);
  3402. break;
  3403. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3404. case SSL_CTRL_SET_TMP_DH:
  3405. {
  3406. EVP_PKEY *pkdh = NULL;
  3407. if (parg == NULL) {
  3408. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3409. return 0;
  3410. }
  3411. pkdh = ssl_dh_to_pkey(parg);
  3412. if (pkdh == NULL) {
  3413. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3414. return 0;
  3415. }
  3416. if (!SSL_set0_tmp_dh_pkey(s, pkdh)) {
  3417. EVP_PKEY_free(pkdh);
  3418. return 0;
  3419. }
  3420. return 1;
  3421. }
  3422. break;
  3423. case SSL_CTRL_SET_TMP_DH_CB:
  3424. {
  3425. ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3426. return ret;
  3427. }
  3428. #endif
  3429. case SSL_CTRL_SET_DH_AUTO:
  3430. sc->cert->dh_tmp_auto = larg;
  3431. return 1;
  3432. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3433. case SSL_CTRL_SET_TMP_ECDH:
  3434. {
  3435. if (parg == NULL) {
  3436. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3437. return 0;
  3438. }
  3439. return ssl_set_tmp_ecdh_groups(&sc->ext.supportedgroups,
  3440. &sc->ext.supportedgroups_len,
  3441. parg);
  3442. }
  3443. #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  3444. case SSL_CTRL_SET_TLSEXT_HOSTNAME:
  3445. /*
  3446. * This API is only used for a client to set what SNI it will request
  3447. * from the server, but we currently allow it to be used on servers
  3448. * as well, which is a programming error. Currently we just clear
  3449. * the field in SSL_do_handshake() for server SSLs, but when we can
  3450. * make ABI-breaking changes, we may want to make use of this API
  3451. * an error on server SSLs.
  3452. */
  3453. if (larg == TLSEXT_NAMETYPE_host_name) {
  3454. size_t len;
  3455. OPENSSL_free(sc->ext.hostname);
  3456. sc->ext.hostname = NULL;
  3457. ret = 1;
  3458. if (parg == NULL)
  3459. break;
  3460. len = strlen((char *)parg);
  3461. if (len == 0 || len > TLSEXT_MAXLEN_host_name) {
  3462. ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
  3463. return 0;
  3464. }
  3465. if ((sc->ext.hostname = OPENSSL_strdup((char *)parg)) == NULL) {
  3466. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3467. return 0;
  3468. }
  3469. } else {
  3470. ERR_raise(ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
  3471. return 0;
  3472. }
  3473. break;
  3474. case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
  3475. sc->ext.debug_arg = parg;
  3476. ret = 1;
  3477. break;
  3478. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  3479. ret = sc->ext.status_type;
  3480. break;
  3481. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  3482. sc->ext.status_type = larg;
  3483. ret = 1;
  3484. break;
  3485. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
  3486. *(STACK_OF(X509_EXTENSION) **)parg = sc->ext.ocsp.exts;
  3487. ret = 1;
  3488. break;
  3489. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
  3490. sc->ext.ocsp.exts = parg;
  3491. ret = 1;
  3492. break;
  3493. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
  3494. *(STACK_OF(OCSP_RESPID) **)parg = sc->ext.ocsp.ids;
  3495. ret = 1;
  3496. break;
  3497. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
  3498. sc->ext.ocsp.ids = parg;
  3499. ret = 1;
  3500. break;
  3501. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3502. *(unsigned char **)parg = sc->ext.ocsp.resp;
  3503. if (sc->ext.ocsp.resp_len == 0
  3504. || sc->ext.ocsp.resp_len > LONG_MAX)
  3505. return -1;
  3506. return (long)sc->ext.ocsp.resp_len;
  3507. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3508. OPENSSL_free(sc->ext.ocsp.resp);
  3509. sc->ext.ocsp.resp = parg;
  3510. sc->ext.ocsp.resp_len = larg;
  3511. ret = 1;
  3512. break;
  3513. case SSL_CTRL_CHAIN:
  3514. if (larg)
  3515. return ssl_cert_set1_chain(sc, NULL, (STACK_OF(X509) *)parg);
  3516. else
  3517. return ssl_cert_set0_chain(sc, NULL, (STACK_OF(X509) *)parg);
  3518. case SSL_CTRL_CHAIN_CERT:
  3519. if (larg)
  3520. return ssl_cert_add1_chain_cert(sc, NULL, (X509 *)parg);
  3521. else
  3522. return ssl_cert_add0_chain_cert(sc, NULL, (X509 *)parg);
  3523. case SSL_CTRL_GET_CHAIN_CERTS:
  3524. *(STACK_OF(X509) **)parg = sc->cert->key->chain;
  3525. ret = 1;
  3526. break;
  3527. case SSL_CTRL_SELECT_CURRENT_CERT:
  3528. return ssl_cert_select_current(sc->cert, (X509 *)parg);
  3529. case SSL_CTRL_SET_CURRENT_CERT:
  3530. if (larg == SSL_CERT_SET_SERVER) {
  3531. const SSL_CIPHER *cipher;
  3532. if (!sc->server)
  3533. return 0;
  3534. cipher = sc->s3.tmp.new_cipher;
  3535. if (cipher == NULL)
  3536. return 0;
  3537. /*
  3538. * No certificate for unauthenticated ciphersuites or using SRP
  3539. * authentication
  3540. */
  3541. if (cipher->algorithm_auth & (SSL_aNULL | SSL_aSRP))
  3542. return 2;
  3543. if (sc->s3.tmp.cert == NULL)
  3544. return 0;
  3545. sc->cert->key = sc->s3.tmp.cert;
  3546. return 1;
  3547. }
  3548. return ssl_cert_set_current(sc->cert, larg);
  3549. case SSL_CTRL_GET_GROUPS:
  3550. {
  3551. uint16_t *clist;
  3552. size_t clistlen;
  3553. if (!sc->session)
  3554. return 0;
  3555. clist = sc->ext.peer_supportedgroups;
  3556. clistlen = sc->ext.peer_supportedgroups_len;
  3557. if (parg) {
  3558. size_t i;
  3559. int *cptr = parg;
  3560. for (i = 0; i < clistlen; i++) {
  3561. uint16_t cid = SSL_CONNECTION_IS_TLS13(sc)
  3562. ? ssl_group_id_tls13_to_internal(clist[i])
  3563. : clist[i];
  3564. const TLS_GROUP_INFO *cinf
  3565. = tls1_group_id_lookup(s->ctx, cid);
  3566. if (cinf != NULL)
  3567. cptr[i] = tls1_group_id2nid(cinf->group_id, 1);
  3568. else
  3569. cptr[i] = TLSEXT_nid_unknown | clist[i];
  3570. }
  3571. }
  3572. return (int)clistlen;
  3573. }
  3574. case SSL_CTRL_SET_GROUPS:
  3575. return tls1_set_groups(&sc->ext.supportedgroups,
  3576. &sc->ext.supportedgroups_len, parg, larg);
  3577. case SSL_CTRL_SET_GROUPS_LIST:
  3578. return tls1_set_groups_list(s->ctx, &sc->ext.supportedgroups,
  3579. &sc->ext.supportedgroups_len, parg);
  3580. case SSL_CTRL_GET_SHARED_GROUP:
  3581. {
  3582. uint16_t id = tls1_shared_group(sc, larg);
  3583. if (larg != -1)
  3584. return tls1_group_id2nid(id, 1);
  3585. return id;
  3586. }
  3587. case SSL_CTRL_GET_NEGOTIATED_GROUP:
  3588. {
  3589. unsigned int id;
  3590. if (SSL_CONNECTION_IS_TLS13(sc) && sc->s3.did_kex)
  3591. id = sc->s3.group_id;
  3592. else
  3593. id = sc->session->kex_group;
  3594. ret = tls1_group_id2nid(id, 1);
  3595. break;
  3596. }
  3597. case SSL_CTRL_SET_SIGALGS:
  3598. return tls1_set_sigalgs(sc->cert, parg, larg, 0);
  3599. case SSL_CTRL_SET_SIGALGS_LIST:
  3600. return tls1_set_sigalgs_list(sc->cert, parg, 0);
  3601. case SSL_CTRL_SET_CLIENT_SIGALGS:
  3602. return tls1_set_sigalgs(sc->cert, parg, larg, 1);
  3603. case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  3604. return tls1_set_sigalgs_list(sc->cert, parg, 1);
  3605. case SSL_CTRL_GET_CLIENT_CERT_TYPES:
  3606. {
  3607. const unsigned char **pctype = parg;
  3608. if (sc->server || !sc->s3.tmp.cert_req)
  3609. return 0;
  3610. if (pctype)
  3611. *pctype = sc->s3.tmp.ctype;
  3612. return sc->s3.tmp.ctype_len;
  3613. }
  3614. case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  3615. if (!sc->server)
  3616. return 0;
  3617. return ssl3_set_req_cert_type(sc->cert, parg, larg);
  3618. case SSL_CTRL_BUILD_CERT_CHAIN:
  3619. return ssl_build_cert_chain(sc, NULL, larg);
  3620. case SSL_CTRL_SET_VERIFY_CERT_STORE:
  3621. return ssl_cert_set_cert_store(sc->cert, parg, 0, larg);
  3622. case SSL_CTRL_SET_CHAIN_CERT_STORE:
  3623. return ssl_cert_set_cert_store(sc->cert, parg, 1, larg);
  3624. case SSL_CTRL_GET_VERIFY_CERT_STORE:
  3625. return ssl_cert_get_cert_store(sc->cert, parg, 0);
  3626. case SSL_CTRL_GET_CHAIN_CERT_STORE:
  3627. return ssl_cert_get_cert_store(sc->cert, parg, 1);
  3628. case SSL_CTRL_GET_PEER_SIGNATURE_NID:
  3629. if (sc->s3.tmp.peer_sigalg == NULL)
  3630. return 0;
  3631. *(int *)parg = sc->s3.tmp.peer_sigalg->hash;
  3632. return 1;
  3633. case SSL_CTRL_GET_SIGNATURE_NID:
  3634. if (sc->s3.tmp.sigalg == NULL)
  3635. return 0;
  3636. *(int *)parg = sc->s3.tmp.sigalg->hash;
  3637. return 1;
  3638. case SSL_CTRL_GET_PEER_TMP_KEY:
  3639. if (sc->session == NULL || sc->s3.peer_tmp == NULL) {
  3640. return 0;
  3641. } else {
  3642. EVP_PKEY_up_ref(sc->s3.peer_tmp);
  3643. *(EVP_PKEY **)parg = sc->s3.peer_tmp;
  3644. return 1;
  3645. }
  3646. case SSL_CTRL_GET_TMP_KEY:
  3647. if (sc->session == NULL || sc->s3.tmp.pkey == NULL) {
  3648. return 0;
  3649. } else {
  3650. EVP_PKEY_up_ref(sc->s3.tmp.pkey);
  3651. *(EVP_PKEY **)parg = sc->s3.tmp.pkey;
  3652. return 1;
  3653. }
  3654. case SSL_CTRL_GET_EC_POINT_FORMATS:
  3655. {
  3656. const unsigned char **pformat = parg;
  3657. if (sc->ext.peer_ecpointformats == NULL)
  3658. return 0;
  3659. *pformat = sc->ext.peer_ecpointformats;
  3660. return (int)sc->ext.peer_ecpointformats_len;
  3661. }
  3662. case SSL_CTRL_GET_IANA_GROUPS:
  3663. {
  3664. if (parg != NULL) {
  3665. *(uint16_t **)parg = (uint16_t *)sc->ext.peer_supportedgroups;
  3666. }
  3667. return (int)sc->ext.peer_supportedgroups_len;
  3668. }
  3669. default:
  3670. break;
  3671. }
  3672. return ret;
  3673. }
  3674. long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
  3675. {
  3676. int ret = 0;
  3677. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
  3678. if (sc == NULL)
  3679. return ret;
  3680. switch (cmd) {
  3681. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3682. case SSL_CTRL_SET_TMP_DH_CB:
  3683. sc->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3684. ret = 1;
  3685. break;
  3686. #endif
  3687. case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
  3688. sc->ext.debug_cb = (void (*)(SSL *, int, int,
  3689. const unsigned char *, int, void *))fp;
  3690. ret = 1;
  3691. break;
  3692. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3693. sc->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3694. ret = 1;
  3695. break;
  3696. default:
  3697. break;
  3698. }
  3699. return ret;
  3700. }
  3701. long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  3702. {
  3703. switch (cmd) {
  3704. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3705. case SSL_CTRL_SET_TMP_DH:
  3706. {
  3707. EVP_PKEY *pkdh = NULL;
  3708. if (parg == NULL) {
  3709. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3710. return 0;
  3711. }
  3712. pkdh = ssl_dh_to_pkey(parg);
  3713. if (pkdh == NULL) {
  3714. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3715. return 0;
  3716. }
  3717. if (!SSL_CTX_set0_tmp_dh_pkey(ctx, pkdh)) {
  3718. EVP_PKEY_free(pkdh);
  3719. return 0;
  3720. }
  3721. return 1;
  3722. }
  3723. case SSL_CTRL_SET_TMP_DH_CB:
  3724. {
  3725. ERR_raise(ERR_LIB_SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3726. return 0;
  3727. }
  3728. #endif
  3729. case SSL_CTRL_SET_DH_AUTO:
  3730. ctx->cert->dh_tmp_auto = larg;
  3731. return 1;
  3732. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3733. case SSL_CTRL_SET_TMP_ECDH:
  3734. {
  3735. if (parg == NULL) {
  3736. ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
  3737. return 0;
  3738. }
  3739. return ssl_set_tmp_ecdh_groups(&ctx->ext.supportedgroups,
  3740. &ctx->ext.supportedgroups_len,
  3741. parg);
  3742. }
  3743. #endif /* !OPENSSL_NO_DEPRECATED_3_0 */
  3744. case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
  3745. ctx->ext.servername_arg = parg;
  3746. break;
  3747. case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
  3748. case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
  3749. {
  3750. unsigned char *keys = parg;
  3751. long tick_keylen = (sizeof(ctx->ext.tick_key_name) +
  3752. sizeof(ctx->ext.secure->tick_hmac_key) +
  3753. sizeof(ctx->ext.secure->tick_aes_key));
  3754. if (keys == NULL)
  3755. return tick_keylen;
  3756. if (larg != tick_keylen) {
  3757. ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
  3758. return 0;
  3759. }
  3760. if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS) {
  3761. memcpy(ctx->ext.tick_key_name, keys,
  3762. sizeof(ctx->ext.tick_key_name));
  3763. memcpy(ctx->ext.secure->tick_hmac_key,
  3764. keys + sizeof(ctx->ext.tick_key_name),
  3765. sizeof(ctx->ext.secure->tick_hmac_key));
  3766. memcpy(ctx->ext.secure->tick_aes_key,
  3767. keys + sizeof(ctx->ext.tick_key_name) +
  3768. sizeof(ctx->ext.secure->tick_hmac_key),
  3769. sizeof(ctx->ext.secure->tick_aes_key));
  3770. } else {
  3771. memcpy(keys, ctx->ext.tick_key_name,
  3772. sizeof(ctx->ext.tick_key_name));
  3773. memcpy(keys + sizeof(ctx->ext.tick_key_name),
  3774. ctx->ext.secure->tick_hmac_key,
  3775. sizeof(ctx->ext.secure->tick_hmac_key));
  3776. memcpy(keys + sizeof(ctx->ext.tick_key_name) +
  3777. sizeof(ctx->ext.secure->tick_hmac_key),
  3778. ctx->ext.secure->tick_aes_key,
  3779. sizeof(ctx->ext.secure->tick_aes_key));
  3780. }
  3781. return 1;
  3782. }
  3783. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE:
  3784. return ctx->ext.status_type;
  3785. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  3786. ctx->ext.status_type = larg;
  3787. break;
  3788. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
  3789. ctx->ext.status_arg = parg;
  3790. return 1;
  3791. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG:
  3792. *(void**)parg = ctx->ext.status_arg;
  3793. break;
  3794. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB:
  3795. *(int (**)(SSL*, void*))parg = ctx->ext.status_cb;
  3796. break;
  3797. #ifndef OPENSSL_NO_SRP
  3798. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
  3799. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3800. OPENSSL_free(ctx->srp_ctx.login);
  3801. ctx->srp_ctx.login = NULL;
  3802. if (parg == NULL)
  3803. break;
  3804. if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) {
  3805. ERR_raise(ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME);
  3806. return 0;
  3807. }
  3808. if ((ctx->srp_ctx.login = OPENSSL_strdup((char *)parg)) == NULL) {
  3809. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3810. return 0;
  3811. }
  3812. break;
  3813. case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
  3814. ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
  3815. srp_password_from_info_cb;
  3816. if (ctx->srp_ctx.info != NULL)
  3817. OPENSSL_free(ctx->srp_ctx.info);
  3818. if ((ctx->srp_ctx.info = OPENSSL_strdup((char *)parg)) == NULL) {
  3819. ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
  3820. return 0;
  3821. }
  3822. break;
  3823. case SSL_CTRL_SET_SRP_ARG:
  3824. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3825. ctx->srp_ctx.SRP_cb_arg = parg;
  3826. break;
  3827. case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
  3828. ctx->srp_ctx.strength = larg;
  3829. break;
  3830. #endif
  3831. case SSL_CTRL_SET_GROUPS:
  3832. return tls1_set_groups(&ctx->ext.supportedgroups,
  3833. &ctx->ext.supportedgroups_len,
  3834. parg, larg);
  3835. case SSL_CTRL_SET_GROUPS_LIST:
  3836. return tls1_set_groups_list(ctx, &ctx->ext.supportedgroups,
  3837. &ctx->ext.supportedgroups_len,
  3838. parg);
  3839. case SSL_CTRL_SET_SIGALGS:
  3840. return tls1_set_sigalgs(ctx->cert, parg, larg, 0);
  3841. case SSL_CTRL_SET_SIGALGS_LIST:
  3842. return tls1_set_sigalgs_list(ctx->cert, parg, 0);
  3843. case SSL_CTRL_SET_CLIENT_SIGALGS:
  3844. return tls1_set_sigalgs(ctx->cert, parg, larg, 1);
  3845. case SSL_CTRL_SET_CLIENT_SIGALGS_LIST:
  3846. return tls1_set_sigalgs_list(ctx->cert, parg, 1);
  3847. case SSL_CTRL_SET_CLIENT_CERT_TYPES:
  3848. return ssl3_set_req_cert_type(ctx->cert, parg, larg);
  3849. case SSL_CTRL_BUILD_CERT_CHAIN:
  3850. return ssl_build_cert_chain(NULL, ctx, larg);
  3851. case SSL_CTRL_SET_VERIFY_CERT_STORE:
  3852. return ssl_cert_set_cert_store(ctx->cert, parg, 0, larg);
  3853. case SSL_CTRL_SET_CHAIN_CERT_STORE:
  3854. return ssl_cert_set_cert_store(ctx->cert, parg, 1, larg);
  3855. case SSL_CTRL_GET_VERIFY_CERT_STORE:
  3856. return ssl_cert_get_cert_store(ctx->cert, parg, 0);
  3857. case SSL_CTRL_GET_CHAIN_CERT_STORE:
  3858. return ssl_cert_get_cert_store(ctx->cert, parg, 1);
  3859. /* A Thawte special :-) */
  3860. case SSL_CTRL_EXTRA_CHAIN_CERT:
  3861. if (ctx->extra_certs == NULL) {
  3862. if ((ctx->extra_certs = sk_X509_new_null()) == NULL) {
  3863. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3864. return 0;
  3865. }
  3866. }
  3867. if (!sk_X509_push(ctx->extra_certs, (X509 *)parg)) {
  3868. ERR_raise(ERR_LIB_SSL, ERR_R_MALLOC_FAILURE);
  3869. return 0;
  3870. }
  3871. break;
  3872. case SSL_CTRL_GET_EXTRA_CHAIN_CERTS:
  3873. if (ctx->extra_certs == NULL && larg == 0)
  3874. *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
  3875. else
  3876. *(STACK_OF(X509) **)parg = ctx->extra_certs;
  3877. break;
  3878. case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS:
  3879. OSSL_STACK_OF_X509_free(ctx->extra_certs);
  3880. ctx->extra_certs = NULL;
  3881. break;
  3882. case SSL_CTRL_CHAIN:
  3883. if (larg)
  3884. return ssl_cert_set1_chain(NULL, ctx, (STACK_OF(X509) *)parg);
  3885. else
  3886. return ssl_cert_set0_chain(NULL, ctx, (STACK_OF(X509) *)parg);
  3887. case SSL_CTRL_CHAIN_CERT:
  3888. if (larg)
  3889. return ssl_cert_add1_chain_cert(NULL, ctx, (X509 *)parg);
  3890. else
  3891. return ssl_cert_add0_chain_cert(NULL, ctx, (X509 *)parg);
  3892. case SSL_CTRL_GET_CHAIN_CERTS:
  3893. *(STACK_OF(X509) **)parg = ctx->cert->key->chain;
  3894. break;
  3895. case SSL_CTRL_SELECT_CURRENT_CERT:
  3896. return ssl_cert_select_current(ctx->cert, (X509 *)parg);
  3897. case SSL_CTRL_SET_CURRENT_CERT:
  3898. return ssl_cert_set_current(ctx->cert, larg);
  3899. default:
  3900. return 0;
  3901. }
  3902. return 1;
  3903. }
  3904. long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp) (void))
  3905. {
  3906. switch (cmd) {
  3907. #if !defined(OPENSSL_NO_DEPRECATED_3_0)
  3908. case SSL_CTRL_SET_TMP_DH_CB:
  3909. {
  3910. ctx->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3911. }
  3912. break;
  3913. #endif
  3914. case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
  3915. ctx->ext.servername_cb = (int (*)(SSL *, int *, void *))fp;
  3916. break;
  3917. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
  3918. ctx->ext.status_cb = (int (*)(SSL *, void *))fp;
  3919. break;
  3920. # ifndef OPENSSL_NO_DEPRECATED_3_0
  3921. case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
  3922. ctx->ext.ticket_key_cb = (int (*)(SSL *, unsigned char *,
  3923. unsigned char *,
  3924. EVP_CIPHER_CTX *,
  3925. HMAC_CTX *, int))fp;
  3926. break;
  3927. #endif
  3928. #ifndef OPENSSL_NO_SRP
  3929. case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
  3930. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3931. ctx->srp_ctx.SRP_verify_param_callback = (int (*)(SSL *, void *))fp;
  3932. break;
  3933. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
  3934. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3935. ctx->srp_ctx.TLS_ext_srp_username_callback =
  3936. (int (*)(SSL *, int *, void *))fp;
  3937. break;
  3938. case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
  3939. ctx->srp_ctx.srp_Mask |= SSL_kSRP;
  3940. ctx->srp_ctx.SRP_give_srp_client_pwd_callback =
  3941. (char *(*)(SSL *, void *))fp;
  3942. break;
  3943. #endif
  3944. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3945. {
  3946. ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3947. }
  3948. break;
  3949. default:
  3950. return 0;
  3951. }
  3952. return 1;
  3953. }
  3954. int SSL_CTX_set_tlsext_ticket_key_evp_cb
  3955. (SSL_CTX *ctx, int (*fp)(SSL *, unsigned char *, unsigned char *,
  3956. EVP_CIPHER_CTX *, EVP_MAC_CTX *, int))
  3957. {
  3958. ctx->ext.ticket_key_evp_cb = fp;
  3959. return 1;
  3960. }
  3961. const SSL_CIPHER *ssl3_get_cipher_by_id(uint32_t id)
  3962. {
  3963. SSL_CIPHER c;
  3964. const SSL_CIPHER *cp;
  3965. c.id = id;
  3966. cp = OBJ_bsearch_ssl_cipher_id(&c, tls13_ciphers, TLS13_NUM_CIPHERS);
  3967. if (cp != NULL)
  3968. return cp;
  3969. cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  3970. if (cp != NULL)
  3971. return cp;
  3972. return OBJ_bsearch_ssl_cipher_id(&c, ssl3_scsvs, SSL3_NUM_SCSVS);
  3973. }
  3974. const SSL_CIPHER *ssl3_get_cipher_by_std_name(const char *stdname)
  3975. {
  3976. SSL_CIPHER *tbl;
  3977. SSL_CIPHER *alltabs[] = {tls13_ciphers, ssl3_ciphers, ssl3_scsvs};
  3978. size_t i, j, tblsize[] = {TLS13_NUM_CIPHERS, SSL3_NUM_CIPHERS,
  3979. SSL3_NUM_SCSVS};
  3980. /* this is not efficient, necessary to optimize this? */
  3981. for (j = 0; j < OSSL_NELEM(alltabs); j++) {
  3982. for (i = 0, tbl = alltabs[j]; i < tblsize[j]; i++, tbl++) {
  3983. if (tbl->stdname == NULL)
  3984. continue;
  3985. if (strcmp(stdname, tbl->stdname) == 0) {
  3986. return tbl;
  3987. }
  3988. }
  3989. }
  3990. return NULL;
  3991. }
  3992. /*
  3993. * This function needs to check if the ciphers required are actually
  3994. * available
  3995. */
  3996. const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
  3997. {
  3998. return ssl3_get_cipher_by_id(SSL3_CK_CIPHERSUITE_FLAG
  3999. | ((uint32_t)p[0] << 8L)
  4000. | (uint32_t)p[1]);
  4001. }
  4002. int ssl3_put_cipher_by_char(const SSL_CIPHER *c, WPACKET *pkt, size_t *len)
  4003. {
  4004. if ((c->id & 0xff000000) != SSL3_CK_CIPHERSUITE_FLAG) {
  4005. *len = 0;
  4006. return 1;
  4007. }
  4008. if (!WPACKET_put_bytes_u16(pkt, c->id & 0xffff))
  4009. return 0;
  4010. *len = 2;
  4011. return 1;
  4012. }
  4013. /*
  4014. * ssl3_choose_cipher - choose a cipher from those offered by the client
  4015. * @s: SSL connection
  4016. * @clnt: ciphers offered by the client
  4017. * @srvr: ciphers enabled on the server?
  4018. *
  4019. * Returns the selected cipher or NULL when no common ciphers.
  4020. */
  4021. const SSL_CIPHER *ssl3_choose_cipher(SSL_CONNECTION *s, STACK_OF(SSL_CIPHER) *clnt,
  4022. STACK_OF(SSL_CIPHER) *srvr)
  4023. {
  4024. const SSL_CIPHER *c, *ret = NULL;
  4025. STACK_OF(SSL_CIPHER) *prio, *allow;
  4026. int i, ii, ok, prefer_sha256 = 0;
  4027. unsigned long alg_k = 0, alg_a = 0, mask_k = 0, mask_a = 0;
  4028. STACK_OF(SSL_CIPHER) *prio_chacha = NULL;
  4029. /* Let's see which ciphers we can support */
  4030. /*
  4031. * Do not set the compare functions, because this may lead to a
  4032. * reordering by "id". We want to keep the original ordering. We may pay
  4033. * a price in performance during sk_SSL_CIPHER_find(), but would have to
  4034. * pay with the price of sk_SSL_CIPHER_dup().
  4035. */
  4036. OSSL_TRACE_BEGIN(TLS_CIPHER) {
  4037. BIO_printf(trc_out, "Server has %d from %p:\n",
  4038. sk_SSL_CIPHER_num(srvr), (void *)srvr);
  4039. for (i = 0; i < sk_SSL_CIPHER_num(srvr); ++i) {
  4040. c = sk_SSL_CIPHER_value(srvr, i);
  4041. BIO_printf(trc_out, "%p:%s\n", (void *)c, c->name);
  4042. }
  4043. BIO_printf(trc_out, "Client sent %d from %p:\n",
  4044. sk_SSL_CIPHER_num(clnt), (void *)clnt);
  4045. for (i = 0; i < sk_SSL_CIPHER_num(clnt); ++i) {
  4046. c = sk_SSL_CIPHER_value(clnt, i);
  4047. BIO_printf(trc_out, "%p:%s\n", (void *)c, c->name);
  4048. }
  4049. } OSSL_TRACE_END(TLS_CIPHER);
  4050. /* SUITE-B takes precedence over server preference and ChaCha priortiy */
  4051. if (tls1_suiteb(s)) {
  4052. prio = srvr;
  4053. allow = clnt;
  4054. } else if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE) {
  4055. prio = srvr;
  4056. allow = clnt;
  4057. /* If ChaCha20 is at the top of the client preference list,
  4058. and there are ChaCha20 ciphers in the server list, then
  4059. temporarily prioritize all ChaCha20 ciphers in the servers list. */
  4060. if (s->options & SSL_OP_PRIORITIZE_CHACHA && sk_SSL_CIPHER_num(clnt) > 0) {
  4061. c = sk_SSL_CIPHER_value(clnt, 0);
  4062. if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
  4063. /* ChaCha20 is client preferred, check server... */
  4064. int num = sk_SSL_CIPHER_num(srvr);
  4065. int found = 0;
  4066. for (i = 0; i < num; i++) {
  4067. c = sk_SSL_CIPHER_value(srvr, i);
  4068. if (c->algorithm_enc == SSL_CHACHA20POLY1305) {
  4069. found = 1;
  4070. break;
  4071. }
  4072. }
  4073. if (found) {
  4074. prio_chacha = sk_SSL_CIPHER_new_reserve(NULL, num);
  4075. /* if reserve fails, then there's likely a memory issue */
  4076. if (prio_chacha != NULL) {
  4077. /* Put all ChaCha20 at the top, starting with the one we just found */
  4078. sk_SSL_CIPHER_push(prio_chacha, c);
  4079. for (i++; i < num; i++) {
  4080. c = sk_SSL_CIPHER_value(srvr, i);
  4081. if (c->algorithm_enc == SSL_CHACHA20POLY1305)
  4082. sk_SSL_CIPHER_push(prio_chacha, c);
  4083. }
  4084. /* Pull in the rest */
  4085. for (i = 0; i < num; i++) {
  4086. c = sk_SSL_CIPHER_value(srvr, i);
  4087. if (c->algorithm_enc != SSL_CHACHA20POLY1305)
  4088. sk_SSL_CIPHER_push(prio_chacha, c);
  4089. }
  4090. prio = prio_chacha;
  4091. }
  4092. }
  4093. }
  4094. }
  4095. } else {
  4096. prio = clnt;
  4097. allow = srvr;
  4098. }
  4099. if (SSL_CONNECTION_IS_TLS13(s)) {
  4100. #ifndef OPENSSL_NO_PSK
  4101. int j;
  4102. /*
  4103. * If we allow "old" style PSK callbacks, and we have no certificate (so
  4104. * we're not going to succeed without a PSK anyway), and we're in
  4105. * TLSv1.3 then the default hash for a PSK is SHA-256 (as per the
  4106. * TLSv1.3 spec). Therefore we should prioritise ciphersuites using
  4107. * that.
  4108. */
  4109. if (s->psk_server_callback != NULL) {
  4110. for (j = 0; j < SSL_PKEY_NUM && !ssl_has_cert(s, j); j++);
  4111. if (j == SSL_PKEY_NUM) {
  4112. /* There are no certificates */
  4113. prefer_sha256 = 1;
  4114. }
  4115. }
  4116. #endif
  4117. } else {
  4118. tls1_set_cert_validity(s);
  4119. ssl_set_masks(s);
  4120. }
  4121. for (i = 0; i < sk_SSL_CIPHER_num(prio); i++) {
  4122. c = sk_SSL_CIPHER_value(prio, i);
  4123. /* Skip ciphers not supported by the protocol version */
  4124. if (!SSL_CONNECTION_IS_DTLS(s) &&
  4125. ((s->version < c->min_tls) || (s->version > c->max_tls)))
  4126. continue;
  4127. if (SSL_CONNECTION_IS_DTLS(s) &&
  4128. (DTLS_VERSION_LT(s->version, c->min_dtls) ||
  4129. DTLS_VERSION_GT(s->version, c->max_dtls)))
  4130. continue;
  4131. /*
  4132. * Since TLS 1.3 ciphersuites can be used with any auth or
  4133. * key exchange scheme skip tests.
  4134. */
  4135. if (!SSL_CONNECTION_IS_TLS13(s)) {
  4136. mask_k = s->s3.tmp.mask_k;
  4137. mask_a = s->s3.tmp.mask_a;
  4138. #ifndef OPENSSL_NO_SRP
  4139. if (s->srp_ctx.srp_Mask & SSL_kSRP) {
  4140. mask_k |= SSL_kSRP;
  4141. mask_a |= SSL_aSRP;
  4142. }
  4143. #endif
  4144. alg_k = c->algorithm_mkey;
  4145. alg_a = c->algorithm_auth;
  4146. #ifndef OPENSSL_NO_PSK
  4147. /* with PSK there must be server callback set */
  4148. if ((alg_k & SSL_PSK) && s->psk_server_callback == NULL)
  4149. continue;
  4150. #endif /* OPENSSL_NO_PSK */
  4151. ok = (alg_k & mask_k) && (alg_a & mask_a);
  4152. OSSL_TRACE7(TLS_CIPHER,
  4153. "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",
  4154. ok, alg_k, alg_a, mask_k, mask_a, (void *)c, c->name);
  4155. /*
  4156. * if we are considering an ECC cipher suite that uses an ephemeral
  4157. * EC key check it
  4158. */
  4159. if (alg_k & SSL_kECDHE)
  4160. ok = ok && tls1_check_ec_tmp_key(s, c->id);
  4161. if (!ok)
  4162. continue;
  4163. }
  4164. ii = sk_SSL_CIPHER_find(allow, c);
  4165. if (ii >= 0) {
  4166. /* Check security callback permits this cipher */
  4167. if (!ssl_security(s, SSL_SECOP_CIPHER_SHARED,
  4168. c->strength_bits, 0, (void *)c))
  4169. continue;
  4170. if ((alg_k & SSL_kECDHE) && (alg_a & SSL_aECDSA)
  4171. && s->s3.is_probably_safari) {
  4172. if (!ret)
  4173. ret = sk_SSL_CIPHER_value(allow, ii);
  4174. continue;
  4175. }
  4176. if (prefer_sha256) {
  4177. const SSL_CIPHER *tmp = sk_SSL_CIPHER_value(allow, ii);
  4178. const EVP_MD *md = ssl_md(SSL_CONNECTION_GET_CTX(s),
  4179. tmp->algorithm2);
  4180. if (md != NULL
  4181. && EVP_MD_is_a(md, OSSL_DIGEST_NAME_SHA2_256)) {
  4182. ret = tmp;
  4183. break;
  4184. }
  4185. if (ret == NULL)
  4186. ret = tmp;
  4187. continue;
  4188. }
  4189. ret = sk_SSL_CIPHER_value(allow, ii);
  4190. break;
  4191. }
  4192. }
  4193. sk_SSL_CIPHER_free(prio_chacha);
  4194. return ret;
  4195. }
  4196. int ssl3_get_req_cert_type(SSL_CONNECTION *s, WPACKET *pkt)
  4197. {
  4198. uint32_t alg_k, alg_a = 0;
  4199. /* If we have custom certificate types set, use them */
  4200. if (s->cert->ctype)
  4201. return WPACKET_memcpy(pkt, s->cert->ctype, s->cert->ctype_len);
  4202. /* Get mask of algorithms disabled by signature list */
  4203. ssl_set_sig_mask(&alg_a, s, SSL_SECOP_SIGALG_MASK);
  4204. alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
  4205. #ifndef OPENSSL_NO_GOST
  4206. if (s->version >= TLS1_VERSION && (alg_k & SSL_kGOST))
  4207. if (!WPACKET_put_bytes_u8(pkt, TLS_CT_GOST01_SIGN)
  4208. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_SIGN)
  4209. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_512_SIGN)
  4210. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_LEGACY_SIGN)
  4211. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_LEGACY_512_SIGN))
  4212. return 0;
  4213. if (s->version >= TLS1_2_VERSION && (alg_k & SSL_kGOST18))
  4214. if (!WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_SIGN)
  4215. || !WPACKET_put_bytes_u8(pkt, TLS_CT_GOST12_IANA_512_SIGN))
  4216. return 0;
  4217. #endif
  4218. if ((s->version == SSL3_VERSION) && (alg_k & SSL_kDHE)) {
  4219. if (!WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_EPHEMERAL_DH))
  4220. return 0;
  4221. if (!(alg_a & SSL_aDSS)
  4222. && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_EPHEMERAL_DH))
  4223. return 0;
  4224. }
  4225. if (!(alg_a & SSL_aRSA) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_RSA_SIGN))
  4226. return 0;
  4227. if (!(alg_a & SSL_aDSS) && !WPACKET_put_bytes_u8(pkt, SSL3_CT_DSS_SIGN))
  4228. return 0;
  4229. /*
  4230. * ECDSA certs can be used with RSA cipher suites too so we don't
  4231. * need to check for SSL_kECDH or SSL_kECDHE
  4232. */
  4233. if (s->version >= TLS1_VERSION
  4234. && !(alg_a & SSL_aECDSA)
  4235. && !WPACKET_put_bytes_u8(pkt, TLS_CT_ECDSA_SIGN))
  4236. return 0;
  4237. return 1;
  4238. }
  4239. static int ssl3_set_req_cert_type(CERT *c, const unsigned char *p, size_t len)
  4240. {
  4241. OPENSSL_free(c->ctype);
  4242. c->ctype = NULL;
  4243. c->ctype_len = 0;
  4244. if (p == NULL || len == 0)
  4245. return 1;
  4246. if (len > 0xff)
  4247. return 0;
  4248. c->ctype = OPENSSL_memdup(p, len);
  4249. if (c->ctype == NULL)
  4250. return 0;
  4251. c->ctype_len = len;
  4252. return 1;
  4253. }
  4254. int ssl3_shutdown(SSL *s)
  4255. {
  4256. int ret;
  4257. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  4258. if (sc == NULL)
  4259. return 0;
  4260. /*
  4261. * Don't do anything much if we have not done the handshake or we don't
  4262. * want to send messages :-)
  4263. */
  4264. if (sc->quiet_shutdown || SSL_in_before(s)) {
  4265. sc->shutdown = (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN);
  4266. return 1;
  4267. }
  4268. if (!(sc->shutdown & SSL_SENT_SHUTDOWN)) {
  4269. sc->shutdown |= SSL_SENT_SHUTDOWN;
  4270. ssl3_send_alert(sc, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY);
  4271. /*
  4272. * our shutdown alert has been sent now, and if it still needs to be
  4273. * written, s->s3.alert_dispatch will be true
  4274. */
  4275. if (sc->s3.alert_dispatch)
  4276. return -1; /* return WANT_WRITE */
  4277. } else if (sc->s3.alert_dispatch) {
  4278. /* resend it if not sent */
  4279. ret = s->method->ssl_dispatch_alert(s);
  4280. if (ret == -1) {
  4281. /*
  4282. * we only get to return -1 here the 2nd/Nth invocation, we must
  4283. * have already signalled return 0 upon a previous invocation,
  4284. * return WANT_WRITE
  4285. */
  4286. return ret;
  4287. }
  4288. } else if (!(sc->shutdown & SSL_RECEIVED_SHUTDOWN)) {
  4289. size_t readbytes;
  4290. /*
  4291. * If we are waiting for a close from our peer, we are closed
  4292. */
  4293. s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0, &readbytes);
  4294. if (!(sc->shutdown & SSL_RECEIVED_SHUTDOWN)) {
  4295. return -1; /* return WANT_READ */
  4296. }
  4297. }
  4298. if ((sc->shutdown == (SSL_SENT_SHUTDOWN | SSL_RECEIVED_SHUTDOWN)) &&
  4299. !sc->s3.alert_dispatch)
  4300. return 1;
  4301. else
  4302. return 0;
  4303. }
  4304. int ssl3_write(SSL *s, const void *buf, size_t len, size_t *written)
  4305. {
  4306. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  4307. if (sc == NULL)
  4308. return 0;
  4309. clear_sys_error();
  4310. if (sc->s3.renegotiate)
  4311. ssl3_renegotiate_check(s, 0);
  4312. return s->method->ssl_write_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len,
  4313. written);
  4314. }
  4315. static int ssl3_read_internal(SSL *s, void *buf, size_t len, int peek,
  4316. size_t *readbytes)
  4317. {
  4318. int ret;
  4319. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  4320. if (sc == NULL)
  4321. return 0;
  4322. clear_sys_error();
  4323. if (sc->s3.renegotiate)
  4324. ssl3_renegotiate_check(s, 0);
  4325. sc->s3.in_read_app_data = 1;
  4326. ret =
  4327. s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len,
  4328. peek, readbytes);
  4329. if ((ret == -1) && (sc->s3.in_read_app_data == 2)) {
  4330. /*
  4331. * ssl3_read_bytes decided to call s->handshake_func, which called
  4332. * ssl3_read_bytes to read handshake data. However, ssl3_read_bytes
  4333. * actually found application data and thinks that application data
  4334. * makes sense here; so disable handshake processing and try to read
  4335. * application data again.
  4336. */
  4337. ossl_statem_set_in_handshake(sc, 1);
  4338. ret =
  4339. s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf,
  4340. len, peek, readbytes);
  4341. ossl_statem_set_in_handshake(sc, 0);
  4342. } else
  4343. sc->s3.in_read_app_data = 0;
  4344. return ret;
  4345. }
  4346. int ssl3_read(SSL *s, void *buf, size_t len, size_t *readbytes)
  4347. {
  4348. return ssl3_read_internal(s, buf, len, 0, readbytes);
  4349. }
  4350. int ssl3_peek(SSL *s, void *buf, size_t len, size_t *readbytes)
  4351. {
  4352. return ssl3_read_internal(s, buf, len, 1, readbytes);
  4353. }
  4354. int ssl3_renegotiate(SSL *s)
  4355. {
  4356. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  4357. if (sc == NULL)
  4358. return 0;
  4359. if (sc->handshake_func == NULL)
  4360. return 1;
  4361. sc->s3.renegotiate = 1;
  4362. return 1;
  4363. }
  4364. /*
  4365. * Check if we are waiting to do a renegotiation and if so whether now is a
  4366. * good time to do it. If |initok| is true then we are being called from inside
  4367. * the state machine so ignore the result of SSL_in_init(s). Otherwise we
  4368. * should not do a renegotiation if SSL_in_init(s) is true. Returns 1 if we
  4369. * should do a renegotiation now and sets up the state machine for it. Otherwise
  4370. * returns 0.
  4371. */
  4372. int ssl3_renegotiate_check(SSL *s, int initok)
  4373. {
  4374. int ret = 0;
  4375. SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL_ONLY(s);
  4376. if (sc == NULL)
  4377. return 0;
  4378. if (sc->s3.renegotiate) {
  4379. if (!RECORD_LAYER_read_pending(&sc->rlayer)
  4380. && !RECORD_LAYER_write_pending(&sc->rlayer)
  4381. && (initok || !SSL_in_init(s))) {
  4382. /*
  4383. * if we are the server, and we have sent a 'RENEGOTIATE'
  4384. * message, we need to set the state machine into the renegotiate
  4385. * state.
  4386. */
  4387. ossl_statem_set_renegotiate(sc);
  4388. sc->s3.renegotiate = 0;
  4389. sc->s3.num_renegotiations++;
  4390. sc->s3.total_renegotiations++;
  4391. ret = 1;
  4392. }
  4393. }
  4394. return ret;
  4395. }
  4396. /*
  4397. * If we are using default SHA1+MD5 algorithms switch to new SHA256 PRF and
  4398. * handshake macs if required.
  4399. *
  4400. * If PSK and using SHA384 for TLS < 1.2 switch to default.
  4401. */
  4402. long ssl_get_algorithm2(SSL_CONNECTION *s)
  4403. {
  4404. long alg2;
  4405. SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  4406. if (s->s3.tmp.new_cipher == NULL)
  4407. return -1;
  4408. alg2 = s->s3.tmp.new_cipher->algorithm2;
  4409. if (ssl->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
  4410. if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
  4411. return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
  4412. } else if (s->s3.tmp.new_cipher->algorithm_mkey & SSL_PSK) {
  4413. if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384))
  4414. return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF;
  4415. }
  4416. return alg2;
  4417. }
  4418. /*
  4419. * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
  4420. * failure, 1 on success.
  4421. */
  4422. int ssl_fill_hello_random(SSL_CONNECTION *s, int server,
  4423. unsigned char *result, size_t len,
  4424. DOWNGRADE dgrd)
  4425. {
  4426. int send_time = 0, ret;
  4427. if (len < 4)
  4428. return 0;
  4429. if (server)
  4430. send_time = (s->mode & SSL_MODE_SEND_SERVERHELLO_TIME) != 0;
  4431. else
  4432. send_time = (s->mode & SSL_MODE_SEND_CLIENTHELLO_TIME) != 0;
  4433. if (send_time) {
  4434. unsigned long Time = (unsigned long)time(NULL);
  4435. unsigned char *p = result;
  4436. l2n(Time, p);
  4437. ret = RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx, p, len - 4, 0);
  4438. } else {
  4439. ret = RAND_bytes_ex(SSL_CONNECTION_GET_CTX(s)->libctx, result, len, 0);
  4440. }
  4441. if (ret > 0) {
  4442. if (!ossl_assert(sizeof(tls11downgrade) < len)
  4443. || !ossl_assert(sizeof(tls12downgrade) < len))
  4444. return 0;
  4445. if (dgrd == DOWNGRADE_TO_1_2)
  4446. memcpy(result + len - sizeof(tls12downgrade), tls12downgrade,
  4447. sizeof(tls12downgrade));
  4448. else if (dgrd == DOWNGRADE_TO_1_1)
  4449. memcpy(result + len - sizeof(tls11downgrade), tls11downgrade,
  4450. sizeof(tls11downgrade));
  4451. }
  4452. return ret;
  4453. }
  4454. int ssl_generate_master_secret(SSL_CONNECTION *s, unsigned char *pms,
  4455. size_t pmslen, int free_pms)
  4456. {
  4457. unsigned long alg_k = s->s3.tmp.new_cipher->algorithm_mkey;
  4458. int ret = 0;
  4459. SSL *ssl = SSL_CONNECTION_GET_SSL(s);
  4460. if (alg_k & SSL_PSK) {
  4461. #ifndef OPENSSL_NO_PSK
  4462. unsigned char *pskpms, *t;
  4463. size_t psklen = s->s3.tmp.psklen;
  4464. size_t pskpmslen;
  4465. /* create PSK premaster_secret */
  4466. /* For plain PSK "other_secret" is psklen zeroes */
  4467. if (alg_k & SSL_kPSK)
  4468. pmslen = psklen;
  4469. pskpmslen = 4 + pmslen + psklen;
  4470. pskpms = OPENSSL_malloc(pskpmslen);
  4471. if (pskpms == NULL)
  4472. goto err;
  4473. t = pskpms;
  4474. s2n(pmslen, t);
  4475. if (alg_k & SSL_kPSK)
  4476. memset(t, 0, pmslen);
  4477. else
  4478. memcpy(t, pms, pmslen);
  4479. t += pmslen;
  4480. s2n(psklen, t);
  4481. memcpy(t, s->s3.tmp.psk, psklen);
  4482. OPENSSL_clear_free(s->s3.tmp.psk, psklen);
  4483. s->s3.tmp.psk = NULL;
  4484. s->s3.tmp.psklen = 0;
  4485. if (!ssl->method->ssl3_enc->generate_master_secret(s,
  4486. s->session->master_key, pskpms, pskpmslen,
  4487. &s->session->master_key_length)) {
  4488. OPENSSL_clear_free(pskpms, pskpmslen);
  4489. /* SSLfatal() already called */
  4490. goto err;
  4491. }
  4492. OPENSSL_clear_free(pskpms, pskpmslen);
  4493. #else
  4494. /* Should never happen */
  4495. goto err;
  4496. #endif
  4497. } else {
  4498. if (!ssl->method->ssl3_enc->generate_master_secret(s,
  4499. s->session->master_key, pms, pmslen,
  4500. &s->session->master_key_length)) {
  4501. /* SSLfatal() already called */
  4502. goto err;
  4503. }
  4504. }
  4505. ret = 1;
  4506. err:
  4507. if (pms) {
  4508. if (free_pms)
  4509. OPENSSL_clear_free(pms, pmslen);
  4510. else
  4511. OPENSSL_cleanse(pms, pmslen);
  4512. }
  4513. if (s->server == 0) {
  4514. s->s3.tmp.pms = NULL;
  4515. s->s3.tmp.pmslen = 0;
  4516. }
  4517. return ret;
  4518. }
  4519. /* Generate a private key from parameters */
  4520. EVP_PKEY *ssl_generate_pkey(SSL_CONNECTION *s, EVP_PKEY *pm)
  4521. {
  4522. EVP_PKEY_CTX *pctx = NULL;
  4523. EVP_PKEY *pkey = NULL;
  4524. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4525. if (pm == NULL)
  4526. return NULL;
  4527. pctx = EVP_PKEY_CTX_new_from_pkey(sctx->libctx, pm, sctx->propq);
  4528. if (pctx == NULL)
  4529. goto err;
  4530. if (EVP_PKEY_keygen_init(pctx) <= 0)
  4531. goto err;
  4532. if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
  4533. EVP_PKEY_free(pkey);
  4534. pkey = NULL;
  4535. }
  4536. err:
  4537. EVP_PKEY_CTX_free(pctx);
  4538. return pkey;
  4539. }
  4540. /* Generate a private key from a group ID */
  4541. EVP_PKEY *ssl_generate_pkey_group(SSL_CONNECTION *s, uint16_t id)
  4542. {
  4543. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4544. const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(sctx, id);
  4545. EVP_PKEY_CTX *pctx = NULL;
  4546. EVP_PKEY *pkey = NULL;
  4547. if (ginf == NULL) {
  4548. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4549. goto err;
  4550. }
  4551. pctx = EVP_PKEY_CTX_new_from_name(sctx->libctx, ginf->algorithm,
  4552. sctx->propq);
  4553. if (pctx == NULL) {
  4554. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4555. goto err;
  4556. }
  4557. if (EVP_PKEY_keygen_init(pctx) <= 0) {
  4558. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4559. goto err;
  4560. }
  4561. if (EVP_PKEY_CTX_set_group_name(pctx, ginf->realname) <= 0) {
  4562. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4563. goto err;
  4564. }
  4565. if (EVP_PKEY_keygen(pctx, &pkey) <= 0) {
  4566. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4567. EVP_PKEY_free(pkey);
  4568. pkey = NULL;
  4569. }
  4570. err:
  4571. EVP_PKEY_CTX_free(pctx);
  4572. return pkey;
  4573. }
  4574. /*
  4575. * Generate parameters from a group ID
  4576. */
  4577. EVP_PKEY *ssl_generate_param_group(SSL_CONNECTION *s, uint16_t id)
  4578. {
  4579. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4580. EVP_PKEY_CTX *pctx = NULL;
  4581. EVP_PKEY *pkey = NULL;
  4582. const TLS_GROUP_INFO *ginf = tls1_group_id_lookup(sctx, id);
  4583. if (ginf == NULL)
  4584. goto err;
  4585. pctx = EVP_PKEY_CTX_new_from_name(sctx->libctx, ginf->algorithm,
  4586. sctx->propq);
  4587. if (pctx == NULL)
  4588. goto err;
  4589. if (EVP_PKEY_paramgen_init(pctx) <= 0)
  4590. goto err;
  4591. if (EVP_PKEY_CTX_set_group_name(pctx, ginf->realname) <= 0) {
  4592. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_EVP_LIB);
  4593. goto err;
  4594. }
  4595. if (EVP_PKEY_paramgen(pctx, &pkey) <= 0) {
  4596. EVP_PKEY_free(pkey);
  4597. pkey = NULL;
  4598. }
  4599. err:
  4600. EVP_PKEY_CTX_free(pctx);
  4601. return pkey;
  4602. }
  4603. /* Generate secrets from pms */
  4604. int ssl_gensecret(SSL_CONNECTION *s, unsigned char *pms, size_t pmslen)
  4605. {
  4606. int rv = 0;
  4607. /* SSLfatal() called as appropriate in the below functions */
  4608. if (SSL_CONNECTION_IS_TLS13(s)) {
  4609. /*
  4610. * If we are resuming then we already generated the early secret
  4611. * when we created the ClientHello, so don't recreate it.
  4612. */
  4613. if (!s->hit)
  4614. rv = tls13_generate_secret(s, ssl_handshake_md(s), NULL, NULL,
  4615. 0,
  4616. (unsigned char *)&s->early_secret);
  4617. else
  4618. rv = 1;
  4619. rv = rv && tls13_generate_handshake_secret(s, pms, pmslen);
  4620. } else {
  4621. rv = ssl_generate_master_secret(s, pms, pmslen, 0);
  4622. }
  4623. return rv;
  4624. }
  4625. /* Derive secrets for ECDH/DH */
  4626. int ssl_derive(SSL_CONNECTION *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gensecret)
  4627. {
  4628. int rv = 0;
  4629. unsigned char *pms = NULL;
  4630. size_t pmslen = 0;
  4631. EVP_PKEY_CTX *pctx;
  4632. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4633. if (privkey == NULL || pubkey == NULL) {
  4634. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4635. return 0;
  4636. }
  4637. pctx = EVP_PKEY_CTX_new_from_pkey(sctx->libctx, privkey, sctx->propq);
  4638. if (EVP_PKEY_derive_init(pctx) <= 0
  4639. || EVP_PKEY_derive_set_peer(pctx, pubkey) <= 0
  4640. || EVP_PKEY_derive(pctx, NULL, &pmslen) <= 0) {
  4641. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4642. goto err;
  4643. }
  4644. if (SSL_CONNECTION_IS_TLS13(s) && EVP_PKEY_is_a(privkey, "DH"))
  4645. EVP_PKEY_CTX_set_dh_pad(pctx, 1);
  4646. pms = OPENSSL_malloc(pmslen);
  4647. if (pms == NULL) {
  4648. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4649. goto err;
  4650. }
  4651. if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0) {
  4652. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4653. goto err;
  4654. }
  4655. if (gensecret) {
  4656. /* SSLfatal() called as appropriate in the below functions */
  4657. rv = ssl_gensecret(s, pms, pmslen);
  4658. } else {
  4659. /* Save premaster secret */
  4660. s->s3.tmp.pms = pms;
  4661. s->s3.tmp.pmslen = pmslen;
  4662. pms = NULL;
  4663. rv = 1;
  4664. }
  4665. err:
  4666. OPENSSL_clear_free(pms, pmslen);
  4667. EVP_PKEY_CTX_free(pctx);
  4668. return rv;
  4669. }
  4670. /* Decapsulate secrets for KEM */
  4671. int ssl_decapsulate(SSL_CONNECTION *s, EVP_PKEY *privkey,
  4672. const unsigned char *ct, size_t ctlen,
  4673. int gensecret)
  4674. {
  4675. int rv = 0;
  4676. unsigned char *pms = NULL;
  4677. size_t pmslen = 0;
  4678. EVP_PKEY_CTX *pctx;
  4679. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4680. if (privkey == NULL) {
  4681. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4682. return 0;
  4683. }
  4684. pctx = EVP_PKEY_CTX_new_from_pkey(sctx->libctx, privkey, sctx->propq);
  4685. if (EVP_PKEY_decapsulate_init(pctx, NULL) <= 0
  4686. || EVP_PKEY_decapsulate(pctx, NULL, &pmslen, ct, ctlen) <= 0) {
  4687. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4688. goto err;
  4689. }
  4690. pms = OPENSSL_malloc(pmslen);
  4691. if (pms == NULL) {
  4692. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4693. goto err;
  4694. }
  4695. if (EVP_PKEY_decapsulate(pctx, pms, &pmslen, ct, ctlen) <= 0) {
  4696. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4697. goto err;
  4698. }
  4699. if (gensecret) {
  4700. /* SSLfatal() called as appropriate in the below functions */
  4701. rv = ssl_gensecret(s, pms, pmslen);
  4702. } else {
  4703. /* Save premaster secret */
  4704. s->s3.tmp.pms = pms;
  4705. s->s3.tmp.pmslen = pmslen;
  4706. pms = NULL;
  4707. rv = 1;
  4708. }
  4709. err:
  4710. OPENSSL_clear_free(pms, pmslen);
  4711. EVP_PKEY_CTX_free(pctx);
  4712. return rv;
  4713. }
  4714. int ssl_encapsulate(SSL_CONNECTION *s, EVP_PKEY *pubkey,
  4715. unsigned char **ctp, size_t *ctlenp,
  4716. int gensecret)
  4717. {
  4718. int rv = 0;
  4719. unsigned char *pms = NULL, *ct = NULL;
  4720. size_t pmslen = 0, ctlen = 0;
  4721. EVP_PKEY_CTX *pctx;
  4722. SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
  4723. if (pubkey == NULL) {
  4724. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4725. return 0;
  4726. }
  4727. pctx = EVP_PKEY_CTX_new_from_pkey(sctx->libctx, pubkey, sctx->propq);
  4728. if (EVP_PKEY_encapsulate_init(pctx, NULL) <= 0
  4729. || EVP_PKEY_encapsulate(pctx, NULL, &ctlen, NULL, &pmslen) <= 0
  4730. || pmslen == 0 || ctlen == 0) {
  4731. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4732. goto err;
  4733. }
  4734. pms = OPENSSL_malloc(pmslen);
  4735. ct = OPENSSL_malloc(ctlen);
  4736. if (pms == NULL || ct == NULL) {
  4737. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_MALLOC_FAILURE);
  4738. goto err;
  4739. }
  4740. if (EVP_PKEY_encapsulate(pctx, ct, &ctlen, pms, &pmslen) <= 0) {
  4741. SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
  4742. goto err;
  4743. }
  4744. if (gensecret) {
  4745. /* SSLfatal() called as appropriate in the below functions */
  4746. rv = ssl_gensecret(s, pms, pmslen);
  4747. } else {
  4748. /* Save premaster secret */
  4749. s->s3.tmp.pms = pms;
  4750. s->s3.tmp.pmslen = pmslen;
  4751. pms = NULL;
  4752. rv = 1;
  4753. }
  4754. if (rv > 0) {
  4755. /* Pass ownership of ct to caller */
  4756. *ctp = ct;
  4757. *ctlenp = ctlen;
  4758. ct = NULL;
  4759. }
  4760. err:
  4761. OPENSSL_clear_free(pms, pmslen);
  4762. OPENSSL_free(ct);
  4763. EVP_PKEY_CTX_free(pctx);
  4764. return rv;
  4765. }
  4766. const char *SSL_group_to_name(SSL *s, int nid) {
  4767. int group_id = 0;
  4768. const TLS_GROUP_INFO *cinf = NULL;
  4769. /* first convert to real group id for internal and external IDs */
  4770. if (nid & TLSEXT_nid_unknown)
  4771. group_id = nid & 0xFFFF;
  4772. else
  4773. group_id = tls1_nid2group_id(nid);
  4774. /* then look up */
  4775. cinf = tls1_group_id_lookup(s->ctx, group_id);
  4776. if (cinf != NULL)
  4777. return cinf->tlsname;
  4778. return NULL;
  4779. }