s3_lib.c 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257
  1. /* ssl/s3_lib.c */
  2. /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  3. * All rights reserved.
  4. *
  5. * This package is an SSL implementation written
  6. * by Eric Young (eay@cryptsoft.com).
  7. * The implementation was written so as to conform with Netscapes SSL.
  8. *
  9. * This library is free for commercial and non-commercial use as long as
  10. * the following conditions are aheared to. The following conditions
  11. * apply to all code found in this distribution, be it the RC4, RSA,
  12. * lhash, DES, etc., code; not just the SSL code. The SSL documentation
  13. * included with this distribution is covered by the same copyright terms
  14. * except that the holder is Tim Hudson (tjh@cryptsoft.com).
  15. *
  16. * Copyright remains Eric Young's, and as such any Copyright notices in
  17. * the code are not to be removed.
  18. * If this package is used in a product, Eric Young should be given attribution
  19. * as the author of the parts of the library used.
  20. * This can be in the form of a textual message at program startup or
  21. * in documentation (online or textual) provided with the package.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. * 1. Redistributions of source code must retain the copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in the
  30. * documentation and/or other materials provided with the distribution.
  31. * 3. All advertising materials mentioning features or use of this software
  32. * must display the following acknowledgement:
  33. * "This product includes cryptographic software written by
  34. * Eric Young (eay@cryptsoft.com)"
  35. * The word 'cryptographic' can be left out if the rouines from the library
  36. * being used are not cryptographic related :-).
  37. * 4. If you include any Windows specific code (or a derivative thereof) from
  38. * the apps directory (application code) you must include an acknowledgement:
  39. * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
  40. *
  41. * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  42. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  43. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  44. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  45. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  46. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  47. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  49. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  50. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  51. * SUCH DAMAGE.
  52. *
  53. * The licence and distribution terms for any publically available version or
  54. * derivative of this code cannot be changed. i.e. this code cannot simply be
  55. * copied and put under another distribution licence
  56. * [including the GNU Public Licence.]
  57. */
  58. /* ====================================================================
  59. * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved.
  60. *
  61. * Redistribution and use in source and binary forms, with or without
  62. * modification, are permitted provided that the following conditions
  63. * are met:
  64. *
  65. * 1. Redistributions of source code must retain the above copyright
  66. * notice, this list of conditions and the following disclaimer.
  67. *
  68. * 2. Redistributions in binary form must reproduce the above copyright
  69. * notice, this list of conditions and the following disclaimer in
  70. * the documentation and/or other materials provided with the
  71. * distribution.
  72. *
  73. * 3. All advertising materials mentioning features or use of this
  74. * software must display the following acknowledgment:
  75. * "This product includes software developed by the OpenSSL Project
  76. * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
  77. *
  78. * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
  79. * endorse or promote products derived from this software without
  80. * prior written permission. For written permission, please contact
  81. * openssl-core@openssl.org.
  82. *
  83. * 5. Products derived from this software may not be called "OpenSSL"
  84. * nor may "OpenSSL" appear in their names without prior written
  85. * permission of the OpenSSL Project.
  86. *
  87. * 6. Redistributions of any form whatsoever must retain the following
  88. * acknowledgment:
  89. * "This product includes software developed by the OpenSSL Project
  90. * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
  91. *
  92. * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
  93. * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  94. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  95. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
  96. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  97. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  98. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  99. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  100. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  101. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  102. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  103. * OF THE POSSIBILITY OF SUCH DAMAGE.
  104. * ====================================================================
  105. *
  106. * This product includes cryptographic software written by Eric Young
  107. * (eay@cryptsoft.com). This product includes software written by Tim
  108. * Hudson (tjh@cryptsoft.com).
  109. *
  110. */
  111. /* ====================================================================
  112. * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
  113. *
  114. * Portions of the attached software ("Contribution") are developed by
  115. * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
  116. *
  117. * The Contribution is licensed pursuant to the OpenSSL open source
  118. * license provided above.
  119. *
  120. * ECC cipher suite support in OpenSSL originally written by
  121. * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.
  122. *
  123. */
  124. /* ====================================================================
  125. * Copyright 2005 Nokia. All rights reserved.
  126. *
  127. * The portions of the attached software ("Contribution") is developed by
  128. * Nokia Corporation and is licensed pursuant to the OpenSSL open source
  129. * license.
  130. *
  131. * The Contribution, originally written by Mika Kousa and Pasi Eronen of
  132. * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
  133. * support (see RFC 4279) to OpenSSL.
  134. *
  135. * No patent licenses or other rights except those expressly stated in
  136. * the OpenSSL open source license shall be deemed granted or received
  137. * expressly, by implication, estoppel, or otherwise.
  138. *
  139. * No assurances are provided by Nokia that the Contribution does not
  140. * infringe the patent or other intellectual property rights of any third
  141. * party or that the license provides you with all the necessary rights
  142. * to make use of the Contribution.
  143. *
  144. * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
  145. * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
  146. * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
  147. * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
  148. * OTHERWISE.
  149. */
  150. #include <stdio.h>
  151. #include <openssl/objects.h>
  152. #include "ssl_locl.h"
  153. #include "kssl_lcl.h"
  154. #ifndef OPENSSL_NO_TLSEXT
  155. #ifndef OPENSSL_NO_EC
  156. #include "../crypto/ec/ec_lcl.h"
  157. #endif /* OPENSSL_NO_EC */
  158. #endif /* OPENSSL_NO_TLSEXT */
  159. #include <openssl/md5.h>
  160. #ifndef OPENSSL_NO_DH
  161. #include <openssl/dh.h>
  162. #endif
  163. const char ssl3_version_str[]="SSLv3" OPENSSL_VERSION_PTEXT;
  164. #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER))
  165. /* list of available SSLv3 ciphers (sorted by id) */
  166. OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={
  167. /* The RSA ciphers */
  168. /* Cipher 01 */
  169. {
  170. 1,
  171. SSL3_TXT_RSA_NULL_MD5,
  172. SSL3_CK_RSA_NULL_MD5,
  173. SSL_kRSA,
  174. SSL_aRSA,
  175. SSL_eNULL,
  176. SSL_MD5,
  177. SSL_SSLV3,
  178. SSL_NOT_EXP|SSL_STRONG_NONE,
  179. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  180. 0,
  181. 0,
  182. },
  183. /* Cipher 02 */
  184. {
  185. 1,
  186. SSL3_TXT_RSA_NULL_SHA,
  187. SSL3_CK_RSA_NULL_SHA,
  188. SSL_kRSA,
  189. SSL_aRSA,
  190. SSL_eNULL,
  191. SSL_SHA1,
  192. SSL_SSLV3,
  193. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  194. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  195. 0,
  196. 0,
  197. },
  198. /* Cipher 03 */
  199. {
  200. 1,
  201. SSL3_TXT_RSA_RC4_40_MD5,
  202. SSL3_CK_RSA_RC4_40_MD5,
  203. SSL_kRSA,
  204. SSL_aRSA,
  205. SSL_RC4,
  206. SSL_MD5,
  207. SSL_SSLV3,
  208. SSL_EXPORT|SSL_EXP40,
  209. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  210. 40,
  211. 128,
  212. },
  213. /* Cipher 04 */
  214. {
  215. 1,
  216. SSL3_TXT_RSA_RC4_128_MD5,
  217. SSL3_CK_RSA_RC4_128_MD5,
  218. SSL_kRSA,
  219. SSL_aRSA,
  220. SSL_RC4,
  221. SSL_MD5,
  222. SSL_SSLV3,
  223. SSL_NOT_EXP|SSL_MEDIUM,
  224. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  225. 128,
  226. 128,
  227. },
  228. /* Cipher 05 */
  229. {
  230. 1,
  231. SSL3_TXT_RSA_RC4_128_SHA,
  232. SSL3_CK_RSA_RC4_128_SHA,
  233. SSL_kRSA,
  234. SSL_aRSA,
  235. SSL_RC4,
  236. SSL_SHA1,
  237. SSL_SSLV3,
  238. SSL_NOT_EXP|SSL_MEDIUM,
  239. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  240. 128,
  241. 128,
  242. },
  243. /* Cipher 06 */
  244. {
  245. 1,
  246. SSL3_TXT_RSA_RC2_40_MD5,
  247. SSL3_CK_RSA_RC2_40_MD5,
  248. SSL_kRSA,
  249. SSL_aRSA,
  250. SSL_RC2,
  251. SSL_MD5,
  252. SSL_SSLV3,
  253. SSL_EXPORT|SSL_EXP40,
  254. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  255. 40,
  256. 128,
  257. },
  258. /* Cipher 07 */
  259. #ifndef OPENSSL_NO_IDEA
  260. {
  261. 1,
  262. SSL3_TXT_RSA_IDEA_128_SHA,
  263. SSL3_CK_RSA_IDEA_128_SHA,
  264. SSL_kRSA,
  265. SSL_aRSA,
  266. SSL_IDEA,
  267. SSL_SHA1,
  268. SSL_SSLV3,
  269. SSL_NOT_EXP|SSL_MEDIUM,
  270. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  271. 128,
  272. 128,
  273. },
  274. #endif
  275. /* Cipher 08 */
  276. {
  277. 1,
  278. SSL3_TXT_RSA_DES_40_CBC_SHA,
  279. SSL3_CK_RSA_DES_40_CBC_SHA,
  280. SSL_kRSA,
  281. SSL_aRSA,
  282. SSL_DES,
  283. SSL_SHA1,
  284. SSL_SSLV3,
  285. SSL_EXPORT|SSL_EXP40,
  286. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  287. 40,
  288. 56,
  289. },
  290. /* Cipher 09 */
  291. {
  292. 1,
  293. SSL3_TXT_RSA_DES_64_CBC_SHA,
  294. SSL3_CK_RSA_DES_64_CBC_SHA,
  295. SSL_kRSA,
  296. SSL_aRSA,
  297. SSL_DES,
  298. SSL_SHA1,
  299. SSL_SSLV3,
  300. SSL_NOT_EXP|SSL_LOW,
  301. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  302. 56,
  303. 56,
  304. },
  305. /* Cipher 0A */
  306. {
  307. 1,
  308. SSL3_TXT_RSA_DES_192_CBC3_SHA,
  309. SSL3_CK_RSA_DES_192_CBC3_SHA,
  310. SSL_kRSA,
  311. SSL_aRSA,
  312. SSL_3DES,
  313. SSL_SHA1,
  314. SSL_SSLV3,
  315. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  316. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  317. 168,
  318. 168,
  319. },
  320. /* The DH ciphers */
  321. /* Cipher 0B */
  322. {
  323. 0,
  324. SSL3_TXT_DH_DSS_DES_40_CBC_SHA,
  325. SSL3_CK_DH_DSS_DES_40_CBC_SHA,
  326. SSL_kDHd,
  327. SSL_aDH,
  328. SSL_DES,
  329. SSL_SHA1,
  330. SSL_SSLV3,
  331. SSL_EXPORT|SSL_EXP40,
  332. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  333. 40,
  334. 56,
  335. },
  336. /* Cipher 0C */
  337. {
  338. 0, /* not implemented (non-ephemeral DH) */
  339. SSL3_TXT_DH_DSS_DES_64_CBC_SHA,
  340. SSL3_CK_DH_DSS_DES_64_CBC_SHA,
  341. SSL_kDHd,
  342. SSL_aDH,
  343. SSL_DES,
  344. SSL_SHA1,
  345. SSL_SSLV3,
  346. SSL_NOT_EXP|SSL_LOW,
  347. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  348. 56,
  349. 56,
  350. },
  351. /* Cipher 0D */
  352. {
  353. 0, /* not implemented (non-ephemeral DH) */
  354. SSL3_TXT_DH_DSS_DES_192_CBC3_SHA,
  355. SSL3_CK_DH_DSS_DES_192_CBC3_SHA,
  356. SSL_kDHd,
  357. SSL_aDH,
  358. SSL_3DES,
  359. SSL_SHA1,
  360. SSL_SSLV3,
  361. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  362. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  363. 168,
  364. 168,
  365. },
  366. /* Cipher 0E */
  367. {
  368. 0, /* not implemented (non-ephemeral DH) */
  369. SSL3_TXT_DH_RSA_DES_40_CBC_SHA,
  370. SSL3_CK_DH_RSA_DES_40_CBC_SHA,
  371. SSL_kDHr,
  372. SSL_aDH,
  373. SSL_DES,
  374. SSL_SHA1,
  375. SSL_SSLV3,
  376. SSL_EXPORT|SSL_EXP40,
  377. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  378. 40,
  379. 56,
  380. },
  381. /* Cipher 0F */
  382. {
  383. 0, /* not implemented (non-ephemeral DH) */
  384. SSL3_TXT_DH_RSA_DES_64_CBC_SHA,
  385. SSL3_CK_DH_RSA_DES_64_CBC_SHA,
  386. SSL_kDHr,
  387. SSL_aDH,
  388. SSL_DES,
  389. SSL_SHA1,
  390. SSL_SSLV3,
  391. SSL_NOT_EXP|SSL_LOW,
  392. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  393. 56,
  394. 56,
  395. },
  396. /* Cipher 10 */
  397. {
  398. 0, /* not implemented (non-ephemeral DH) */
  399. SSL3_TXT_DH_RSA_DES_192_CBC3_SHA,
  400. SSL3_CK_DH_RSA_DES_192_CBC3_SHA,
  401. SSL_kDHr,
  402. SSL_aDH,
  403. SSL_3DES,
  404. SSL_SHA1,
  405. SSL_SSLV3,
  406. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  407. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  408. 168,
  409. 168,
  410. },
  411. /* The Ephemeral DH ciphers */
  412. /* Cipher 11 */
  413. {
  414. 1,
  415. SSL3_TXT_EDH_DSS_DES_40_CBC_SHA,
  416. SSL3_CK_EDH_DSS_DES_40_CBC_SHA,
  417. SSL_kEDH,
  418. SSL_aDSS,
  419. SSL_DES,
  420. SSL_SHA1,
  421. SSL_SSLV3,
  422. SSL_EXPORT|SSL_EXP40,
  423. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  424. 40,
  425. 56,
  426. },
  427. /* Cipher 12 */
  428. {
  429. 1,
  430. SSL3_TXT_EDH_DSS_DES_64_CBC_SHA,
  431. SSL3_CK_EDH_DSS_DES_64_CBC_SHA,
  432. SSL_kEDH,
  433. SSL_aDSS,
  434. SSL_DES,
  435. SSL_SHA1,
  436. SSL_SSLV3,
  437. SSL_NOT_EXP|SSL_LOW,
  438. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  439. 56,
  440. 56,
  441. },
  442. /* Cipher 13 */
  443. {
  444. 1,
  445. SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA,
  446. SSL3_CK_EDH_DSS_DES_192_CBC3_SHA,
  447. SSL_kEDH,
  448. SSL_aDSS,
  449. SSL_3DES,
  450. SSL_SHA1,
  451. SSL_SSLV3,
  452. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  453. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  454. 168,
  455. 168,
  456. },
  457. /* Cipher 14 */
  458. {
  459. 1,
  460. SSL3_TXT_EDH_RSA_DES_40_CBC_SHA,
  461. SSL3_CK_EDH_RSA_DES_40_CBC_SHA,
  462. SSL_kEDH,
  463. SSL_aRSA,
  464. SSL_DES,
  465. SSL_SHA1,
  466. SSL_SSLV3,
  467. SSL_EXPORT|SSL_EXP40,
  468. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  469. 40,
  470. 56,
  471. },
  472. /* Cipher 15 */
  473. {
  474. 1,
  475. SSL3_TXT_EDH_RSA_DES_64_CBC_SHA,
  476. SSL3_CK_EDH_RSA_DES_64_CBC_SHA,
  477. SSL_kEDH,
  478. SSL_aRSA,
  479. SSL_DES,
  480. SSL_SHA1,
  481. SSL_SSLV3,
  482. SSL_NOT_EXP|SSL_LOW,
  483. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  484. 56,
  485. 56,
  486. },
  487. /* Cipher 16 */
  488. {
  489. 1,
  490. SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA,
  491. SSL3_CK_EDH_RSA_DES_192_CBC3_SHA,
  492. SSL_kEDH,
  493. SSL_aRSA,
  494. SSL_3DES,
  495. SSL_SHA1,
  496. SSL_SSLV3,
  497. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  498. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  499. 168,
  500. 168,
  501. },
  502. /* Cipher 17 */
  503. {
  504. 1,
  505. SSL3_TXT_ADH_RC4_40_MD5,
  506. SSL3_CK_ADH_RC4_40_MD5,
  507. SSL_kEDH,
  508. SSL_aNULL,
  509. SSL_RC4,
  510. SSL_MD5,
  511. SSL_SSLV3,
  512. SSL_EXPORT|SSL_EXP40,
  513. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  514. 40,
  515. 128,
  516. },
  517. /* Cipher 18 */
  518. {
  519. 1,
  520. SSL3_TXT_ADH_RC4_128_MD5,
  521. SSL3_CK_ADH_RC4_128_MD5,
  522. SSL_kEDH,
  523. SSL_aNULL,
  524. SSL_RC4,
  525. SSL_MD5,
  526. SSL_SSLV3,
  527. SSL_NOT_EXP|SSL_MEDIUM,
  528. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  529. 128,
  530. 128,
  531. },
  532. /* Cipher 19 */
  533. {
  534. 1,
  535. SSL3_TXT_ADH_DES_40_CBC_SHA,
  536. SSL3_CK_ADH_DES_40_CBC_SHA,
  537. SSL_kEDH,
  538. SSL_aNULL,
  539. SSL_DES,
  540. SSL_SHA1,
  541. SSL_SSLV3,
  542. SSL_EXPORT|SSL_EXP40,
  543. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  544. 40,
  545. 128,
  546. },
  547. /* Cipher 1A */
  548. {
  549. 1,
  550. SSL3_TXT_ADH_DES_64_CBC_SHA,
  551. SSL3_CK_ADH_DES_64_CBC_SHA,
  552. SSL_kEDH,
  553. SSL_aNULL,
  554. SSL_DES,
  555. SSL_SHA1,
  556. SSL_SSLV3,
  557. SSL_NOT_EXP|SSL_LOW,
  558. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  559. 56,
  560. 56,
  561. },
  562. /* Cipher 1B */
  563. {
  564. 1,
  565. SSL3_TXT_ADH_DES_192_CBC_SHA,
  566. SSL3_CK_ADH_DES_192_CBC_SHA,
  567. SSL_kEDH,
  568. SSL_aNULL,
  569. SSL_3DES,
  570. SSL_SHA1,
  571. SSL_SSLV3,
  572. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  573. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  574. 168,
  575. 168,
  576. },
  577. /* Fortezza ciphersuite from SSL 3.0 spec */
  578. #if 0
  579. /* Cipher 1C */
  580. {
  581. 0,
  582. SSL3_TXT_FZA_DMS_NULL_SHA,
  583. SSL3_CK_FZA_DMS_NULL_SHA,
  584. SSL_kFZA,
  585. SSL_aFZA,
  586. SSL_eNULL,
  587. SSL_SHA1,
  588. SSL_SSLV3,
  589. SSL_NOT_EXP|SSL_STRONG_NONE,
  590. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  591. 0,
  592. 0,
  593. },
  594. /* Cipher 1D */
  595. {
  596. 0,
  597. SSL3_TXT_FZA_DMS_FZA_SHA,
  598. SSL3_CK_FZA_DMS_FZA_SHA,
  599. SSL_kFZA,
  600. SSL_aFZA,
  601. SSL_eFZA,
  602. SSL_SHA1,
  603. SSL_SSLV3,
  604. SSL_NOT_EXP|SSL_STRONG_NONE,
  605. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  606. 0,
  607. 0,
  608. },
  609. /* Cipher 1E */
  610. {
  611. 0,
  612. SSL3_TXT_FZA_DMS_RC4_SHA,
  613. SSL3_CK_FZA_DMS_RC4_SHA,
  614. SSL_kFZA,
  615. SSL_aFZA,
  616. SSL_RC4,
  617. SSL_SHA1,
  618. SSL_SSLV3,
  619. SSL_NOT_EXP|SSL_MEDIUM,
  620. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  621. 128,
  622. 128,
  623. },
  624. #endif
  625. #ifndef OPENSSL_NO_KRB5
  626. /* The Kerberos ciphers*/
  627. /* Cipher 1E */
  628. {
  629. 1,
  630. SSL3_TXT_KRB5_DES_64_CBC_SHA,
  631. SSL3_CK_KRB5_DES_64_CBC_SHA,
  632. SSL_kKRB5,
  633. SSL_aKRB5,
  634. SSL_DES,
  635. SSL_SHA1,
  636. SSL_SSLV3,
  637. SSL_NOT_EXP|SSL_LOW,
  638. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  639. 56,
  640. 56,
  641. },
  642. /* Cipher 1F */
  643. {
  644. 1,
  645. SSL3_TXT_KRB5_DES_192_CBC3_SHA,
  646. SSL3_CK_KRB5_DES_192_CBC3_SHA,
  647. SSL_kKRB5,
  648. SSL_aKRB5,
  649. SSL_3DES,
  650. SSL_SHA1,
  651. SSL_SSLV3,
  652. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  653. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  654. 168,
  655. 168,
  656. },
  657. /* Cipher 20 */
  658. {
  659. 1,
  660. SSL3_TXT_KRB5_RC4_128_SHA,
  661. SSL3_CK_KRB5_RC4_128_SHA,
  662. SSL_kKRB5,
  663. SSL_aKRB5,
  664. SSL_RC4,
  665. SSL_SHA1,
  666. SSL_SSLV3,
  667. SSL_NOT_EXP|SSL_MEDIUM,
  668. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  669. 128,
  670. 128,
  671. },
  672. /* Cipher 21 */
  673. {
  674. 1,
  675. SSL3_TXT_KRB5_IDEA_128_CBC_SHA,
  676. SSL3_CK_KRB5_IDEA_128_CBC_SHA,
  677. SSL_kKRB5,
  678. SSL_aKRB5,
  679. SSL_IDEA,
  680. SSL_SHA1,
  681. SSL_SSLV3,
  682. SSL_NOT_EXP|SSL_MEDIUM,
  683. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  684. 128,
  685. 128,
  686. },
  687. /* Cipher 22 */
  688. {
  689. 1,
  690. SSL3_TXT_KRB5_DES_64_CBC_MD5,
  691. SSL3_CK_KRB5_DES_64_CBC_MD5,
  692. SSL_kKRB5,
  693. SSL_aKRB5,
  694. SSL_DES,
  695. SSL_MD5,
  696. SSL_SSLV3,
  697. SSL_NOT_EXP|SSL_LOW,
  698. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  699. 56,
  700. 56,
  701. },
  702. /* Cipher 23 */
  703. {
  704. 1,
  705. SSL3_TXT_KRB5_DES_192_CBC3_MD5,
  706. SSL3_CK_KRB5_DES_192_CBC3_MD5,
  707. SSL_kKRB5,
  708. SSL_aKRB5,
  709. SSL_3DES,
  710. SSL_MD5,
  711. SSL_SSLV3,
  712. SSL_NOT_EXP|SSL_HIGH,
  713. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  714. 168,
  715. 168,
  716. },
  717. /* Cipher 24 */
  718. {
  719. 1,
  720. SSL3_TXT_KRB5_RC4_128_MD5,
  721. SSL3_CK_KRB5_RC4_128_MD5,
  722. SSL_kKRB5,
  723. SSL_aKRB5,
  724. SSL_RC4,
  725. SSL_MD5,
  726. SSL_SSLV3,
  727. SSL_NOT_EXP|SSL_MEDIUM,
  728. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  729. 128,
  730. 128,
  731. },
  732. /* Cipher 25 */
  733. {
  734. 1,
  735. SSL3_TXT_KRB5_IDEA_128_CBC_MD5,
  736. SSL3_CK_KRB5_IDEA_128_CBC_MD5,
  737. SSL_kKRB5,
  738. SSL_aKRB5,
  739. SSL_IDEA,
  740. SSL_MD5,
  741. SSL_SSLV3,
  742. SSL_NOT_EXP|SSL_MEDIUM,
  743. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  744. 128,
  745. 128,
  746. },
  747. /* Cipher 26 */
  748. {
  749. 1,
  750. SSL3_TXT_KRB5_DES_40_CBC_SHA,
  751. SSL3_CK_KRB5_DES_40_CBC_SHA,
  752. SSL_kKRB5,
  753. SSL_aKRB5,
  754. SSL_DES,
  755. SSL_SHA1,
  756. SSL_SSLV3,
  757. SSL_EXPORT|SSL_EXP40,
  758. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  759. 40,
  760. 56,
  761. },
  762. /* Cipher 27 */
  763. {
  764. 1,
  765. SSL3_TXT_KRB5_RC2_40_CBC_SHA,
  766. SSL3_CK_KRB5_RC2_40_CBC_SHA,
  767. SSL_kKRB5,
  768. SSL_aKRB5,
  769. SSL_RC2,
  770. SSL_SHA1,
  771. SSL_SSLV3,
  772. SSL_EXPORT|SSL_EXP40,
  773. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  774. 40,
  775. 128,
  776. },
  777. /* Cipher 28 */
  778. {
  779. 1,
  780. SSL3_TXT_KRB5_RC4_40_SHA,
  781. SSL3_CK_KRB5_RC4_40_SHA,
  782. SSL_kKRB5,
  783. SSL_aKRB5,
  784. SSL_RC4,
  785. SSL_SHA1,
  786. SSL_SSLV3,
  787. SSL_EXPORT|SSL_EXP40,
  788. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  789. 40,
  790. 128,
  791. },
  792. /* Cipher 29 */
  793. {
  794. 1,
  795. SSL3_TXT_KRB5_DES_40_CBC_MD5,
  796. SSL3_CK_KRB5_DES_40_CBC_MD5,
  797. SSL_kKRB5,
  798. SSL_aKRB5,
  799. SSL_DES,
  800. SSL_MD5,
  801. SSL_SSLV3,
  802. SSL_EXPORT|SSL_EXP40,
  803. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  804. 40,
  805. 56,
  806. },
  807. /* Cipher 2A */
  808. {
  809. 1,
  810. SSL3_TXT_KRB5_RC2_40_CBC_MD5,
  811. SSL3_CK_KRB5_RC2_40_CBC_MD5,
  812. SSL_kKRB5,
  813. SSL_aKRB5,
  814. SSL_RC2,
  815. SSL_MD5,
  816. SSL_SSLV3,
  817. SSL_EXPORT|SSL_EXP40,
  818. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  819. 40,
  820. 128,
  821. },
  822. /* Cipher 2B */
  823. {
  824. 1,
  825. SSL3_TXT_KRB5_RC4_40_MD5,
  826. SSL3_CK_KRB5_RC4_40_MD5,
  827. SSL_kKRB5,
  828. SSL_aKRB5,
  829. SSL_RC4,
  830. SSL_MD5,
  831. SSL_SSLV3,
  832. SSL_EXPORT|SSL_EXP40,
  833. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  834. 40,
  835. 128,
  836. },
  837. #endif /* OPENSSL_NO_KRB5 */
  838. /* New AES ciphersuites */
  839. /* Cipher 2F */
  840. {
  841. 1,
  842. TLS1_TXT_RSA_WITH_AES_128_SHA,
  843. TLS1_CK_RSA_WITH_AES_128_SHA,
  844. SSL_kRSA,
  845. SSL_aRSA,
  846. SSL_AES128,
  847. SSL_SHA1,
  848. SSL_TLSV1,
  849. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  850. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  851. 128,
  852. 128,
  853. },
  854. /* Cipher 30 */
  855. {
  856. 0,
  857. TLS1_TXT_DH_DSS_WITH_AES_128_SHA,
  858. TLS1_CK_DH_DSS_WITH_AES_128_SHA,
  859. SSL_kDHd,
  860. SSL_aDH,
  861. SSL_AES128,
  862. SSL_SHA1,
  863. SSL_TLSV1,
  864. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  865. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  866. 128,
  867. 128,
  868. },
  869. /* Cipher 31 */
  870. {
  871. 0,
  872. TLS1_TXT_DH_RSA_WITH_AES_128_SHA,
  873. TLS1_CK_DH_RSA_WITH_AES_128_SHA,
  874. SSL_kDHr,
  875. SSL_aDH,
  876. SSL_AES128,
  877. SSL_SHA1,
  878. SSL_TLSV1,
  879. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  880. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  881. 128,
  882. 128,
  883. },
  884. /* Cipher 32 */
  885. {
  886. 1,
  887. TLS1_TXT_DHE_DSS_WITH_AES_128_SHA,
  888. TLS1_CK_DHE_DSS_WITH_AES_128_SHA,
  889. SSL_kEDH,
  890. SSL_aDSS,
  891. SSL_AES128,
  892. SSL_SHA1,
  893. SSL_TLSV1,
  894. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  895. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  896. 128,
  897. 128,
  898. },
  899. /* Cipher 33 */
  900. {
  901. 1,
  902. TLS1_TXT_DHE_RSA_WITH_AES_128_SHA,
  903. TLS1_CK_DHE_RSA_WITH_AES_128_SHA,
  904. SSL_kEDH,
  905. SSL_aRSA,
  906. SSL_AES128,
  907. SSL_SHA1,
  908. SSL_TLSV1,
  909. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  910. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  911. 128,
  912. 128,
  913. },
  914. /* Cipher 34 */
  915. {
  916. 1,
  917. TLS1_TXT_ADH_WITH_AES_128_SHA,
  918. TLS1_CK_ADH_WITH_AES_128_SHA,
  919. SSL_kEDH,
  920. SSL_aNULL,
  921. SSL_AES128,
  922. SSL_SHA1,
  923. SSL_TLSV1,
  924. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  925. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  926. 128,
  927. 128,
  928. },
  929. /* Cipher 35 */
  930. {
  931. 1,
  932. TLS1_TXT_RSA_WITH_AES_256_SHA,
  933. TLS1_CK_RSA_WITH_AES_256_SHA,
  934. SSL_kRSA,
  935. SSL_aRSA,
  936. SSL_AES256,
  937. SSL_SHA1,
  938. SSL_TLSV1,
  939. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  940. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  941. 256,
  942. 256,
  943. },
  944. /* Cipher 36 */
  945. {
  946. 0,
  947. TLS1_TXT_DH_DSS_WITH_AES_256_SHA,
  948. TLS1_CK_DH_DSS_WITH_AES_256_SHA,
  949. SSL_kDHd,
  950. SSL_aDH,
  951. SSL_AES256,
  952. SSL_SHA1,
  953. SSL_TLSV1,
  954. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  955. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  956. 256,
  957. 256,
  958. },
  959. /* Cipher 37 */
  960. {
  961. 0, /* not implemented (non-ephemeral DH) */
  962. TLS1_TXT_DH_RSA_WITH_AES_256_SHA,
  963. TLS1_CK_DH_RSA_WITH_AES_256_SHA,
  964. SSL_kDHr,
  965. SSL_aDH,
  966. SSL_AES256,
  967. SSL_SHA1,
  968. SSL_TLSV1,
  969. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  970. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  971. 256,
  972. 256,
  973. },
  974. /* Cipher 38 */
  975. {
  976. 1,
  977. TLS1_TXT_DHE_DSS_WITH_AES_256_SHA,
  978. TLS1_CK_DHE_DSS_WITH_AES_256_SHA,
  979. SSL_kEDH,
  980. SSL_aDSS,
  981. SSL_AES256,
  982. SSL_SHA1,
  983. SSL_TLSV1,
  984. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  985. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  986. 256,
  987. 256,
  988. },
  989. /* Cipher 39 */
  990. {
  991. 1,
  992. TLS1_TXT_DHE_RSA_WITH_AES_256_SHA,
  993. TLS1_CK_DHE_RSA_WITH_AES_256_SHA,
  994. SSL_kEDH,
  995. SSL_aRSA,
  996. SSL_AES256,
  997. SSL_SHA1,
  998. SSL_TLSV1,
  999. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1000. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1001. 256,
  1002. 256,
  1003. },
  1004. /* Cipher 3A */
  1005. {
  1006. 1,
  1007. TLS1_TXT_ADH_WITH_AES_256_SHA,
  1008. TLS1_CK_ADH_WITH_AES_256_SHA,
  1009. SSL_kEDH,
  1010. SSL_aNULL,
  1011. SSL_AES256,
  1012. SSL_SHA1,
  1013. SSL_TLSV1,
  1014. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1015. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1016. 256,
  1017. 256,
  1018. },
  1019. /* TLS v1.2 ciphersuites */
  1020. /* Cipher 3B */
  1021. {
  1022. 1,
  1023. TLS1_TXT_RSA_WITH_NULL_SHA256,
  1024. TLS1_CK_RSA_WITH_NULL_SHA256,
  1025. SSL_kRSA,
  1026. SSL_aRSA,
  1027. SSL_eNULL,
  1028. SSL_SHA256,
  1029. SSL_SSLV3,
  1030. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  1031. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1032. 0,
  1033. 0,
  1034. },
  1035. /* Cipher 3C */
  1036. {
  1037. 1,
  1038. TLS1_TXT_RSA_WITH_AES_128_SHA256,
  1039. TLS1_CK_RSA_WITH_AES_128_SHA256,
  1040. SSL_kRSA,
  1041. SSL_aRSA,
  1042. SSL_AES128,
  1043. SSL_SHA256,
  1044. SSL_TLSV1,
  1045. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1046. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1047. 128,
  1048. 128,
  1049. },
  1050. /* Cipher 3D */
  1051. {
  1052. 1,
  1053. TLS1_TXT_RSA_WITH_AES_256_SHA256,
  1054. TLS1_CK_RSA_WITH_AES_256_SHA256,
  1055. SSL_kRSA,
  1056. SSL_aRSA,
  1057. SSL_AES256,
  1058. SSL_SHA256,
  1059. SSL_TLSV1,
  1060. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1061. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1062. 256,
  1063. 256,
  1064. },
  1065. /* Cipher 3E */
  1066. {
  1067. 0, /* not implemented (non-ephemeral DH) */
  1068. TLS1_TXT_DH_DSS_WITH_AES_128_SHA256,
  1069. TLS1_CK_DH_DSS_WITH_AES_128_SHA256,
  1070. SSL_kDHr,
  1071. SSL_aDH,
  1072. SSL_AES128,
  1073. SSL_SHA256,
  1074. SSL_TLSV1,
  1075. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1076. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1077. 128,
  1078. 128,
  1079. },
  1080. /* Cipher 3F */
  1081. {
  1082. 0, /* not implemented (non-ephemeral DH) */
  1083. TLS1_TXT_DH_RSA_WITH_AES_128_SHA256,
  1084. TLS1_CK_DH_RSA_WITH_AES_128_SHA256,
  1085. SSL_kDHr,
  1086. SSL_aDH,
  1087. SSL_AES128,
  1088. SSL_SHA256,
  1089. SSL_TLSV1,
  1090. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1091. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1092. 128,
  1093. 128,
  1094. },
  1095. /* Cipher 40 */
  1096. {
  1097. 1,
  1098. TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256,
  1099. TLS1_CK_DHE_DSS_WITH_AES_128_SHA256,
  1100. SSL_kEDH,
  1101. SSL_aDSS,
  1102. SSL_AES128,
  1103. SSL_SHA256,
  1104. SSL_TLSV1,
  1105. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1106. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1107. 128,
  1108. 128,
  1109. },
  1110. #ifndef OPENSSL_NO_CAMELLIA
  1111. /* Camellia ciphersuites from RFC4132 (128-bit portion) */
  1112. /* Cipher 41 */
  1113. {
  1114. 1,
  1115. TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1116. TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1117. SSL_kRSA,
  1118. SSL_aRSA,
  1119. SSL_CAMELLIA128,
  1120. SSL_SHA1,
  1121. SSL_TLSV1,
  1122. SSL_NOT_EXP|SSL_HIGH,
  1123. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1124. 128,
  1125. 128,
  1126. },
  1127. /* Cipher 42 */
  1128. {
  1129. 0, /* not implemented (non-ephemeral DH) */
  1130. TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
  1131. TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA,
  1132. SSL_kDHd,
  1133. SSL_aDH,
  1134. SSL_CAMELLIA128,
  1135. SSL_SHA1,
  1136. SSL_TLSV1,
  1137. SSL_NOT_EXP|SSL_HIGH,
  1138. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1139. 128,
  1140. 128,
  1141. },
  1142. /* Cipher 43 */
  1143. {
  1144. 0, /* not implemented (non-ephemeral DH) */
  1145. TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1146. TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1147. SSL_kDHr,
  1148. SSL_aDH,
  1149. SSL_CAMELLIA128,
  1150. SSL_SHA1,
  1151. SSL_TLSV1,
  1152. SSL_NOT_EXP|SSL_HIGH,
  1153. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1154. 128,
  1155. 128,
  1156. },
  1157. /* Cipher 44 */
  1158. {
  1159. 1,
  1160. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
  1161. TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA,
  1162. SSL_kEDH,
  1163. SSL_aDSS,
  1164. SSL_CAMELLIA128,
  1165. SSL_SHA1,
  1166. SSL_TLSV1,
  1167. SSL_NOT_EXP|SSL_HIGH,
  1168. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1169. 128,
  1170. 128,
  1171. },
  1172. /* Cipher 45 */
  1173. {
  1174. 1,
  1175. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1176. TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA,
  1177. SSL_kEDH,
  1178. SSL_aRSA,
  1179. SSL_CAMELLIA128,
  1180. SSL_SHA1,
  1181. SSL_TLSV1,
  1182. SSL_NOT_EXP|SSL_HIGH,
  1183. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1184. 128,
  1185. 128,
  1186. },
  1187. /* Cipher 46 */
  1188. {
  1189. 1,
  1190. TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA,
  1191. TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA,
  1192. SSL_kEDH,
  1193. SSL_aNULL,
  1194. SSL_CAMELLIA128,
  1195. SSL_SHA1,
  1196. SSL_TLSV1,
  1197. SSL_NOT_EXP|SSL_HIGH,
  1198. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1199. 128,
  1200. 128,
  1201. },
  1202. #endif /* OPENSSL_NO_CAMELLIA */
  1203. #if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES
  1204. /* New TLS Export CipherSuites from expired ID */
  1205. #if 0
  1206. /* Cipher 60 */
  1207. {
  1208. 1,
  1209. TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5,
  1210. TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5,
  1211. SSL_kRSA,
  1212. SSL_aRSA,
  1213. SSL_RC4,
  1214. SSL_MD5,
  1215. SSL_TLSV1,
  1216. SSL_EXPORT|SSL_EXP56,
  1217. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1218. 56,
  1219. 128,
  1220. },
  1221. /* Cipher 61 */
  1222. {
  1223. 1,
  1224. TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5,
  1225. TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5,
  1226. SSL_kRSA,
  1227. SSL_aRSA,
  1228. SSL_RC2,
  1229. SSL_MD5,
  1230. SSL_TLSV1,
  1231. SSL_EXPORT|SSL_EXP56,
  1232. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1233. 56,
  1234. 128,
  1235. },
  1236. #endif
  1237. /* Cipher 62 */
  1238. {
  1239. 1,
  1240. TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA,
  1241. TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA,
  1242. SSL_kRSA,
  1243. SSL_aRSA,
  1244. SSL_DES,
  1245. SSL_SHA1,
  1246. SSL_TLSV1,
  1247. SSL_EXPORT|SSL_EXP56,
  1248. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1249. 56,
  1250. 56,
  1251. },
  1252. /* Cipher 63 */
  1253. {
  1254. 1,
  1255. TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA,
  1256. TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA,
  1257. SSL_kEDH,
  1258. SSL_aDSS,
  1259. SSL_DES,
  1260. SSL_SHA1,
  1261. SSL_TLSV1,
  1262. SSL_EXPORT|SSL_EXP56,
  1263. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1264. 56,
  1265. 56,
  1266. },
  1267. /* Cipher 64 */
  1268. {
  1269. 1,
  1270. TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA,
  1271. TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA,
  1272. SSL_kRSA,
  1273. SSL_aRSA,
  1274. SSL_RC4,
  1275. SSL_SHA1,
  1276. SSL_TLSV1,
  1277. SSL_EXPORT|SSL_EXP56,
  1278. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1279. 56,
  1280. 128,
  1281. },
  1282. /* Cipher 65 */
  1283. {
  1284. 1,
  1285. TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA,
  1286. TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA,
  1287. SSL_kEDH,
  1288. SSL_aDSS,
  1289. SSL_RC4,
  1290. SSL_SHA1,
  1291. SSL_TLSV1,
  1292. SSL_EXPORT|SSL_EXP56,
  1293. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1294. 56,
  1295. 128,
  1296. },
  1297. /* Cipher 66 */
  1298. {
  1299. 1,
  1300. TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA,
  1301. TLS1_CK_DHE_DSS_WITH_RC4_128_SHA,
  1302. SSL_kEDH,
  1303. SSL_aDSS,
  1304. SSL_RC4,
  1305. SSL_SHA1,
  1306. SSL_TLSV1,
  1307. SSL_NOT_EXP|SSL_MEDIUM,
  1308. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1309. 128,
  1310. 128,
  1311. },
  1312. #endif
  1313. /* TLS v1.2 ciphersuites */
  1314. /* Cipher 67 */
  1315. {
  1316. 1,
  1317. TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256,
  1318. TLS1_CK_DHE_RSA_WITH_AES_128_SHA256,
  1319. SSL_kEDH,
  1320. SSL_aRSA,
  1321. SSL_AES128,
  1322. SSL_SHA256,
  1323. SSL_TLSV1,
  1324. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1325. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1326. 128,
  1327. 128,
  1328. },
  1329. /* Cipher 68 */
  1330. {
  1331. 0, /* not implemented (non-ephemeral DH) */
  1332. TLS1_TXT_DH_DSS_WITH_AES_256_SHA256,
  1333. TLS1_CK_DH_DSS_WITH_AES_256_SHA256,
  1334. SSL_kDHr,
  1335. SSL_aDH,
  1336. SSL_AES256,
  1337. SSL_SHA256,
  1338. SSL_TLSV1,
  1339. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1340. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1341. 256,
  1342. 256,
  1343. },
  1344. /* Cipher 69 */
  1345. {
  1346. 0, /* not implemented (non-ephemeral DH) */
  1347. TLS1_TXT_DH_RSA_WITH_AES_256_SHA256,
  1348. TLS1_CK_DH_RSA_WITH_AES_256_SHA256,
  1349. SSL_kDHr,
  1350. SSL_aDH,
  1351. SSL_AES256,
  1352. SSL_SHA256,
  1353. SSL_TLSV1,
  1354. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1355. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1356. 256,
  1357. 256,
  1358. },
  1359. /* Cipher 6A */
  1360. {
  1361. 1,
  1362. TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256,
  1363. TLS1_CK_DHE_DSS_WITH_AES_256_SHA256,
  1364. SSL_kEDH,
  1365. SSL_aDSS,
  1366. SSL_AES256,
  1367. SSL_SHA256,
  1368. SSL_TLSV1,
  1369. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1370. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1371. 256,
  1372. 256,
  1373. },
  1374. /* Cipher 6B */
  1375. {
  1376. 1,
  1377. TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256,
  1378. TLS1_CK_DHE_RSA_WITH_AES_256_SHA256,
  1379. SSL_kEDH,
  1380. SSL_aRSA,
  1381. SSL_AES256,
  1382. SSL_SHA256,
  1383. SSL_TLSV1,
  1384. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1385. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1386. 256,
  1387. 256,
  1388. },
  1389. /* Cipher 6C */
  1390. {
  1391. 1,
  1392. TLS1_TXT_ADH_WITH_AES_128_SHA256,
  1393. TLS1_CK_ADH_WITH_AES_128_SHA256,
  1394. SSL_kEDH,
  1395. SSL_aNULL,
  1396. SSL_AES128,
  1397. SSL_SHA256,
  1398. SSL_TLSV1,
  1399. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1400. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1401. 128,
  1402. 128,
  1403. },
  1404. /* Cipher 6D */
  1405. {
  1406. 1,
  1407. TLS1_TXT_ADH_WITH_AES_256_SHA256,
  1408. TLS1_CK_ADH_WITH_AES_256_SHA256,
  1409. SSL_kEDH,
  1410. SSL_aNULL,
  1411. SSL_AES256,
  1412. SSL_SHA256,
  1413. SSL_TLSV1,
  1414. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1415. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1416. 256,
  1417. 256,
  1418. },
  1419. /* GOST Ciphersuites */
  1420. {
  1421. 1,
  1422. "GOST94-GOST89-GOST89",
  1423. 0x3000080,
  1424. SSL_kGOST,
  1425. SSL_aGOST94,
  1426. SSL_eGOST2814789CNT,
  1427. SSL_GOST89MAC,
  1428. SSL_TLSV1,
  1429. SSL_NOT_EXP|SSL_HIGH,
  1430. SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94|TLS1_STREAM_MAC,
  1431. 256,
  1432. 256
  1433. },
  1434. {
  1435. 1,
  1436. "GOST2001-GOST89-GOST89",
  1437. 0x3000081,
  1438. SSL_kGOST,
  1439. SSL_aGOST01,
  1440. SSL_eGOST2814789CNT,
  1441. SSL_GOST89MAC,
  1442. SSL_TLSV1,
  1443. SSL_NOT_EXP|SSL_HIGH,
  1444. SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94|TLS1_STREAM_MAC,
  1445. 256,
  1446. 256
  1447. },
  1448. {
  1449. 1,
  1450. "GOST94-NULL-GOST94",
  1451. 0x3000082,
  1452. SSL_kGOST,
  1453. SSL_aGOST94,
  1454. SSL_eNULL,
  1455. SSL_GOST94,
  1456. SSL_TLSV1,
  1457. SSL_NOT_EXP|SSL_STRONG_NONE,
  1458. SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94,
  1459. 0,
  1460. 0
  1461. },
  1462. {
  1463. 1,
  1464. "GOST2001-NULL-GOST94",
  1465. 0x3000083,
  1466. SSL_kGOST,
  1467. SSL_aGOST01,
  1468. SSL_eNULL,
  1469. SSL_GOST94,
  1470. SSL_TLSV1,
  1471. SSL_NOT_EXP|SSL_STRONG_NONE,
  1472. SSL_HANDSHAKE_MAC_GOST94|TLS1_PRF_GOST94,
  1473. 0,
  1474. 0
  1475. },
  1476. #ifndef OPENSSL_NO_CAMELLIA
  1477. /* Camellia ciphersuites from RFC4132 (256-bit portion) */
  1478. /* Cipher 84 */
  1479. {
  1480. 1,
  1481. TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1482. TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1483. SSL_kRSA,
  1484. SSL_aRSA,
  1485. SSL_CAMELLIA256,
  1486. SSL_SHA1,
  1487. SSL_TLSV1,
  1488. SSL_NOT_EXP|SSL_HIGH,
  1489. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1490. 256,
  1491. 256,
  1492. },
  1493. /* Cipher 85 */
  1494. {
  1495. 0, /* not implemented (non-ephemeral DH) */
  1496. TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
  1497. TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA,
  1498. SSL_kDHd,
  1499. SSL_aDH,
  1500. SSL_CAMELLIA256,
  1501. SSL_SHA1,
  1502. SSL_TLSV1,
  1503. SSL_NOT_EXP|SSL_HIGH,
  1504. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1505. 256,
  1506. 256,
  1507. },
  1508. /* Cipher 86 */
  1509. {
  1510. 0, /* not implemented (non-ephemeral DH) */
  1511. TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1512. TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1513. SSL_kDHr,
  1514. SSL_aDH,
  1515. SSL_CAMELLIA256,
  1516. SSL_SHA1,
  1517. SSL_TLSV1,
  1518. SSL_NOT_EXP|SSL_HIGH,
  1519. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1520. 256,
  1521. 256,
  1522. },
  1523. /* Cipher 87 */
  1524. {
  1525. 1,
  1526. TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
  1527. TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA,
  1528. SSL_kEDH,
  1529. SSL_aDSS,
  1530. SSL_CAMELLIA256,
  1531. SSL_SHA1,
  1532. SSL_TLSV1,
  1533. SSL_NOT_EXP|SSL_HIGH,
  1534. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1535. 256,
  1536. 256,
  1537. },
  1538. /* Cipher 88 */
  1539. {
  1540. 1,
  1541. TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1542. TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA,
  1543. SSL_kEDH,
  1544. SSL_aRSA,
  1545. SSL_CAMELLIA256,
  1546. SSL_SHA1,
  1547. SSL_TLSV1,
  1548. SSL_NOT_EXP|SSL_HIGH,
  1549. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1550. 256,
  1551. 256,
  1552. },
  1553. /* Cipher 89 */
  1554. {
  1555. 1,
  1556. TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA,
  1557. TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA,
  1558. SSL_kEDH,
  1559. SSL_aNULL,
  1560. SSL_CAMELLIA256,
  1561. SSL_SHA1,
  1562. SSL_TLSV1,
  1563. SSL_NOT_EXP|SSL_HIGH,
  1564. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1565. 256,
  1566. 256,
  1567. },
  1568. #endif /* OPENSSL_NO_CAMELLIA */
  1569. #ifndef OPENSSL_NO_PSK
  1570. /* Cipher 8A */
  1571. {
  1572. 1,
  1573. TLS1_TXT_PSK_WITH_RC4_128_SHA,
  1574. TLS1_CK_PSK_WITH_RC4_128_SHA,
  1575. SSL_kPSK,
  1576. SSL_aPSK,
  1577. SSL_RC4,
  1578. SSL_SHA1,
  1579. SSL_TLSV1,
  1580. SSL_NOT_EXP|SSL_MEDIUM,
  1581. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1582. 128,
  1583. 128,
  1584. },
  1585. /* Cipher 8B */
  1586. {
  1587. 1,
  1588. TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA,
  1589. TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA,
  1590. SSL_kPSK,
  1591. SSL_aPSK,
  1592. SSL_3DES,
  1593. SSL_SHA1,
  1594. SSL_TLSV1,
  1595. SSL_NOT_EXP|SSL_HIGH,
  1596. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1597. 168,
  1598. 168,
  1599. },
  1600. /* Cipher 8C */
  1601. {
  1602. 1,
  1603. TLS1_TXT_PSK_WITH_AES_128_CBC_SHA,
  1604. TLS1_CK_PSK_WITH_AES_128_CBC_SHA,
  1605. SSL_kPSK,
  1606. SSL_aPSK,
  1607. SSL_AES128,
  1608. SSL_SHA1,
  1609. SSL_TLSV1,
  1610. SSL_NOT_EXP|SSL_HIGH,
  1611. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1612. 128,
  1613. 128,
  1614. },
  1615. /* Cipher 8D */
  1616. {
  1617. 1,
  1618. TLS1_TXT_PSK_WITH_AES_256_CBC_SHA,
  1619. TLS1_CK_PSK_WITH_AES_256_CBC_SHA,
  1620. SSL_kPSK,
  1621. SSL_aPSK,
  1622. SSL_AES256,
  1623. SSL_SHA1,
  1624. SSL_TLSV1,
  1625. SSL_NOT_EXP|SSL_HIGH,
  1626. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1627. 256,
  1628. 256,
  1629. },
  1630. #endif /* OPENSSL_NO_PSK */
  1631. #ifndef OPENSSL_NO_SEED
  1632. /* SEED ciphersuites from RFC4162 */
  1633. /* Cipher 96 */
  1634. {
  1635. 1,
  1636. TLS1_TXT_RSA_WITH_SEED_SHA,
  1637. TLS1_CK_RSA_WITH_SEED_SHA,
  1638. SSL_kRSA,
  1639. SSL_aRSA,
  1640. SSL_SEED,
  1641. SSL_SHA1,
  1642. SSL_TLSV1,
  1643. SSL_NOT_EXP|SSL_MEDIUM,
  1644. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1645. 128,
  1646. 128,
  1647. },
  1648. /* Cipher 97 */
  1649. {
  1650. 0, /* not implemented (non-ephemeral DH) */
  1651. TLS1_TXT_DH_DSS_WITH_SEED_SHA,
  1652. TLS1_CK_DH_DSS_WITH_SEED_SHA,
  1653. SSL_kDHd,
  1654. SSL_aDH,
  1655. SSL_SEED,
  1656. SSL_SHA1,
  1657. SSL_TLSV1,
  1658. SSL_NOT_EXP|SSL_MEDIUM,
  1659. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1660. 128,
  1661. 128,
  1662. },
  1663. /* Cipher 98 */
  1664. {
  1665. 0, /* not implemented (non-ephemeral DH) */
  1666. TLS1_TXT_DH_RSA_WITH_SEED_SHA,
  1667. TLS1_CK_DH_RSA_WITH_SEED_SHA,
  1668. SSL_kDHr,
  1669. SSL_aDH,
  1670. SSL_SEED,
  1671. SSL_SHA1,
  1672. SSL_TLSV1,
  1673. SSL_NOT_EXP|SSL_MEDIUM,
  1674. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1675. 128,
  1676. 128,
  1677. },
  1678. /* Cipher 99 */
  1679. {
  1680. 1,
  1681. TLS1_TXT_DHE_DSS_WITH_SEED_SHA,
  1682. TLS1_CK_DHE_DSS_WITH_SEED_SHA,
  1683. SSL_kEDH,
  1684. SSL_aDSS,
  1685. SSL_SEED,
  1686. SSL_SHA1,
  1687. SSL_TLSV1,
  1688. SSL_NOT_EXP|SSL_MEDIUM,
  1689. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1690. 128,
  1691. 128,
  1692. },
  1693. /* Cipher 9A */
  1694. {
  1695. 1,
  1696. TLS1_TXT_DHE_RSA_WITH_SEED_SHA,
  1697. TLS1_CK_DHE_RSA_WITH_SEED_SHA,
  1698. SSL_kEDH,
  1699. SSL_aRSA,
  1700. SSL_SEED,
  1701. SSL_SHA1,
  1702. SSL_TLSV1,
  1703. SSL_NOT_EXP|SSL_MEDIUM,
  1704. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1705. 128,
  1706. 128,
  1707. },
  1708. /* Cipher 9B */
  1709. {
  1710. 1,
  1711. TLS1_TXT_ADH_WITH_SEED_SHA,
  1712. TLS1_CK_ADH_WITH_SEED_SHA,
  1713. SSL_kEDH,
  1714. SSL_aNULL,
  1715. SSL_SEED,
  1716. SSL_SHA1,
  1717. SSL_TLSV1,
  1718. SSL_NOT_EXP|SSL_MEDIUM,
  1719. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1720. 128,
  1721. 128,
  1722. },
  1723. #endif /* OPENSSL_NO_SEED */
  1724. /* GCM ciphersuites from RFC5288 */
  1725. /* Cipher 9C */
  1726. {
  1727. 1,
  1728. TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256,
  1729. TLS1_CK_RSA_WITH_AES_128_GCM_SHA256,
  1730. SSL_kRSA,
  1731. SSL_aRSA,
  1732. SSL_AES128GCM,
  1733. SSL_AEAD,
  1734. SSL_TLSV1_2,
  1735. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1736. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1737. 128,
  1738. 128,
  1739. },
  1740. /* Cipher 9D */
  1741. {
  1742. 1,
  1743. TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384,
  1744. TLS1_CK_RSA_WITH_AES_256_GCM_SHA384,
  1745. SSL_kRSA,
  1746. SSL_aRSA,
  1747. SSL_AES256GCM,
  1748. SSL_AEAD,
  1749. SSL_TLSV1_2,
  1750. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1751. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1752. 256,
  1753. 256,
  1754. },
  1755. /* Cipher 9E */
  1756. {
  1757. 1,
  1758. TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256,
  1759. TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256,
  1760. SSL_kEDH,
  1761. SSL_aRSA,
  1762. SSL_AES128GCM,
  1763. SSL_AEAD,
  1764. SSL_TLSV1_2,
  1765. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1766. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1767. 128,
  1768. 128,
  1769. },
  1770. /* Cipher 9F */
  1771. {
  1772. 1,
  1773. TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384,
  1774. TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384,
  1775. SSL_kEDH,
  1776. SSL_aRSA,
  1777. SSL_AES256GCM,
  1778. SSL_AEAD,
  1779. SSL_TLSV1_2,
  1780. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1781. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1782. 256,
  1783. 256,
  1784. },
  1785. /* Cipher A0 */
  1786. {
  1787. 0,
  1788. TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256,
  1789. TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256,
  1790. SSL_kDHr,
  1791. SSL_aDH,
  1792. SSL_AES128GCM,
  1793. SSL_AEAD,
  1794. SSL_TLSV1_2,
  1795. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1796. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1797. 128,
  1798. 128,
  1799. },
  1800. /* Cipher A1 */
  1801. {
  1802. 0,
  1803. TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384,
  1804. TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384,
  1805. SSL_kDHr,
  1806. SSL_aDH,
  1807. SSL_AES256GCM,
  1808. SSL_AEAD,
  1809. SSL_TLSV1_2,
  1810. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1811. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1812. 256,
  1813. 256,
  1814. },
  1815. /* Cipher A2 */
  1816. {
  1817. 1,
  1818. TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256,
  1819. TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256,
  1820. SSL_kEDH,
  1821. SSL_aDSS,
  1822. SSL_AES128GCM,
  1823. SSL_AEAD,
  1824. SSL_TLSV1_2,
  1825. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1826. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1827. 128,
  1828. 128,
  1829. },
  1830. /* Cipher A3 */
  1831. {
  1832. 1,
  1833. TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384,
  1834. TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384,
  1835. SSL_kEDH,
  1836. SSL_aDSS,
  1837. SSL_AES256GCM,
  1838. SSL_AEAD,
  1839. SSL_TLSV1_2,
  1840. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1841. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1842. 256,
  1843. 256,
  1844. },
  1845. /* Cipher A4 */
  1846. {
  1847. 0,
  1848. TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256,
  1849. TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256,
  1850. SSL_kDHr,
  1851. SSL_aDH,
  1852. SSL_AES128GCM,
  1853. SSL_AEAD,
  1854. SSL_TLSV1_2,
  1855. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1856. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1857. 128,
  1858. 128,
  1859. },
  1860. /* Cipher A5 */
  1861. {
  1862. 0,
  1863. TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384,
  1864. TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384,
  1865. SSL_kDHr,
  1866. SSL_aDH,
  1867. SSL_AES256GCM,
  1868. SSL_AEAD,
  1869. SSL_TLSV1_2,
  1870. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1871. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1872. 256,
  1873. 256,
  1874. },
  1875. /* Cipher A6 */
  1876. {
  1877. 1,
  1878. TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256,
  1879. TLS1_CK_ADH_WITH_AES_128_GCM_SHA256,
  1880. SSL_kEDH,
  1881. SSL_aNULL,
  1882. SSL_AES128GCM,
  1883. SSL_AEAD,
  1884. SSL_TLSV1_2,
  1885. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1886. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  1887. 128,
  1888. 128,
  1889. },
  1890. /* Cipher A7 */
  1891. {
  1892. 1,
  1893. TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384,
  1894. TLS1_CK_ADH_WITH_AES_256_GCM_SHA384,
  1895. SSL_kEDH,
  1896. SSL_aNULL,
  1897. SSL_AES256GCM,
  1898. SSL_AEAD,
  1899. SSL_TLSV1_2,
  1900. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1901. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  1902. 256,
  1903. 256,
  1904. },
  1905. #ifndef OPENSSL_NO_ECDH
  1906. /* Cipher C001 */
  1907. {
  1908. 1,
  1909. TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA,
  1910. TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA,
  1911. SSL_kECDHe,
  1912. SSL_aECDH,
  1913. SSL_eNULL,
  1914. SSL_SHA1,
  1915. SSL_TLSV1,
  1916. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  1917. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1918. 0,
  1919. 0,
  1920. },
  1921. /* Cipher C002 */
  1922. {
  1923. 1,
  1924. TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA,
  1925. TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA,
  1926. SSL_kECDHe,
  1927. SSL_aECDH,
  1928. SSL_RC4,
  1929. SSL_SHA1,
  1930. SSL_TLSV1,
  1931. SSL_NOT_EXP|SSL_MEDIUM,
  1932. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1933. 128,
  1934. 128,
  1935. },
  1936. /* Cipher C003 */
  1937. {
  1938. 1,
  1939. TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
  1940. TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA,
  1941. SSL_kECDHe,
  1942. SSL_aECDH,
  1943. SSL_3DES,
  1944. SSL_SHA1,
  1945. SSL_TLSV1,
  1946. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1947. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1948. 168,
  1949. 168,
  1950. },
  1951. /* Cipher C004 */
  1952. {
  1953. 1,
  1954. TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
  1955. TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA,
  1956. SSL_kECDHe,
  1957. SSL_aECDH,
  1958. SSL_AES128,
  1959. SSL_SHA1,
  1960. SSL_TLSV1,
  1961. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1962. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1963. 128,
  1964. 128,
  1965. },
  1966. /* Cipher C005 */
  1967. {
  1968. 1,
  1969. TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
  1970. TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA,
  1971. SSL_kECDHe,
  1972. SSL_aECDH,
  1973. SSL_AES256,
  1974. SSL_SHA1,
  1975. SSL_TLSV1,
  1976. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  1977. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1978. 256,
  1979. 256,
  1980. },
  1981. /* Cipher C006 */
  1982. {
  1983. 1,
  1984. TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA,
  1985. TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA,
  1986. SSL_kEECDH,
  1987. SSL_aECDSA,
  1988. SSL_eNULL,
  1989. SSL_SHA1,
  1990. SSL_TLSV1,
  1991. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  1992. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  1993. 0,
  1994. 0,
  1995. },
  1996. /* Cipher C007 */
  1997. {
  1998. 1,
  1999. TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA,
  2000. TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA,
  2001. SSL_kEECDH,
  2002. SSL_aECDSA,
  2003. SSL_RC4,
  2004. SSL_SHA1,
  2005. SSL_TLSV1,
  2006. SSL_NOT_EXP|SSL_MEDIUM,
  2007. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2008. 128,
  2009. 128,
  2010. },
  2011. /* Cipher C008 */
  2012. {
  2013. 1,
  2014. TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
  2015. TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA,
  2016. SSL_kEECDH,
  2017. SSL_aECDSA,
  2018. SSL_3DES,
  2019. SSL_SHA1,
  2020. SSL_TLSV1,
  2021. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2022. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2023. 168,
  2024. 168,
  2025. },
  2026. /* Cipher C009 */
  2027. {
  2028. 1,
  2029. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  2030. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
  2031. SSL_kEECDH,
  2032. SSL_aECDSA,
  2033. SSL_AES128,
  2034. SSL_SHA1,
  2035. SSL_TLSV1,
  2036. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2037. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2038. 128,
  2039. 128,
  2040. },
  2041. /* Cipher C00A */
  2042. {
  2043. 1,
  2044. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  2045. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
  2046. SSL_kEECDH,
  2047. SSL_aECDSA,
  2048. SSL_AES256,
  2049. SSL_SHA1,
  2050. SSL_TLSV1,
  2051. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2052. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2053. 256,
  2054. 256,
  2055. },
  2056. /* Cipher C00B */
  2057. {
  2058. 1,
  2059. TLS1_TXT_ECDH_RSA_WITH_NULL_SHA,
  2060. TLS1_CK_ECDH_RSA_WITH_NULL_SHA,
  2061. SSL_kECDHr,
  2062. SSL_aECDH,
  2063. SSL_eNULL,
  2064. SSL_SHA1,
  2065. SSL_TLSV1,
  2066. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  2067. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2068. 0,
  2069. 0,
  2070. },
  2071. /* Cipher C00C */
  2072. {
  2073. 1,
  2074. TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA,
  2075. TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA,
  2076. SSL_kECDHr,
  2077. SSL_aECDH,
  2078. SSL_RC4,
  2079. SSL_SHA1,
  2080. SSL_TLSV1,
  2081. SSL_NOT_EXP|SSL_MEDIUM,
  2082. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2083. 128,
  2084. 128,
  2085. },
  2086. /* Cipher C00D */
  2087. {
  2088. 1,
  2089. TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA,
  2090. TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA,
  2091. SSL_kECDHr,
  2092. SSL_aECDH,
  2093. SSL_3DES,
  2094. SSL_SHA1,
  2095. SSL_TLSV1,
  2096. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2097. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2098. 168,
  2099. 168,
  2100. },
  2101. /* Cipher C00E */
  2102. {
  2103. 1,
  2104. TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA,
  2105. TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA,
  2106. SSL_kECDHr,
  2107. SSL_aECDH,
  2108. SSL_AES128,
  2109. SSL_SHA1,
  2110. SSL_TLSV1,
  2111. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2112. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2113. 128,
  2114. 128,
  2115. },
  2116. /* Cipher C00F */
  2117. {
  2118. 1,
  2119. TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA,
  2120. TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA,
  2121. SSL_kECDHr,
  2122. SSL_aECDH,
  2123. SSL_AES256,
  2124. SSL_SHA1,
  2125. SSL_TLSV1,
  2126. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2127. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2128. 256,
  2129. 256,
  2130. },
  2131. /* Cipher C010 */
  2132. {
  2133. 1,
  2134. TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA,
  2135. TLS1_CK_ECDHE_RSA_WITH_NULL_SHA,
  2136. SSL_kEECDH,
  2137. SSL_aRSA,
  2138. SSL_eNULL,
  2139. SSL_SHA1,
  2140. SSL_TLSV1,
  2141. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  2142. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2143. 0,
  2144. 0,
  2145. },
  2146. /* Cipher C011 */
  2147. {
  2148. 1,
  2149. TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA,
  2150. TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA,
  2151. SSL_kEECDH,
  2152. SSL_aRSA,
  2153. SSL_RC4,
  2154. SSL_SHA1,
  2155. SSL_TLSV1,
  2156. SSL_NOT_EXP|SSL_MEDIUM,
  2157. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2158. 128,
  2159. 128,
  2160. },
  2161. /* Cipher C012 */
  2162. {
  2163. 1,
  2164. TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
  2165. TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA,
  2166. SSL_kEECDH,
  2167. SSL_aRSA,
  2168. SSL_3DES,
  2169. SSL_SHA1,
  2170. SSL_TLSV1,
  2171. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2172. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2173. 168,
  2174. 168,
  2175. },
  2176. /* Cipher C013 */
  2177. {
  2178. 1,
  2179. TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  2180. TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA,
  2181. SSL_kEECDH,
  2182. SSL_aRSA,
  2183. SSL_AES128,
  2184. SSL_SHA1,
  2185. SSL_TLSV1,
  2186. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2187. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2188. 128,
  2189. 128,
  2190. },
  2191. /* Cipher C014 */
  2192. {
  2193. 1,
  2194. TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  2195. TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA,
  2196. SSL_kEECDH,
  2197. SSL_aRSA,
  2198. SSL_AES256,
  2199. SSL_SHA1,
  2200. SSL_TLSV1,
  2201. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2202. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2203. 256,
  2204. 256,
  2205. },
  2206. /* Cipher C015 */
  2207. {
  2208. 1,
  2209. TLS1_TXT_ECDH_anon_WITH_NULL_SHA,
  2210. TLS1_CK_ECDH_anon_WITH_NULL_SHA,
  2211. SSL_kEECDH,
  2212. SSL_aNULL,
  2213. SSL_eNULL,
  2214. SSL_SHA1,
  2215. SSL_TLSV1,
  2216. SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS,
  2217. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2218. 0,
  2219. 0,
  2220. },
  2221. /* Cipher C016 */
  2222. {
  2223. 1,
  2224. TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA,
  2225. TLS1_CK_ECDH_anon_WITH_RC4_128_SHA,
  2226. SSL_kEECDH,
  2227. SSL_aNULL,
  2228. SSL_RC4,
  2229. SSL_SHA1,
  2230. SSL_TLSV1,
  2231. SSL_NOT_EXP|SSL_MEDIUM,
  2232. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2233. 128,
  2234. 128,
  2235. },
  2236. /* Cipher C017 */
  2237. {
  2238. 1,
  2239. TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA,
  2240. TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA,
  2241. SSL_kEECDH,
  2242. SSL_aNULL,
  2243. SSL_3DES,
  2244. SSL_SHA1,
  2245. SSL_TLSV1,
  2246. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2247. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2248. 168,
  2249. 168,
  2250. },
  2251. /* Cipher C018 */
  2252. {
  2253. 1,
  2254. TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA,
  2255. TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA,
  2256. SSL_kEECDH,
  2257. SSL_aNULL,
  2258. SSL_AES128,
  2259. SSL_SHA1,
  2260. SSL_TLSV1,
  2261. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2262. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2263. 128,
  2264. 128,
  2265. },
  2266. /* Cipher C019 */
  2267. {
  2268. 1,
  2269. TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA,
  2270. TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA,
  2271. SSL_kEECDH,
  2272. SSL_aNULL,
  2273. SSL_AES256,
  2274. SSL_SHA1,
  2275. SSL_TLSV1,
  2276. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2277. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2278. 256,
  2279. 256,
  2280. },
  2281. #endif /* OPENSSL_NO_ECDH */
  2282. #ifndef OPENSSL_NO_SRP
  2283. /* Cipher C01A */
  2284. {
  2285. 1,
  2286. TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
  2287. TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA,
  2288. SSL_kSRP,
  2289. SSL_aNULL,
  2290. SSL_3DES,
  2291. SSL_SHA1,
  2292. SSL_TLSV1,
  2293. SSL_NOT_EXP|SSL_HIGH,
  2294. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2295. 168,
  2296. 168,
  2297. },
  2298. /* Cipher C01B */
  2299. {
  2300. 1,
  2301. TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
  2302. TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA,
  2303. SSL_kSRP,
  2304. SSL_aRSA,
  2305. SSL_3DES,
  2306. SSL_SHA1,
  2307. SSL_TLSV1,
  2308. SSL_NOT_EXP|SSL_HIGH,
  2309. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2310. 168,
  2311. 168,
  2312. },
  2313. /* Cipher C01C */
  2314. {
  2315. 1,
  2316. TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
  2317. TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA,
  2318. SSL_kSRP,
  2319. SSL_aDSS,
  2320. SSL_3DES,
  2321. SSL_SHA1,
  2322. SSL_TLSV1,
  2323. SSL_NOT_EXP|SSL_HIGH,
  2324. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2325. 168,
  2326. 168,
  2327. },
  2328. /* Cipher C01D */
  2329. {
  2330. 1,
  2331. TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA,
  2332. TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA,
  2333. SSL_kSRP,
  2334. SSL_aNULL,
  2335. SSL_AES128,
  2336. SSL_SHA1,
  2337. SSL_TLSV1,
  2338. SSL_NOT_EXP|SSL_HIGH,
  2339. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2340. 128,
  2341. 128,
  2342. },
  2343. /* Cipher C01E */
  2344. {
  2345. 1,
  2346. TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
  2347. TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA,
  2348. SSL_kSRP,
  2349. SSL_aRSA,
  2350. SSL_AES128,
  2351. SSL_SHA1,
  2352. SSL_TLSV1,
  2353. SSL_NOT_EXP|SSL_HIGH,
  2354. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2355. 128,
  2356. 128,
  2357. },
  2358. /* Cipher C01F */
  2359. {
  2360. 1,
  2361. TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
  2362. TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA,
  2363. SSL_kSRP,
  2364. SSL_aDSS,
  2365. SSL_AES128,
  2366. SSL_SHA1,
  2367. SSL_TLSV1,
  2368. SSL_NOT_EXP|SSL_HIGH,
  2369. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2370. 128,
  2371. 128,
  2372. },
  2373. /* Cipher C020 */
  2374. {
  2375. 1,
  2376. TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA,
  2377. TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA,
  2378. SSL_kSRP,
  2379. SSL_aNULL,
  2380. SSL_AES256,
  2381. SSL_SHA1,
  2382. SSL_TLSV1,
  2383. SSL_NOT_EXP|SSL_HIGH,
  2384. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2385. 256,
  2386. 256,
  2387. },
  2388. /* Cipher C021 */
  2389. {
  2390. 1,
  2391. TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
  2392. TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA,
  2393. SSL_kSRP,
  2394. SSL_aRSA,
  2395. SSL_AES256,
  2396. SSL_SHA1,
  2397. SSL_TLSV1,
  2398. SSL_NOT_EXP|SSL_HIGH,
  2399. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2400. 256,
  2401. 256,
  2402. },
  2403. /* Cipher C022 */
  2404. {
  2405. 1,
  2406. TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
  2407. TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA,
  2408. SSL_kSRP,
  2409. SSL_aDSS,
  2410. SSL_AES256,
  2411. SSL_SHA1,
  2412. SSL_TLSV1,
  2413. SSL_NOT_EXP|SSL_HIGH,
  2414. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2415. 256,
  2416. 256,
  2417. },
  2418. #endif /* OPENSSL_NO_SRP */
  2419. #ifndef OPENSSL_NO_ECDH
  2420. /* HMAC based TLS v1.2 ciphersuites from RFC5289 */
  2421. /* Cipher C023 */
  2422. {
  2423. 1,
  2424. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256,
  2425. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256,
  2426. SSL_kEECDH,
  2427. SSL_aECDSA,
  2428. SSL_AES128,
  2429. SSL_SHA256,
  2430. SSL_TLSV1_2,
  2431. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2432. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2433. 128,
  2434. 128,
  2435. },
  2436. /* Cipher C024 */
  2437. {
  2438. 1,
  2439. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384,
  2440. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384,
  2441. SSL_kEECDH,
  2442. SSL_aECDSA,
  2443. SSL_AES256,
  2444. SSL_SHA384,
  2445. SSL_TLSV1_2,
  2446. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2447. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2448. 256,
  2449. 256,
  2450. },
  2451. /* Cipher C025 */
  2452. {
  2453. 1,
  2454. TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256,
  2455. TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256,
  2456. SSL_kECDHe,
  2457. SSL_aECDH,
  2458. SSL_AES128,
  2459. SSL_SHA256,
  2460. SSL_TLSV1_2,
  2461. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2462. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2463. 128,
  2464. 128,
  2465. },
  2466. /* Cipher C026 */
  2467. {
  2468. 1,
  2469. TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384,
  2470. TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384,
  2471. SSL_kECDHe,
  2472. SSL_aECDH,
  2473. SSL_AES256,
  2474. SSL_SHA384,
  2475. SSL_TLSV1_2,
  2476. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2477. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2478. 256,
  2479. 256,
  2480. },
  2481. /* Cipher C027 */
  2482. {
  2483. 1,
  2484. TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256,
  2485. TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256,
  2486. SSL_kEECDH,
  2487. SSL_aRSA,
  2488. SSL_AES128,
  2489. SSL_SHA256,
  2490. SSL_TLSV1_2,
  2491. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2492. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2493. 128,
  2494. 128,
  2495. },
  2496. /* Cipher C028 */
  2497. {
  2498. 1,
  2499. TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384,
  2500. TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384,
  2501. SSL_kEECDH,
  2502. SSL_aRSA,
  2503. SSL_AES256,
  2504. SSL_SHA384,
  2505. SSL_TLSV1_2,
  2506. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2507. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2508. 256,
  2509. 256,
  2510. },
  2511. /* Cipher C029 */
  2512. {
  2513. 1,
  2514. TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256,
  2515. TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256,
  2516. SSL_kECDHe,
  2517. SSL_aECDH,
  2518. SSL_AES128,
  2519. SSL_SHA256,
  2520. SSL_TLSV1_2,
  2521. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2522. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2523. 128,
  2524. 128,
  2525. },
  2526. /* Cipher C02A */
  2527. {
  2528. 1,
  2529. TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384,
  2530. TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384,
  2531. SSL_kECDHe,
  2532. SSL_aECDH,
  2533. SSL_AES256,
  2534. SSL_SHA384,
  2535. SSL_TLSV1_2,
  2536. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2537. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2538. 256,
  2539. 256,
  2540. },
  2541. /* GCM based TLS v1.2 ciphersuites from RFC5289 */
  2542. /* Cipher C02B */
  2543. {
  2544. 1,
  2545. TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  2546. TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
  2547. SSL_kEECDH,
  2548. SSL_aECDSA,
  2549. SSL_AES128GCM,
  2550. SSL_AEAD,
  2551. SSL_TLSV1_2,
  2552. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2553. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2554. 128,
  2555. 128,
  2556. },
  2557. /* Cipher C02C */
  2558. {
  2559. 1,
  2560. TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  2561. TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
  2562. SSL_kEECDH,
  2563. SSL_aECDSA,
  2564. SSL_AES256GCM,
  2565. SSL_AEAD,
  2566. SSL_TLSV1_2,
  2567. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2568. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2569. 256,
  2570. 256,
  2571. },
  2572. /* Cipher C02D */
  2573. {
  2574. 1,
  2575. TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
  2576. TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256,
  2577. SSL_kECDHe,
  2578. SSL_aECDH,
  2579. SSL_AES128GCM,
  2580. SSL_AEAD,
  2581. SSL_TLSV1_2,
  2582. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2583. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2584. 128,
  2585. 128,
  2586. },
  2587. /* Cipher C02E */
  2588. {
  2589. 1,
  2590. TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
  2591. TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384,
  2592. SSL_kECDHe,
  2593. SSL_aECDH,
  2594. SSL_AES256GCM,
  2595. SSL_AEAD,
  2596. SSL_TLSV1_2,
  2597. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2598. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2599. 256,
  2600. 256,
  2601. },
  2602. /* Cipher C02F */
  2603. {
  2604. 1,
  2605. TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  2606. TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
  2607. SSL_kEECDH,
  2608. SSL_aRSA,
  2609. SSL_AES128GCM,
  2610. SSL_AEAD,
  2611. SSL_TLSV1_2,
  2612. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2613. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2614. 128,
  2615. 128,
  2616. },
  2617. /* Cipher C030 */
  2618. {
  2619. 1,
  2620. TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  2621. TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
  2622. SSL_kEECDH,
  2623. SSL_aRSA,
  2624. SSL_AES256GCM,
  2625. SSL_AEAD,
  2626. SSL_TLSV1_2,
  2627. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2628. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2629. 256,
  2630. 256,
  2631. },
  2632. /* Cipher C031 */
  2633. {
  2634. 1,
  2635. TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256,
  2636. TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256,
  2637. SSL_kECDHe,
  2638. SSL_aECDH,
  2639. SSL_AES128GCM,
  2640. SSL_AEAD,
  2641. SSL_TLSV1_2,
  2642. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2643. SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256,
  2644. 128,
  2645. 128,
  2646. },
  2647. /* Cipher C032 */
  2648. {
  2649. 1,
  2650. TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384,
  2651. TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384,
  2652. SSL_kECDHe,
  2653. SSL_aECDH,
  2654. SSL_AES256GCM,
  2655. SSL_AEAD,
  2656. SSL_TLSV1_2,
  2657. SSL_NOT_EXP|SSL_HIGH|SSL_FIPS,
  2658. SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384,
  2659. 256,
  2660. 256,
  2661. },
  2662. #endif /* OPENSSL_NO_ECDH */
  2663. #ifdef TEMP_GOST_TLS
  2664. /* Cipher FF00 */
  2665. {
  2666. 1,
  2667. "GOST-MD5",
  2668. 0x0300ff00,
  2669. SSL_kRSA,
  2670. SSL_aRSA,
  2671. SSL_eGOST2814789CNT,
  2672. SSL_MD5,
  2673. SSL_TLSV1,
  2674. SSL_NOT_EXP|SSL_HIGH,
  2675. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2676. 256,
  2677. 256,
  2678. },
  2679. {
  2680. 1,
  2681. "GOST-GOST94",
  2682. 0x0300ff01,
  2683. SSL_kRSA,
  2684. SSL_aRSA,
  2685. SSL_eGOST2814789CNT,
  2686. SSL_GOST94,
  2687. SSL_TLSV1,
  2688. SSL_NOT_EXP|SSL_HIGH,
  2689. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2690. 256,
  2691. 256
  2692. },
  2693. {
  2694. 1,
  2695. "GOST-GOST89MAC",
  2696. 0x0300ff02,
  2697. SSL_kRSA,
  2698. SSL_aRSA,
  2699. SSL_eGOST2814789CNT,
  2700. SSL_GOST89MAC,
  2701. SSL_TLSV1,
  2702. SSL_NOT_EXP|SSL_HIGH,
  2703. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF,
  2704. 256,
  2705. 256
  2706. },
  2707. {
  2708. 1,
  2709. "GOST-GOST89STREAM",
  2710. 0x0300ff03,
  2711. SSL_kRSA,
  2712. SSL_aRSA,
  2713. SSL_eGOST2814789CNT,
  2714. SSL_GOST89MAC,
  2715. SSL_TLSV1,
  2716. SSL_NOT_EXP|SSL_HIGH,
  2717. SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF|TLS1_STREAM_MAC,
  2718. 256,
  2719. 256
  2720. },
  2721. #endif
  2722. /* end of list */
  2723. };
  2724. SSL3_ENC_METHOD SSLv3_enc_data={
  2725. ssl3_enc,
  2726. n_ssl3_mac,
  2727. ssl3_setup_key_block,
  2728. ssl3_generate_master_secret,
  2729. ssl3_change_cipher_state,
  2730. ssl3_final_finish_mac,
  2731. MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH,
  2732. ssl3_cert_verify_mac,
  2733. SSL3_MD_CLIENT_FINISHED_CONST,4,
  2734. SSL3_MD_SERVER_FINISHED_CONST,4,
  2735. ssl3_alert_code,
  2736. };
  2737. long ssl3_default_timeout(void)
  2738. {
  2739. /* 2 hours, the 24 hours mentioned in the SSLv3 spec
  2740. * is way too long for http, the cache would over fill */
  2741. return(60*60*2);
  2742. }
  2743. int ssl3_num_ciphers(void)
  2744. {
  2745. return(SSL3_NUM_CIPHERS);
  2746. }
  2747. const SSL_CIPHER *ssl3_get_cipher(unsigned int u)
  2748. {
  2749. if (u < SSL3_NUM_CIPHERS)
  2750. return(&(ssl3_ciphers[SSL3_NUM_CIPHERS-1-u]));
  2751. else
  2752. return(NULL);
  2753. }
  2754. int ssl3_pending(const SSL *s)
  2755. {
  2756. if (s->rstate == SSL_ST_READ_BODY)
  2757. return 0;
  2758. return (s->s3->rrec.type == SSL3_RT_APPLICATION_DATA) ? s->s3->rrec.length : 0;
  2759. }
  2760. int ssl3_new(SSL *s)
  2761. {
  2762. SSL3_STATE *s3;
  2763. if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
  2764. memset(s3,0,sizeof *s3);
  2765. memset(s3->rrec.seq_num,0,sizeof(s3->rrec.seq_num));
  2766. memset(s3->wrec.seq_num,0,sizeof(s3->wrec.seq_num));
  2767. s->s3=s3;
  2768. #ifndef OPENSSL_NO_SRP
  2769. SSL_SRP_CTX_init(s);
  2770. #endif
  2771. s->method->ssl_clear(s);
  2772. return(1);
  2773. err:
  2774. return(0);
  2775. }
  2776. void ssl3_free(SSL *s)
  2777. {
  2778. if(s == NULL)
  2779. return;
  2780. #ifdef TLSEXT_TYPE_opaque_prf_input
  2781. if (s->s3->client_opaque_prf_input != NULL)
  2782. OPENSSL_free(s->s3->client_opaque_prf_input);
  2783. if (s->s3->server_opaque_prf_input != NULL)
  2784. OPENSSL_free(s->s3->server_opaque_prf_input);
  2785. #endif
  2786. ssl3_cleanup_key_block(s);
  2787. if (s->s3->rbuf.buf != NULL)
  2788. ssl3_release_read_buffer(s);
  2789. if (s->s3->wbuf.buf != NULL)
  2790. ssl3_release_write_buffer(s);
  2791. if (s->s3->rrec.comp != NULL)
  2792. OPENSSL_free(s->s3->rrec.comp);
  2793. #ifndef OPENSSL_NO_DH
  2794. if (s->s3->tmp.dh != NULL)
  2795. DH_free(s->s3->tmp.dh);
  2796. #endif
  2797. #ifndef OPENSSL_NO_ECDH
  2798. if (s->s3->tmp.ecdh != NULL)
  2799. EC_KEY_free(s->s3->tmp.ecdh);
  2800. #endif
  2801. if (s->s3->tmp.ca_names != NULL)
  2802. sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
  2803. if (s->s3->handshake_buffer) {
  2804. BIO_free(s->s3->handshake_buffer);
  2805. }
  2806. if (s->s3->handshake_dgst) ssl3_free_digest_list(s);
  2807. #ifndef OPENSSL_NO_SRP
  2808. SSL_SRP_CTX_free(s);
  2809. #endif
  2810. OPENSSL_cleanse(s->s3,sizeof *s->s3);
  2811. OPENSSL_free(s->s3);
  2812. s->s3=NULL;
  2813. }
  2814. void ssl3_clear(SSL *s)
  2815. {
  2816. unsigned char *rp,*wp;
  2817. size_t rlen, wlen;
  2818. #ifdef TLSEXT_TYPE_opaque_prf_input
  2819. if (s->s3->client_opaque_prf_input != NULL)
  2820. OPENSSL_free(s->s3->client_opaque_prf_input);
  2821. s->s3->client_opaque_prf_input = NULL;
  2822. if (s->s3->server_opaque_prf_input != NULL)
  2823. OPENSSL_free(s->s3->server_opaque_prf_input);
  2824. s->s3->server_opaque_prf_input = NULL;
  2825. #endif
  2826. ssl3_cleanup_key_block(s);
  2827. if (s->s3->tmp.ca_names != NULL)
  2828. sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
  2829. if (s->s3->rrec.comp != NULL)
  2830. {
  2831. OPENSSL_free(s->s3->rrec.comp);
  2832. s->s3->rrec.comp=NULL;
  2833. }
  2834. #ifndef OPENSSL_NO_DH
  2835. if (s->s3->tmp.dh != NULL)
  2836. {
  2837. DH_free(s->s3->tmp.dh);
  2838. s->s3->tmp.dh = NULL;
  2839. }
  2840. #endif
  2841. #ifndef OPENSSL_NO_ECDH
  2842. if (s->s3->tmp.ecdh != NULL)
  2843. {
  2844. EC_KEY_free(s->s3->tmp.ecdh);
  2845. s->s3->tmp.ecdh = NULL;
  2846. }
  2847. #endif
  2848. rp = s->s3->rbuf.buf;
  2849. wp = s->s3->wbuf.buf;
  2850. rlen = s->s3->rbuf.len;
  2851. wlen = s->s3->wbuf.len;
  2852. if (s->s3->handshake_buffer) {
  2853. BIO_free(s->s3->handshake_buffer);
  2854. s->s3->handshake_buffer = NULL;
  2855. }
  2856. if (s->s3->handshake_dgst) {
  2857. ssl3_free_digest_list(s);
  2858. }
  2859. memset(s->s3,0,sizeof *s->s3);
  2860. s->s3->rbuf.buf = rp;
  2861. s->s3->wbuf.buf = wp;
  2862. s->s3->rbuf.len = rlen;
  2863. s->s3->wbuf.len = wlen;
  2864. ssl_free_wbio_buffer(s);
  2865. s->packet_length=0;
  2866. s->s3->renegotiate=0;
  2867. s->s3->total_renegotiations=0;
  2868. s->s3->num_renegotiations=0;
  2869. s->s3->in_read_app_data=0;
  2870. s->version=SSL3_VERSION;
  2871. #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
  2872. if (s->next_proto_negotiated)
  2873. {
  2874. OPENSSL_free(s->next_proto_negotiated);
  2875. s->next_proto_negotiated = NULL;
  2876. s->next_proto_negotiated_len = 0;
  2877. }
  2878. #endif
  2879. }
  2880. #ifndef OPENSSL_NO_SRP
  2881. static char * MS_CALLBACK srp_password_from_info_cb(SSL *s, void *arg)
  2882. {
  2883. return BUF_strdup(s->srp_ctx.info) ;
  2884. }
  2885. #endif
  2886. long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
  2887. {
  2888. int ret=0;
  2889. #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
  2890. if (
  2891. #ifndef OPENSSL_NO_RSA
  2892. cmd == SSL_CTRL_SET_TMP_RSA ||
  2893. cmd == SSL_CTRL_SET_TMP_RSA_CB ||
  2894. #endif
  2895. #ifndef OPENSSL_NO_DSA
  2896. cmd == SSL_CTRL_SET_TMP_DH ||
  2897. cmd == SSL_CTRL_SET_TMP_DH_CB ||
  2898. #endif
  2899. 0)
  2900. {
  2901. if (!ssl_cert_inst(&s->cert))
  2902. {
  2903. SSLerr(SSL_F_SSL3_CTRL, ERR_R_MALLOC_FAILURE);
  2904. return(0);
  2905. }
  2906. }
  2907. #endif
  2908. switch (cmd)
  2909. {
  2910. case SSL_CTRL_GET_SESSION_REUSED:
  2911. ret=s->hit;
  2912. break;
  2913. case SSL_CTRL_GET_CLIENT_CERT_REQUEST:
  2914. break;
  2915. case SSL_CTRL_GET_NUM_RENEGOTIATIONS:
  2916. ret=s->s3->num_renegotiations;
  2917. break;
  2918. case SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS:
  2919. ret=s->s3->num_renegotiations;
  2920. s->s3->num_renegotiations=0;
  2921. break;
  2922. case SSL_CTRL_GET_TOTAL_RENEGOTIATIONS:
  2923. ret=s->s3->total_renegotiations;
  2924. break;
  2925. case SSL_CTRL_GET_FLAGS:
  2926. ret=(int)(s->s3->flags);
  2927. break;
  2928. #ifndef OPENSSL_NO_RSA
  2929. case SSL_CTRL_NEED_TMP_RSA:
  2930. if ((s->cert != NULL) && (s->cert->rsa_tmp == NULL) &&
  2931. ((s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) ||
  2932. (EVP_PKEY_size(s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8))))
  2933. ret = 1;
  2934. break;
  2935. case SSL_CTRL_SET_TMP_RSA:
  2936. {
  2937. RSA *rsa = (RSA *)parg;
  2938. if (rsa == NULL)
  2939. {
  2940. SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
  2941. return(ret);
  2942. }
  2943. if ((rsa = RSAPrivateKey_dup(rsa)) == NULL)
  2944. {
  2945. SSLerr(SSL_F_SSL3_CTRL, ERR_R_RSA_LIB);
  2946. return(ret);
  2947. }
  2948. if (s->cert->rsa_tmp != NULL)
  2949. RSA_free(s->cert->rsa_tmp);
  2950. s->cert->rsa_tmp = rsa;
  2951. ret = 1;
  2952. }
  2953. break;
  2954. case SSL_CTRL_SET_TMP_RSA_CB:
  2955. {
  2956. SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  2957. return(ret);
  2958. }
  2959. break;
  2960. #endif
  2961. #ifndef OPENSSL_NO_DH
  2962. case SSL_CTRL_SET_TMP_DH:
  2963. {
  2964. DH *dh = (DH *)parg;
  2965. if (dh == NULL)
  2966. {
  2967. SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
  2968. return(ret);
  2969. }
  2970. if ((dh = DHparams_dup(dh)) == NULL)
  2971. {
  2972. SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
  2973. return(ret);
  2974. }
  2975. if (!(s->options & SSL_OP_SINGLE_DH_USE))
  2976. {
  2977. if (!DH_generate_key(dh))
  2978. {
  2979. DH_free(dh);
  2980. SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
  2981. return(ret);
  2982. }
  2983. }
  2984. if (s->cert->dh_tmp != NULL)
  2985. DH_free(s->cert->dh_tmp);
  2986. s->cert->dh_tmp = dh;
  2987. ret = 1;
  2988. }
  2989. break;
  2990. case SSL_CTRL_SET_TMP_DH_CB:
  2991. {
  2992. SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  2993. return(ret);
  2994. }
  2995. break;
  2996. #endif
  2997. #ifndef OPENSSL_NO_ECDH
  2998. case SSL_CTRL_SET_TMP_ECDH:
  2999. {
  3000. EC_KEY *ecdh = NULL;
  3001. if (parg == NULL)
  3002. {
  3003. SSLerr(SSL_F_SSL3_CTRL, ERR_R_PASSED_NULL_PARAMETER);
  3004. return(ret);
  3005. }
  3006. if (!EC_KEY_up_ref((EC_KEY *)parg))
  3007. {
  3008. SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB);
  3009. return(ret);
  3010. }
  3011. ecdh = (EC_KEY *)parg;
  3012. if (!(s->options & SSL_OP_SINGLE_ECDH_USE))
  3013. {
  3014. if (!EC_KEY_generate_key(ecdh))
  3015. {
  3016. EC_KEY_free(ecdh);
  3017. SSLerr(SSL_F_SSL3_CTRL,ERR_R_ECDH_LIB);
  3018. return(ret);
  3019. }
  3020. }
  3021. if (s->cert->ecdh_tmp != NULL)
  3022. EC_KEY_free(s->cert->ecdh_tmp);
  3023. s->cert->ecdh_tmp = ecdh;
  3024. ret = 1;
  3025. }
  3026. break;
  3027. case SSL_CTRL_SET_TMP_ECDH_CB:
  3028. {
  3029. SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3030. return(ret);
  3031. }
  3032. break;
  3033. #endif /* !OPENSSL_NO_ECDH */
  3034. #ifndef OPENSSL_NO_TLSEXT
  3035. case SSL_CTRL_SET_TLSEXT_HOSTNAME:
  3036. if (larg == TLSEXT_NAMETYPE_host_name)
  3037. {
  3038. if (s->tlsext_hostname != NULL)
  3039. OPENSSL_free(s->tlsext_hostname);
  3040. s->tlsext_hostname = NULL;
  3041. ret = 1;
  3042. if (parg == NULL)
  3043. break;
  3044. if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name)
  3045. {
  3046. SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME);
  3047. return 0;
  3048. }
  3049. if ((s->tlsext_hostname = BUF_strdup((char *)parg)) == NULL)
  3050. {
  3051. SSLerr(SSL_F_SSL3_CTRL, ERR_R_INTERNAL_ERROR);
  3052. return 0;
  3053. }
  3054. }
  3055. else
  3056. {
  3057. SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE);
  3058. return 0;
  3059. }
  3060. break;
  3061. case SSL_CTRL_SET_TLSEXT_DEBUG_ARG:
  3062. s->tlsext_debug_arg=parg;
  3063. ret = 1;
  3064. break;
  3065. #ifdef TLSEXT_TYPE_opaque_prf_input
  3066. case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT:
  3067. if (larg > 12288) /* actual internal limit is 2^16 for the complete hello message
  3068. * (including the cert chain and everything) */
  3069. {
  3070. SSLerr(SSL_F_SSL3_CTRL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG);
  3071. break;
  3072. }
  3073. if (s->tlsext_opaque_prf_input != NULL)
  3074. OPENSSL_free(s->tlsext_opaque_prf_input);
  3075. if ((size_t)larg == 0)
  3076. s->tlsext_opaque_prf_input = OPENSSL_malloc(1); /* dummy byte just to get non-NULL */
  3077. else
  3078. s->tlsext_opaque_prf_input = BUF_memdup(parg, (size_t)larg);
  3079. if (s->tlsext_opaque_prf_input != NULL)
  3080. {
  3081. s->tlsext_opaque_prf_input_len = (size_t)larg;
  3082. ret = 1;
  3083. }
  3084. else
  3085. s->tlsext_opaque_prf_input_len = 0;
  3086. break;
  3087. #endif
  3088. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE:
  3089. s->tlsext_status_type=larg;
  3090. ret = 1;
  3091. break;
  3092. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS:
  3093. *(STACK_OF(X509_EXTENSION) **)parg = s->tlsext_ocsp_exts;
  3094. ret = 1;
  3095. break;
  3096. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS:
  3097. s->tlsext_ocsp_exts = parg;
  3098. ret = 1;
  3099. break;
  3100. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS:
  3101. *(STACK_OF(OCSP_RESPID) **)parg = s->tlsext_ocsp_ids;
  3102. ret = 1;
  3103. break;
  3104. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS:
  3105. s->tlsext_ocsp_ids = parg;
  3106. ret = 1;
  3107. break;
  3108. case SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3109. *(unsigned char **)parg = s->tlsext_ocsp_resp;
  3110. return s->tlsext_ocsp_resplen;
  3111. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP:
  3112. if (s->tlsext_ocsp_resp)
  3113. OPENSSL_free(s->tlsext_ocsp_resp);
  3114. s->tlsext_ocsp_resp = parg;
  3115. s->tlsext_ocsp_resplen = larg;
  3116. ret = 1;
  3117. break;
  3118. #endif /* !OPENSSL_NO_TLSEXT */
  3119. default:
  3120. break;
  3121. }
  3122. return(ret);
  3123. }
  3124. long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp)(void))
  3125. {
  3126. int ret=0;
  3127. #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
  3128. if (
  3129. #ifndef OPENSSL_NO_RSA
  3130. cmd == SSL_CTRL_SET_TMP_RSA_CB ||
  3131. #endif
  3132. #ifndef OPENSSL_NO_DSA
  3133. cmd == SSL_CTRL_SET_TMP_DH_CB ||
  3134. #endif
  3135. 0)
  3136. {
  3137. if (!ssl_cert_inst(&s->cert))
  3138. {
  3139. SSLerr(SSL_F_SSL3_CALLBACK_CTRL, ERR_R_MALLOC_FAILURE);
  3140. return(0);
  3141. }
  3142. }
  3143. #endif
  3144. switch (cmd)
  3145. {
  3146. #ifndef OPENSSL_NO_RSA
  3147. case SSL_CTRL_SET_TMP_RSA_CB:
  3148. {
  3149. s->cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp;
  3150. }
  3151. break;
  3152. #endif
  3153. #ifndef OPENSSL_NO_DH
  3154. case SSL_CTRL_SET_TMP_DH_CB:
  3155. {
  3156. s->cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3157. }
  3158. break;
  3159. #endif
  3160. #ifndef OPENSSL_NO_ECDH
  3161. case SSL_CTRL_SET_TMP_ECDH_CB:
  3162. {
  3163. s->cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp;
  3164. }
  3165. break;
  3166. #endif
  3167. #ifndef OPENSSL_NO_TLSEXT
  3168. case SSL_CTRL_SET_TLSEXT_DEBUG_CB:
  3169. s->tlsext_debug_cb=(void (*)(SSL *,int ,int,
  3170. unsigned char *, int, void *))fp;
  3171. break;
  3172. #endif
  3173. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3174. {
  3175. s->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3176. }
  3177. break;
  3178. default:
  3179. break;
  3180. }
  3181. return(ret);
  3182. }
  3183. long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
  3184. {
  3185. CERT *cert;
  3186. cert=ctx->cert;
  3187. switch (cmd)
  3188. {
  3189. #ifndef OPENSSL_NO_RSA
  3190. case SSL_CTRL_NEED_TMP_RSA:
  3191. if ( (cert->rsa_tmp == NULL) &&
  3192. ((cert->pkeys[SSL_PKEY_RSA_ENC].privatekey == NULL) ||
  3193. (EVP_PKEY_size(cert->pkeys[SSL_PKEY_RSA_ENC].privatekey) > (512/8)))
  3194. )
  3195. return(1);
  3196. else
  3197. return(0);
  3198. /* break; */
  3199. case SSL_CTRL_SET_TMP_RSA:
  3200. {
  3201. RSA *rsa;
  3202. int i;
  3203. rsa=(RSA *)parg;
  3204. i=1;
  3205. if (rsa == NULL)
  3206. i=0;
  3207. else
  3208. {
  3209. if ((rsa=RSAPrivateKey_dup(rsa)) == NULL)
  3210. i=0;
  3211. }
  3212. if (!i)
  3213. {
  3214. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_RSA_LIB);
  3215. return(0);
  3216. }
  3217. else
  3218. {
  3219. if (cert->rsa_tmp != NULL)
  3220. RSA_free(cert->rsa_tmp);
  3221. cert->rsa_tmp=rsa;
  3222. return(1);
  3223. }
  3224. }
  3225. /* break; */
  3226. case SSL_CTRL_SET_TMP_RSA_CB:
  3227. {
  3228. SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3229. return(0);
  3230. }
  3231. break;
  3232. #endif
  3233. #ifndef OPENSSL_NO_DH
  3234. case SSL_CTRL_SET_TMP_DH:
  3235. {
  3236. DH *new=NULL,*dh;
  3237. dh=(DH *)parg;
  3238. if ((new=DHparams_dup(dh)) == NULL)
  3239. {
  3240. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
  3241. return 0;
  3242. }
  3243. if (!(ctx->options & SSL_OP_SINGLE_DH_USE))
  3244. {
  3245. if (!DH_generate_key(new))
  3246. {
  3247. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_DH_LIB);
  3248. DH_free(new);
  3249. return 0;
  3250. }
  3251. }
  3252. if (cert->dh_tmp != NULL)
  3253. DH_free(cert->dh_tmp);
  3254. cert->dh_tmp=new;
  3255. return 1;
  3256. }
  3257. /*break; */
  3258. case SSL_CTRL_SET_TMP_DH_CB:
  3259. {
  3260. SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3261. return(0);
  3262. }
  3263. break;
  3264. #endif
  3265. #ifndef OPENSSL_NO_ECDH
  3266. case SSL_CTRL_SET_TMP_ECDH:
  3267. {
  3268. EC_KEY *ecdh = NULL;
  3269. if (parg == NULL)
  3270. {
  3271. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB);
  3272. return 0;
  3273. }
  3274. ecdh = EC_KEY_dup((EC_KEY *)parg);
  3275. if (ecdh == NULL)
  3276. {
  3277. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_EC_LIB);
  3278. return 0;
  3279. }
  3280. if (!(ctx->options & SSL_OP_SINGLE_ECDH_USE))
  3281. {
  3282. if (!EC_KEY_generate_key(ecdh))
  3283. {
  3284. EC_KEY_free(ecdh);
  3285. SSLerr(SSL_F_SSL3_CTX_CTRL,ERR_R_ECDH_LIB);
  3286. return 0;
  3287. }
  3288. }
  3289. if (cert->ecdh_tmp != NULL)
  3290. {
  3291. EC_KEY_free(cert->ecdh_tmp);
  3292. }
  3293. cert->ecdh_tmp = ecdh;
  3294. return 1;
  3295. }
  3296. /* break; */
  3297. case SSL_CTRL_SET_TMP_ECDH_CB:
  3298. {
  3299. SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
  3300. return(0);
  3301. }
  3302. break;
  3303. #endif /* !OPENSSL_NO_ECDH */
  3304. #ifndef OPENSSL_NO_TLSEXT
  3305. case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
  3306. ctx->tlsext_servername_arg=parg;
  3307. break;
  3308. case SSL_CTRL_SET_TLSEXT_TICKET_KEYS:
  3309. case SSL_CTRL_GET_TLSEXT_TICKET_KEYS:
  3310. {
  3311. unsigned char *keys = parg;
  3312. if (!keys)
  3313. return 48;
  3314. if (larg != 48)
  3315. {
  3316. SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_TICKET_KEYS_LENGTH);
  3317. return 0;
  3318. }
  3319. if (cmd == SSL_CTRL_SET_TLSEXT_TICKET_KEYS)
  3320. {
  3321. memcpy(ctx->tlsext_tick_key_name, keys, 16);
  3322. memcpy(ctx->tlsext_tick_hmac_key, keys + 16, 16);
  3323. memcpy(ctx->tlsext_tick_aes_key, keys + 32, 16);
  3324. }
  3325. else
  3326. {
  3327. memcpy(keys, ctx->tlsext_tick_key_name, 16);
  3328. memcpy(keys + 16, ctx->tlsext_tick_hmac_key, 16);
  3329. memcpy(keys + 32, ctx->tlsext_tick_aes_key, 16);
  3330. }
  3331. return 1;
  3332. }
  3333. #ifdef TLSEXT_TYPE_opaque_prf_input
  3334. case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG:
  3335. ctx->tlsext_opaque_prf_input_callback_arg = parg;
  3336. return 1;
  3337. #endif
  3338. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
  3339. ctx->tlsext_status_arg=parg;
  3340. return 1;
  3341. break;
  3342. #ifndef OPENSSL_NO_SRP
  3343. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
  3344. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3345. if (ctx->srp_ctx.login != NULL)
  3346. OPENSSL_free(ctx->srp_ctx.login);
  3347. ctx->srp_ctx.login = NULL;
  3348. if (parg == NULL)
  3349. break;
  3350. if (strlen((char *)parg) > 254)
  3351. {
  3352. SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME);
  3353. return 0;
  3354. }
  3355. if ((ctx->srp_ctx.login = BUF_strdup((char *)parg)) == NULL)
  3356. {
  3357. SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR);
  3358. return 0;
  3359. }
  3360. break;
  3361. case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD:
  3362. ctx->srp_ctx.SRP_give_srp_client_pwd_callback=srp_password_from_info_cb;
  3363. ctx->srp_ctx.info=parg;
  3364. break;
  3365. case SSL_CTRL_SET_SRP_ARG:
  3366. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3367. ctx->srp_ctx.SRP_cb_arg=parg;
  3368. break;
  3369. case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH:
  3370. ctx->srp_ctx.strength=larg;
  3371. break;
  3372. #endif
  3373. #endif /* !OPENSSL_NO_TLSEXT */
  3374. /* A Thawte special :-) */
  3375. case SSL_CTRL_EXTRA_CHAIN_CERT:
  3376. if (ctx->extra_certs == NULL)
  3377. {
  3378. if ((ctx->extra_certs=sk_X509_new_null()) == NULL)
  3379. return(0);
  3380. }
  3381. sk_X509_push(ctx->extra_certs,(X509 *)parg);
  3382. break;
  3383. default:
  3384. return(0);
  3385. }
  3386. return(1);
  3387. }
  3388. long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void))
  3389. {
  3390. CERT *cert;
  3391. cert=ctx->cert;
  3392. switch (cmd)
  3393. {
  3394. #ifndef OPENSSL_NO_RSA
  3395. case SSL_CTRL_SET_TMP_RSA_CB:
  3396. {
  3397. cert->rsa_tmp_cb = (RSA *(*)(SSL *, int, int))fp;
  3398. }
  3399. break;
  3400. #endif
  3401. #ifndef OPENSSL_NO_DH
  3402. case SSL_CTRL_SET_TMP_DH_CB:
  3403. {
  3404. cert->dh_tmp_cb = (DH *(*)(SSL *, int, int))fp;
  3405. }
  3406. break;
  3407. #endif
  3408. #ifndef OPENSSL_NO_ECDH
  3409. case SSL_CTRL_SET_TMP_ECDH_CB:
  3410. {
  3411. cert->ecdh_tmp_cb = (EC_KEY *(*)(SSL *, int, int))fp;
  3412. }
  3413. break;
  3414. #endif
  3415. #ifndef OPENSSL_NO_TLSEXT
  3416. case SSL_CTRL_SET_TLSEXT_SERVERNAME_CB:
  3417. ctx->tlsext_servername_callback=(int (*)(SSL *,int *,void *))fp;
  3418. break;
  3419. #ifdef TLSEXT_TYPE_opaque_prf_input
  3420. case SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB:
  3421. ctx->tlsext_opaque_prf_input_callback = (int (*)(SSL *,void *, size_t, void *))fp;
  3422. break;
  3423. #endif
  3424. case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB:
  3425. ctx->tlsext_status_cb=(int (*)(SSL *,void *))fp;
  3426. break;
  3427. case SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB:
  3428. ctx->tlsext_ticket_key_cb=(int (*)(SSL *,unsigned char *,
  3429. unsigned char *,
  3430. EVP_CIPHER_CTX *,
  3431. HMAC_CTX *, int))fp;
  3432. break;
  3433. #ifndef OPENSSL_NO_SRP
  3434. case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB:
  3435. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3436. ctx->srp_ctx.SRP_verify_param_callback=(int (*)(SSL *,void *))fp;
  3437. break;
  3438. case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB:
  3439. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3440. ctx->srp_ctx.TLS_ext_srp_username_callback=(int (*)(SSL *,int *,void *))fp;
  3441. break;
  3442. case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB:
  3443. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3444. ctx->srp_ctx.SRP_give_srp_client_pwd_callback=(char *(*)(SSL *,void *))fp;
  3445. break;
  3446. case SSL_CTRL_SET_TLS_EXT_SRP_MISSING_CLIENT_USERNAME_CB:
  3447. ctx->srp_ctx.srp_Mask|=SSL_kSRP;
  3448. ctx->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback=(char *(*)(SSL *,void *))fp;
  3449. break;
  3450. #endif
  3451. #endif
  3452. case SSL_CTRL_SET_NOT_RESUMABLE_SESS_CB:
  3453. {
  3454. ctx->not_resumable_session_cb = (int (*)(SSL *, int))fp;
  3455. }
  3456. break;
  3457. default:
  3458. return(0);
  3459. }
  3460. return(1);
  3461. }
  3462. /* This function needs to check if the ciphers required are actually
  3463. * available */
  3464. const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p)
  3465. {
  3466. SSL_CIPHER c;
  3467. const SSL_CIPHER *cp;
  3468. unsigned long id;
  3469. id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1];
  3470. c.id=id;
  3471. cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS);
  3472. #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
  3473. if (cp == NULL) fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]);
  3474. #endif
  3475. if (cp == NULL || cp->valid == 0)
  3476. return NULL;
  3477. else
  3478. return cp;
  3479. }
  3480. int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p)
  3481. {
  3482. long l;
  3483. if (p != NULL)
  3484. {
  3485. l=c->id;
  3486. if ((l & 0xff000000) != 0x03000000) return(0);
  3487. p[0]=((unsigned char)(l>> 8L))&0xFF;
  3488. p[1]=((unsigned char)(l ))&0xFF;
  3489. }
  3490. return(2);
  3491. }
  3492. SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt,
  3493. STACK_OF(SSL_CIPHER) *srvr)
  3494. {
  3495. SSL_CIPHER *c,*ret=NULL;
  3496. STACK_OF(SSL_CIPHER) *prio, *allow;
  3497. int i,ii,ok;
  3498. #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC)
  3499. unsigned int j;
  3500. int ec_ok, ec_nid;
  3501. unsigned char ec_search1 = 0, ec_search2 = 0;
  3502. #endif
  3503. CERT *cert;
  3504. unsigned long alg_k,alg_a,mask_k,mask_a,emask_k,emask_a;
  3505. /* Let's see which ciphers we can support */
  3506. cert=s->cert;
  3507. #if 0
  3508. /* Do not set the compare functions, because this may lead to a
  3509. * reordering by "id". We want to keep the original ordering.
  3510. * We may pay a price in performance during sk_SSL_CIPHER_find(),
  3511. * but would have to pay with the price of sk_SSL_CIPHER_dup().
  3512. */
  3513. sk_SSL_CIPHER_set_cmp_func(srvr, ssl_cipher_ptr_id_cmp);
  3514. sk_SSL_CIPHER_set_cmp_func(clnt, ssl_cipher_ptr_id_cmp);
  3515. #endif
  3516. #ifdef CIPHER_DEBUG
  3517. printf("Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr);
  3518. for(i=0 ; i < sk_SSL_CIPHER_num(srvr) ; ++i)
  3519. {
  3520. c=sk_SSL_CIPHER_value(srvr,i);
  3521. printf("%p:%s\n",(void *)c,c->name);
  3522. }
  3523. printf("Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt);
  3524. for(i=0 ; i < sk_SSL_CIPHER_num(clnt) ; ++i)
  3525. {
  3526. c=sk_SSL_CIPHER_value(clnt,i);
  3527. printf("%p:%s\n",(void *)c,c->name);
  3528. }
  3529. #endif
  3530. if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE)
  3531. {
  3532. prio = srvr;
  3533. allow = clnt;
  3534. }
  3535. else
  3536. {
  3537. prio = clnt;
  3538. allow = srvr;
  3539. }
  3540. for (i=0; i<sk_SSL_CIPHER_num(prio); i++)
  3541. {
  3542. c=sk_SSL_CIPHER_value(prio,i);
  3543. /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */
  3544. if ((c->algorithm_ssl & SSL_TLSV1_2) &&
  3545. (TLS1_get_version(s) < TLS1_2_VERSION))
  3546. continue;
  3547. ssl_set_cert_masks(cert,c);
  3548. mask_k = cert->mask_k;
  3549. mask_a = cert->mask_a;
  3550. emask_k = cert->export_mask_k;
  3551. emask_a = cert->export_mask_a;
  3552. #ifndef OPENSSL_NO_SRP
  3553. mask_k=cert->mask_k | s->srp_ctx.srp_Mask;
  3554. emask_k=cert->export_mask_k | s->srp_ctx.srp_Mask;
  3555. #endif
  3556. #ifdef KSSL_DEBUG
  3557. /* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/
  3558. #endif /* KSSL_DEBUG */
  3559. alg_k=c->algorithm_mkey;
  3560. alg_a=c->algorithm_auth;
  3561. #ifndef OPENSSL_NO_KRB5
  3562. if (alg_k & SSL_kKRB5)
  3563. {
  3564. if ( !kssl_keytab_is_available(s->kssl_ctx) )
  3565. continue;
  3566. }
  3567. #endif /* OPENSSL_NO_KRB5 */
  3568. #ifndef OPENSSL_NO_PSK
  3569. /* with PSK there must be server callback set */
  3570. if ((alg_k & SSL_kPSK) && s->psk_server_callback == NULL)
  3571. continue;
  3572. #endif /* OPENSSL_NO_PSK */
  3573. if (SSL_C_IS_EXPORT(c))
  3574. {
  3575. ok = (alg_k & emask_k) && (alg_a & emask_a);
  3576. #ifdef CIPHER_DEBUG
  3577. printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a,
  3578. (void *)c,c->name);
  3579. #endif
  3580. }
  3581. else
  3582. {
  3583. ok = (alg_k & mask_k) && (alg_a & mask_a);
  3584. #ifdef CIPHER_DEBUG
  3585. printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c,
  3586. c->name);
  3587. #endif
  3588. }
  3589. #ifndef OPENSSL_NO_TLSEXT
  3590. #ifndef OPENSSL_NO_EC
  3591. if (
  3592. /* if we are considering an ECC cipher suite that uses our certificate */
  3593. (alg_a & SSL_aECDSA || alg_a & SSL_aECDH)
  3594. /* and we have an ECC certificate */
  3595. && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL)
  3596. /* and the client specified a Supported Point Formats extension */
  3597. && ((s->session->tlsext_ecpointformatlist_length > 0) && (s->session->tlsext_ecpointformatlist != NULL))
  3598. /* and our certificate's point is compressed */
  3599. && (
  3600. (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info != NULL)
  3601. && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key != NULL)
  3602. && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key != NULL)
  3603. && (s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data != NULL)
  3604. && (
  3605. (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED)
  3606. || (*(s->cert->pkeys[SSL_PKEY_ECC].x509->cert_info->key->public_key->data) == POINT_CONVERSION_COMPRESSED + 1)
  3607. )
  3608. )
  3609. )
  3610. {
  3611. ec_ok = 0;
  3612. /* if our certificate's curve is over a field type that the client does not support
  3613. * then do not allow this cipher suite to be negotiated */
  3614. if (
  3615. (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL)
  3616. && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL)
  3617. && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL)
  3618. && (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field)
  3619. )
  3620. {
  3621. for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++)
  3622. {
  3623. if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime)
  3624. {
  3625. ec_ok = 1;
  3626. break;
  3627. }
  3628. }
  3629. }
  3630. else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field)
  3631. {
  3632. for (j = 0; j < s->session->tlsext_ecpointformatlist_length; j++)
  3633. {
  3634. if (s->session->tlsext_ecpointformatlist[j] == TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2)
  3635. {
  3636. ec_ok = 1;
  3637. break;
  3638. }
  3639. }
  3640. }
  3641. ok = ok && ec_ok;
  3642. }
  3643. if (
  3644. /* if we are considering an ECC cipher suite that uses our certificate */
  3645. (alg_a & SSL_aECDSA || alg_a & SSL_aECDH)
  3646. /* and we have an ECC certificate */
  3647. && (s->cert->pkeys[SSL_PKEY_ECC].x509 != NULL)
  3648. /* and the client specified an EllipticCurves extension */
  3649. && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL))
  3650. )
  3651. {
  3652. ec_ok = 0;
  3653. if (
  3654. (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec != NULL)
  3655. && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group != NULL)
  3656. )
  3657. {
  3658. ec_nid = EC_GROUP_get_curve_name(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group);
  3659. if ((ec_nid == 0)
  3660. && (s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth != NULL)
  3661. )
  3662. {
  3663. if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_prime_field)
  3664. {
  3665. ec_search1 = 0xFF;
  3666. ec_search2 = 0x01;
  3667. }
  3668. else if (EC_METHOD_get_field_type(s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec->group->meth) == NID_X9_62_characteristic_two_field)
  3669. {
  3670. ec_search1 = 0xFF;
  3671. ec_search2 = 0x02;
  3672. }
  3673. }
  3674. else
  3675. {
  3676. ec_search1 = 0x00;
  3677. ec_search2 = tls1_ec_nid2curve_id(ec_nid);
  3678. }
  3679. if ((ec_search1 != 0) || (ec_search2 != 0))
  3680. {
  3681. for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++)
  3682. {
  3683. if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2))
  3684. {
  3685. ec_ok = 1;
  3686. break;
  3687. }
  3688. }
  3689. }
  3690. }
  3691. ok = ok && ec_ok;
  3692. }
  3693. if (
  3694. /* if we are considering an ECC cipher suite that uses an ephemeral EC key */
  3695. (alg_k & SSL_kEECDH)
  3696. /* and we have an ephemeral EC key */
  3697. && (s->cert->ecdh_tmp != NULL)
  3698. /* and the client specified an EllipticCurves extension */
  3699. && ((s->session->tlsext_ellipticcurvelist_length > 0) && (s->session->tlsext_ellipticcurvelist != NULL))
  3700. )
  3701. {
  3702. ec_ok = 0;
  3703. if (s->cert->ecdh_tmp->group != NULL)
  3704. {
  3705. ec_nid = EC_GROUP_get_curve_name(s->cert->ecdh_tmp->group);
  3706. if ((ec_nid == 0)
  3707. && (s->cert->ecdh_tmp->group->meth != NULL)
  3708. )
  3709. {
  3710. if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_prime_field)
  3711. {
  3712. ec_search1 = 0xFF;
  3713. ec_search2 = 0x01;
  3714. }
  3715. else if (EC_METHOD_get_field_type(s->cert->ecdh_tmp->group->meth) == NID_X9_62_characteristic_two_field)
  3716. {
  3717. ec_search1 = 0xFF;
  3718. ec_search2 = 0x02;
  3719. }
  3720. }
  3721. else
  3722. {
  3723. ec_search1 = 0x00;
  3724. ec_search2 = tls1_ec_nid2curve_id(ec_nid);
  3725. }
  3726. if ((ec_search1 != 0) || (ec_search2 != 0))
  3727. {
  3728. for (j = 0; j < s->session->tlsext_ellipticcurvelist_length / 2; j++)
  3729. {
  3730. if ((s->session->tlsext_ellipticcurvelist[2*j] == ec_search1) && (s->session->tlsext_ellipticcurvelist[2*j+1] == ec_search2))
  3731. {
  3732. ec_ok = 1;
  3733. break;
  3734. }
  3735. }
  3736. }
  3737. }
  3738. ok = ok && ec_ok;
  3739. }
  3740. #endif /* OPENSSL_NO_EC */
  3741. #endif /* OPENSSL_NO_TLSEXT */
  3742. if (!ok) continue;
  3743. ii=sk_SSL_CIPHER_find(allow,c);
  3744. if (ii >= 0)
  3745. {
  3746. ret=sk_SSL_CIPHER_value(allow,ii);
  3747. break;
  3748. }
  3749. }
  3750. return(ret);
  3751. }
  3752. int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
  3753. {
  3754. int ret=0;
  3755. unsigned long alg_k;
  3756. alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
  3757. #ifndef OPENSSL_NO_GOST
  3758. if (s->version >= TLS1_VERSION)
  3759. {
  3760. if (alg_k & SSL_kGOST)
  3761. {
  3762. p[ret++]=TLS_CT_GOST94_SIGN;
  3763. p[ret++]=TLS_CT_GOST01_SIGN;
  3764. return(ret);
  3765. }
  3766. }
  3767. #endif
  3768. #ifndef OPENSSL_NO_DH
  3769. if (alg_k & (SSL_kDHr|SSL_kEDH))
  3770. {
  3771. # ifndef OPENSSL_NO_RSA
  3772. p[ret++]=SSL3_CT_RSA_FIXED_DH;
  3773. # endif
  3774. # ifndef OPENSSL_NO_DSA
  3775. p[ret++]=SSL3_CT_DSS_FIXED_DH;
  3776. # endif
  3777. }
  3778. if ((s->version == SSL3_VERSION) &&
  3779. (alg_k & (SSL_kEDH|SSL_kDHd|SSL_kDHr)))
  3780. {
  3781. # ifndef OPENSSL_NO_RSA
  3782. p[ret++]=SSL3_CT_RSA_EPHEMERAL_DH;
  3783. # endif
  3784. # ifndef OPENSSL_NO_DSA
  3785. p[ret++]=SSL3_CT_DSS_EPHEMERAL_DH;
  3786. # endif
  3787. }
  3788. #endif /* !OPENSSL_NO_DH */
  3789. #ifndef OPENSSL_NO_RSA
  3790. p[ret++]=SSL3_CT_RSA_SIGN;
  3791. #endif
  3792. #ifndef OPENSSL_NO_DSA
  3793. p[ret++]=SSL3_CT_DSS_SIGN;
  3794. #endif
  3795. #ifndef OPENSSL_NO_ECDH
  3796. if ((alg_k & (SSL_kECDHr|SSL_kECDHe)) && (s->version >= TLS1_VERSION))
  3797. {
  3798. p[ret++]=TLS_CT_RSA_FIXED_ECDH;
  3799. p[ret++]=TLS_CT_ECDSA_FIXED_ECDH;
  3800. }
  3801. #endif
  3802. #ifndef OPENSSL_NO_ECDSA
  3803. /* ECDSA certs can be used with RSA cipher suites as well
  3804. * so we don't need to check for SSL_kECDH or SSL_kEECDH
  3805. */
  3806. if (s->version >= TLS1_VERSION)
  3807. {
  3808. p[ret++]=TLS_CT_ECDSA_SIGN;
  3809. }
  3810. #endif
  3811. return(ret);
  3812. }
  3813. int ssl3_shutdown(SSL *s)
  3814. {
  3815. int ret;
  3816. /* Don't do anything much if we have not done the handshake or
  3817. * we don't want to send messages :-) */
  3818. if ((s->quiet_shutdown) || (s->state == SSL_ST_BEFORE))
  3819. {
  3820. s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
  3821. return(1);
  3822. }
  3823. if (!(s->shutdown & SSL_SENT_SHUTDOWN))
  3824. {
  3825. s->shutdown|=SSL_SENT_SHUTDOWN;
  3826. #if 1
  3827. ssl3_send_alert(s,SSL3_AL_WARNING,SSL_AD_CLOSE_NOTIFY);
  3828. #endif
  3829. /* our shutdown alert has been sent now, and if it still needs
  3830. * to be written, s->s3->alert_dispatch will be true */
  3831. if (s->s3->alert_dispatch)
  3832. return(-1); /* return WANT_WRITE */
  3833. }
  3834. else if (s->s3->alert_dispatch)
  3835. {
  3836. /* resend it if not sent */
  3837. #if 1
  3838. ret=s->method->ssl_dispatch_alert(s);
  3839. if(ret == -1)
  3840. {
  3841. /* we only get to return -1 here the 2nd/Nth
  3842. * invocation, we must have already signalled
  3843. * return 0 upon a previous invoation,
  3844. * return WANT_WRITE */
  3845. return(ret);
  3846. }
  3847. #endif
  3848. }
  3849. else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
  3850. {
  3851. /* If we are waiting for a close from our peer, we are closed */
  3852. s->method->ssl_read_bytes(s,0,NULL,0,0);
  3853. if(!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
  3854. {
  3855. return(-1); /* return WANT_READ */
  3856. }
  3857. }
  3858. if ((s->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) &&
  3859. !s->s3->alert_dispatch)
  3860. return(1);
  3861. else
  3862. return(0);
  3863. }
  3864. int ssl3_write(SSL *s, const void *buf, int len)
  3865. {
  3866. int ret,n;
  3867. #if 0
  3868. if (s->shutdown & SSL_SEND_SHUTDOWN)
  3869. {
  3870. s->rwstate=SSL_NOTHING;
  3871. return(0);
  3872. }
  3873. #endif
  3874. clear_sys_error();
  3875. if (s->s3->renegotiate) ssl3_renegotiate_check(s);
  3876. /* This is an experimental flag that sends the
  3877. * last handshake message in the same packet as the first
  3878. * use data - used to see if it helps the TCP protocol during
  3879. * session-id reuse */
  3880. /* The second test is because the buffer may have been removed */
  3881. if ((s->s3->flags & SSL3_FLAGS_POP_BUFFER) && (s->wbio == s->bbio))
  3882. {
  3883. /* First time through, we write into the buffer */
  3884. if (s->s3->delay_buf_pop_ret == 0)
  3885. {
  3886. ret=ssl3_write_bytes(s,SSL3_RT_APPLICATION_DATA,
  3887. buf,len);
  3888. if (ret <= 0) return(ret);
  3889. s->s3->delay_buf_pop_ret=ret;
  3890. }
  3891. s->rwstate=SSL_WRITING;
  3892. n=BIO_flush(s->wbio);
  3893. if (n <= 0) return(n);
  3894. s->rwstate=SSL_NOTHING;
  3895. /* We have flushed the buffer, so remove it */
  3896. ssl_free_wbio_buffer(s);
  3897. s->s3->flags&= ~SSL3_FLAGS_POP_BUFFER;
  3898. ret=s->s3->delay_buf_pop_ret;
  3899. s->s3->delay_buf_pop_ret=0;
  3900. }
  3901. else
  3902. {
  3903. ret=s->method->ssl_write_bytes(s,SSL3_RT_APPLICATION_DATA,
  3904. buf,len);
  3905. if (ret <= 0) return(ret);
  3906. }
  3907. return(ret);
  3908. }
  3909. static int ssl3_read_internal(SSL *s, void *buf, int len, int peek)
  3910. {
  3911. int ret;
  3912. clear_sys_error();
  3913. if (s->s3->renegotiate) ssl3_renegotiate_check(s);
  3914. s->s3->in_read_app_data=1;
  3915. ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
  3916. if ((ret == -1) && (s->s3->in_read_app_data == 2))
  3917. {
  3918. /* ssl3_read_bytes decided to call s->handshake_func, which
  3919. * called ssl3_read_bytes to read handshake data.
  3920. * However, ssl3_read_bytes actually found application data
  3921. * and thinks that application data makes sense here; so disable
  3922. * handshake processing and try to read application data again. */
  3923. s->in_handshake++;
  3924. ret=s->method->ssl_read_bytes(s,SSL3_RT_APPLICATION_DATA,buf,len,peek);
  3925. s->in_handshake--;
  3926. }
  3927. else
  3928. s->s3->in_read_app_data=0;
  3929. return(ret);
  3930. }
  3931. int ssl3_read(SSL *s, void *buf, int len)
  3932. {
  3933. return ssl3_read_internal(s, buf, len, 0);
  3934. }
  3935. int ssl3_peek(SSL *s, void *buf, int len)
  3936. {
  3937. return ssl3_read_internal(s, buf, len, 1);
  3938. }
  3939. int ssl3_renegotiate(SSL *s)
  3940. {
  3941. if (s->handshake_func == NULL)
  3942. return(1);
  3943. if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)
  3944. return(0);
  3945. s->s3->renegotiate=1;
  3946. return(1);
  3947. }
  3948. int ssl3_renegotiate_check(SSL *s)
  3949. {
  3950. int ret=0;
  3951. if (s->s3->renegotiate)
  3952. {
  3953. if ( (s->s3->rbuf.left == 0) &&
  3954. (s->s3->wbuf.left == 0) &&
  3955. !SSL_in_init(s))
  3956. {
  3957. /*
  3958. if we are the server, and we have sent a 'RENEGOTIATE' message, we
  3959. need to go to SSL_ST_ACCEPT.
  3960. */
  3961. /* SSL_ST_ACCEPT */
  3962. s->state=SSL_ST_RENEGOTIATE;
  3963. s->s3->renegotiate=0;
  3964. s->s3->num_renegotiations++;
  3965. s->s3->total_renegotiations++;
  3966. ret=1;
  3967. }
  3968. }
  3969. return(ret);
  3970. }
  3971. /* If we are using TLS v1.2 or later and default SHA1+MD5 algorithms switch
  3972. * to new SHA256 PRF and handshake macs
  3973. */
  3974. long ssl_get_algorithm2(SSL *s)
  3975. {
  3976. long alg2 = s->s3->tmp.new_cipher->algorithm2;
  3977. if (TLS1_get_version(s) >= TLS1_2_VERSION &&
  3978. alg2 == (SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF))
  3979. return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;
  3980. return alg2;
  3981. }