s3_lib.c 131 KB

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