s3_lib.c 133 KB

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