s3_lib.c 129 KB

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