2
0

s3_lib.c 123 KB

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