2
0

s3_lib.c 130 KB

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