2
0

configure.ac 306 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588
  1. # configure.ac
  2. #
  3. # Copyright (C) 2006-2021 wolfSSL Inc.
  4. #
  5. # This file is part of wolfSSL. (formerly known as CyaSSL)
  6. #
  7. #
  8. AC_COPYRIGHT([Copyright (C) 2006-2020 wolfSSL Inc.])
  9. AC_PREREQ([2.69])
  10. AC_INIT([wolfssl],[5.6.3],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[https://www.wolfssl.com])
  11. AC_CONFIG_AUX_DIR([build-aux])
  12. # The following sets CFLAGS to empty if unset on command line. We do not
  13. # want the default "-g -O2" that AC_PROG_CC sets automatically.
  14. : ${CFLAGS=""}
  15. # Capture user C_EXTRA_FLAGS from configure line.
  16. # Use of C_EXTRA_FLAGS is deprecated because CFLAGS was fixed but someone
  17. # might still be using it.
  18. CFLAGS="$CFLAGS $C_EXTRA_FLAGS $C_FLAGS"
  19. AC_PROG_CC
  20. AM_PROG_CC_C_O
  21. AC_CANONICAL_HOST
  22. AC_CANONICAL_TARGET
  23. AC_CONFIG_MACRO_DIR([m4])
  24. AM_INIT_AUTOMAKE([1.14.1 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests])
  25. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  26. AC_ARG_PROGRAM
  27. AC_CONFIG_HEADERS([config.h:config.in])
  28. LT_PREREQ([2.4.2])
  29. LT_INIT([disable-static win32-dll])
  30. AC_ARG_VAR(EXTRA_CPPFLAGS, [Extra CPPFLAGS to add to end of autoconf-computed arg list. Can also supply directly to make.])
  31. AC_ARG_VAR(EXTRA_CFLAGS, [Extra CFLAGS to add to end of autoconf-computed arg list. Can also supply directly to make.])
  32. AC_ARG_VAR(EXTRA_CCASFLAGS, [Extra CCASFLAGS to add to end of autoconf-computed arg list. Can also supply directly to make.])
  33. AC_ARG_VAR(EXTRA_LDFLAGS, [Extra LDFLAGS to add to end of autoconf-computed arg list. Can also supply directly to make.])
  34. WOLFSSL_CONFIG_ARGS=$ac_configure_args
  35. AC_SUBST([WOLFSSL_CONFIG_ARGS])
  36. # shared library versioning
  37. # The three numbers in the libwolfssl.so.*.*.* file name. Unfortunately
  38. # these numbers don't always line up nicely with the library version.
  39. WOLFSSL_LIBRARY_VERSION_FIRST=40
  40. WOLFSSL_LIBRARY_VERSION_SECOND=0
  41. WOLFSSL_LIBRARY_VERSION_THIRD=0
  42. WOLFSSL_LIBRARY_VERSION=40:0:0
  43. # | | |
  44. # +------+ | +---+
  45. # | | |
  46. # current:revision:age
  47. # | | |
  48. # | | +- increment if interfaces have been added
  49. # | | set to zero if interfaces have been removed
  50. # | | or changed
  51. # | +- increment if source code has changed
  52. # | set to zero if current is incremented
  53. # +- increment if interfaces have been added, removed or changed
  54. AC_SUBST([WOLFSSL_LIBRARY_VERSION_FIRST])
  55. AC_SUBST([WOLFSSL_LIBRARY_VERSION_SECOND])
  56. AC_SUBST([WOLFSSL_LIBRARY_VERSION_THIRD])
  57. AC_SUBST([WOLFSSL_LIBRARY_VERSION])
  58. gl_VISIBILITY
  59. AS_IF([ test -n "$CFLAG_VISIBILITY" ], [
  60. AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
  61. ])
  62. WOLFSSL_BUILD_DATE=$(date -R)
  63. AC_SUBST([WOLFSSL_BUILD_DATE])
  64. # Moved these size of and type checks before the library checks.
  65. # The library checks add the library to subsequent test compiles
  66. # and in some rare cases, the networking check causes these sizeof
  67. # checks to fail.
  68. AC_CHECK_SIZEOF([long long])
  69. AC_CHECK_SIZEOF([long])
  70. AC_CHECK_SIZEOF([time_t])
  71. AC_CHECK_TYPES([__uint128_t])
  72. # Distro build feature subset (Debian, Ubuntu, etc.)
  73. AC_ARG_ENABLE([distro],
  74. [AS_HELP_STRING([--enable-distro],[Enable wolfSSL distro build (default: disabled)])],
  75. [ ENABLED_DISTRO=$enableval ],
  76. [ ENABLED_DISTRO=no ]
  77. )
  78. if test "$ENABLED_DISTRO" = "yes"
  79. then
  80. enable_shared=yes
  81. enable_static=yes
  82. enable_all=yes
  83. enable_earlydata=no
  84. REPRODUCIBLE_BUILD_DEFAULT=yes
  85. else
  86. REPRODUCIBLE_BUILD_DEFAULT=no
  87. fi
  88. AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h])
  89. AC_CHECK_LIB([network],[socket])
  90. AC_C_BIGENDIAN
  91. AC_C___ATOMIC
  92. AC_CHECK_HEADER(stdatomic.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ATOMIC_H"],[])
  93. # check if functions of interest are linkable, but also check if
  94. # they're declared by the expected headers, and if not, supersede the
  95. # unusable positive from AC_CHECK_FUNCS().
  96. AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit])
  97. AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit], [], [
  98. if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
  99. then
  100. AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
  101. eval "ac_cv_func_${as_decl_name}=no"
  102. _mask_varname=HAVE_`eval "echo '${as_decl_name}'" | tr 'a-z' 'A-Z'`
  103. sed --in-place "s~^#define ${_mask_varname} 1$~~" confdefs.h
  104. fi
  105. ], [[
  106. #ifdef HAVE_SYS_SOCKET_H
  107. #include <sys/socket.h>
  108. #endif
  109. #ifdef HAVE_STRING_H
  110. #include <string.h>
  111. #endif
  112. #ifdef HAVE_NETDB_H
  113. #include <netdb.h>
  114. #endif
  115. #ifdef HAVE_ARPA_INET_H
  116. #include <arpa/inet.h>
  117. #endif
  118. #ifdef HAVE_SYS_TIME_H
  119. #include <sys/time.h>
  120. #endif
  121. #ifdef HAVE_TIME_H
  122. #include <time.h>
  123. #endif
  124. #ifdef HAVE_STDLIB_H
  125. #include <stdlib.h>
  126. #endif
  127. ]])
  128. AC_PROG_INSTALL
  129. AC_TYPE_SIZE_T
  130. AC_TYPE_UINT8_T
  131. AC_TYPE_UINTPTR_T
  132. AM_PROG_AS
  133. OPTIMIZE_CFLAGS="-Os"
  134. OPTIMIZE_FAST_CFLAGS="-O2"
  135. OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET"
  136. DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
  137. LIB_ADD=
  138. LIB_STATIC_ADD=
  139. if test "$output_objdir" = ""
  140. then
  141. output_objdir=.
  142. fi
  143. # Thread local storage
  144. thread_ls_on="no"
  145. AC_ARG_ENABLE([threadlocal],
  146. [AS_HELP_STRING([--enable-threadlocal],[Enable thread local support (default: enabled)])],
  147. [ ENABLED_THREADLOCAL=$enableval ],
  148. [ ENABLED_THREADLOCAL=yes ]
  149. )
  150. if test "$ENABLED_THREADLOCAL" = "yes"
  151. then
  152. AX_TLS([thread_ls_on=yes],[thread_ls_on=no])
  153. AS_IF([test "x$thread_ls_on" = "xyes"],[AM_CFLAGS="$AM_CFLAGS -DHAVE_THREAD_LS"])
  154. fi
  155. # DEBUG
  156. AX_DEBUG
  157. AS_IF([test "$ax_enable_debug" = "yes"],
  158. [AM_CFLAGS="$AM_CFLAGS $DEBUG_CFLAGS"],
  159. [AM_CFLAGS="$AM_CFLAGS -DNDEBUG"])
  160. AS_IF([test "$ax_enable_debug" = "yes"],
  161. [AM_CCASFLAGS="$DEBUG_CFLAGS $AM_CCASFLAGS"],
  162. [AM_CCASFLAGS="$AM_CCASFLAGS -DNDEBUG"])
  163. # Start without certificates enabled and enable if a certificate algorithm is
  164. # enabled
  165. ENABLED_CERTS="no"
  166. # Implements requirements from RFC9325
  167. AC_ARG_ENABLE([harden-tls],
  168. [AS_HELP_STRING([--enable-harden-tls],[Enable requirements from RFC9325. Possible values are <yes>, <112>, or <128>. <yes> is equivalent to <112>. (default: disabled)])],
  169. [ ENABLED_HARDEN_TLS=$enableval ],
  170. [ ENABLED_HARDEN_TLS=no ]
  171. )
  172. if test "x$ENABLED_HARDEN_TLS" != "xno"
  173. then
  174. if test "x$ENABLED_HARDEN_TLS" = "xyes" || test "x$ENABLED_HARDEN_TLS" = "x112"
  175. then
  176. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HARDEN_TLS=112"
  177. elif test "x$ENABLED_HARDEN_TLS" = "x128"
  178. then
  179. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HARDEN_TLS=128"
  180. else
  181. AC_MSG_ERROR([Invalid value for --enable-harden-tls])
  182. fi
  183. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EXTRA_ALERTS -DWOLFSSL_CHECK_ALERT_ON_ERR"
  184. fi
  185. # Support for forcing 32-bit mode
  186. # To force 32-bit instructions use:
  187. # ./configure CFLAGS="-m32" LDFLAGS="-m32" && make
  188. # The checks for sizeof long and long/long are run at the top of configure and require "-m32" to be set directly in the ./configure statement.
  189. AC_ARG_ENABLE([32bit],
  190. [AS_HELP_STRING([--enable-32bit],[Enables 32-bit support (default: disabled)])],
  191. [ ENABLED_32BIT=$enableval ],
  192. [ ENABLED_32BIT=no ]
  193. )
  194. # 16-bit compiler support
  195. AC_ARG_ENABLE([16bit],
  196. [AS_HELP_STRING([--enable-16bit],[Enables 16-bit support (default: disabled)])],
  197. [ ENABLED_16BIT=$enableval ],
  198. [ ENABLED_16BIT=no ]
  199. )
  200. if test "$ENABLED_16BIT" = "yes"
  201. then
  202. AM_CFLAGS="$AM_CFLAGS -DWC_16BIT_CPU"
  203. fi
  204. AC_ARG_ENABLE([64bit],
  205. [AS_HELP_STRING([--enable-64bit],[Enables 64-bit support (default: disabled)])],
  206. [ ENABLED_64BIT=$enableval ],
  207. [ ENABLED_64BIT=no ]
  208. )
  209. AC_ARG_ENABLE([kdf],
  210. [AS_HELP_STRING([--enable-kdf],[Enables kdf support (default: enabled)])],
  211. [ ENABLED_KDF=$enableval ],
  212. [ ENABLED_KDF=yes ]
  213. )
  214. AC_ARG_ENABLE([hmac],
  215. [AS_HELP_STRING([--enable-hmac],[Enables HMAC support (default: enabled)])],
  216. [ ENABLED_HMAC=$enableval ],
  217. [ ENABLED_HMAC=yes ]
  218. )
  219. AC_ARG_ENABLE([do178],
  220. [AS_HELP_STRING([--enable-do178],[Enable DO-178, Will NOT work w/o DO178 license (default: disabled)])],
  221. [ENABLED_DO178=$enableval],
  222. [ENABLED_DO178="no"])
  223. if test "$ENABLED_DO178" = "no"
  224. then
  225. AM_CFLAGS="$AM_CFLAGS -DNO_DO178"
  226. else
  227. AM_CFLAGS="$AM_CFLAGS -DHAVE_DO178"
  228. fi
  229. # Support for disabling all ASM
  230. AC_ARG_ENABLE([asm],
  231. [AS_HELP_STRING([--enable-asm],[Enables option for assembly (default: enabled)])],
  232. [ ENABLED_ASM=$enableval ],
  233. [ ENABLED_ASM=yes ]
  234. )
  235. if test "$ENABLED_ASM" = "no"
  236. then
  237. AM_CFLAGS="$AM_CFLAGS -DTFM_NO_ASM -DWOLFSSL_NO_ASM"
  238. fi
  239. AC_SUBST([ENABLED_ASM])
  240. # Default math is SP Math all and not fast math
  241. # FIPS v1 and v2 must use fast math
  242. DEF_SP_MATH="yes"
  243. DEF_FAST_MATH="no"
  244. # FIPS 140
  245. AC_ARG_ENABLE([fips],
  246. [AS_HELP_STRING([--enable-fips],[Enable FIPS 140-2, Will NOT work w/o FIPS license (default: disabled)])],
  247. [ENABLED_FIPS=$enableval],
  248. [ENABLED_FIPS="no"])
  249. # wolfEngine Options
  250. AC_ARG_ENABLE([engine],
  251. [AS_HELP_STRING([--enable-engine],[Enable wolfEngine options (default: disabled)])],
  252. [ ENABLED_WOLFENGINE=$enableval ],
  253. [ ENABLED_WOLFENGINE=no ]
  254. )
  255. AS_CASE([$ENABLED_WOLFENGINE],
  256. [no],[
  257. ENABLED_WOLFENGINE="no"
  258. ],
  259. [disabled],[
  260. ENABLED_WOLFENGINE="no"
  261. ],
  262. [yes|fips-v2|cert3389],[
  263. ENABLED_WOLFENGINE="yes"
  264. ENABLED_FIPS="v2"
  265. ],
  266. [fips-v5],[
  267. ENABLED_WOLFENGINE="yes"
  268. ENABLED_FIPS="v5"
  269. ],
  270. [fips-ready],[
  271. ENABLED_WOLFENGINE="yes"
  272. ENABLED_FIPS="ready"
  273. ],
  274. [no-fips],[
  275. ENABLED_WOLFENGINE="yes"
  276. ENABLED_FIPS="no"
  277. ],
  278. [
  279. AC_MSG_ERROR([Invalid value for --enable-engine "$ENABLED_WOLFENGINE" (options: fips-v2, fips-ready, no-fips, no, disabled)])
  280. ])
  281. # The FIPS options are:
  282. # no - FIPS build disabled, FIPS sources forbidden in build tree
  283. # disabled - FIPS build disabled, FIPS sources ignored in build tree
  284. # v1 - FIPS 140-2 Cert 2425
  285. # default - same as v1
  286. # v2 - FIPS 140-2 Cert 3389
  287. # cert3389 - alias for v2
  288. # rand - wolfRand
  289. # v5-RC12 - FIPS 140-3, wolfCrypt/fips WCv5.0-RC12
  290. # v5 - currently, alias for v5-RC12
  291. # ready - FIPS 140-3 settings with in-tree wolfcrypt sources, feature locked
  292. # dev - FIPS 140-3 settings with in-tree wolfcrypt sources, features freely adjustable
  293. # v5-ready - Alias for ready.
  294. # v5-dev - Alias for dev.
  295. #
  296. # These options have been retired, but are listed here for historical reference:
  297. # v5-RC8 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC8).
  298. # HAVE_FIPS_VERSION = 5, HAVE_FIPS_VERSION_MINOR = 0.
  299. # v5-RC9 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC9)
  300. # HAVE_FIPS_VERSION = 5, HAVE_FIPS_VERSION_MINOR = 1.
  301. # v5-RC10 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC10
  302. # HAVE_FIPS_VERSION = 5, HAVE_FIPS_VERSION_MINOR = 2.
  303. # v5-RC11 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC11
  304. # HAVE_FIPS_VERSION = 5, HAVE_FIPS_VERSION_MINOR = 2.
  305. AS_CASE([$ENABLED_FIPS],
  306. [no],[
  307. FIPS_VERSION="none"
  308. ],
  309. [disabled],[
  310. FIPS_VERSION="disabled"
  311. ENABLED_FIPS="no"
  312. ],
  313. [v1|yes|cert2425],[
  314. FIPS_VERSION="v1"
  315. HAVE_FIPS_VERSION=1
  316. ENABLED_FIPS="yes"
  317. DEF_SP_MATH="no"
  318. DEF_FAST_MATH="yes"
  319. ],
  320. [v2|cert3389],[
  321. FIPS_VERSION="v2"
  322. HAVE_FIPS_VERSION=2
  323. HAVE_FIPS_VERSION_MINOR=0
  324. ENABLED_FIPS="yes"
  325. DEF_SP_MATH="no"
  326. DEF_FAST_MATH="yes"
  327. ],
  328. [rand],[
  329. FIPS_VERSION="rand"
  330. HAVE_FIPS_VERSION=2
  331. HAVE_FIPS_VERSION_MINOR=1
  332. ENABLED_FIPS="yes"
  333. DEF_SP_MATH="no"
  334. DEF_FAST_MATH="no"
  335. ],
  336. [v5|v5-RC12],[
  337. FIPS_VERSION="v5-RC12"
  338. HAVE_FIPS_VERSION=5
  339. HAVE_FIPS_VERSION_MINOR=2
  340. ENABLED_FIPS="yes"
  341. DEF_SP_MATH="no"
  342. DEF_FAST_MATH="yes"
  343. ],
  344. [ready|v5-ready],[
  345. FIPS_VERSION="ready"
  346. HAVE_FIPS_VERSION=5
  347. HAVE_FIPS_VERSION_MINOR=3
  348. ENABLED_FIPS="yes"
  349. DEF_SP_MATH="no"
  350. DEF_FAST_MATH="yes"
  351. ],
  352. [dev|v5-dev],[
  353. FIPS_VERSION="dev"
  354. HAVE_FIPS_VERSION=5
  355. HAVE_FIPS_VERSION_MINOR=3
  356. ENABLED_FIPS="yes"
  357. # for dev, DEF_SP_MATH and DEF_FAST_MATH follow non-FIPS defaults (currently sp-math-all)
  358. ],
  359. [
  360. AC_MSG_ERROR([Invalid value for --enable-fips "$ENABLED_FIPS" (main options: v1, v2, v5, ready, dev, rand, no, disabled)])
  361. ])
  362. if test -z "$HAVE_FIPS_VERSION_MINOR"
  363. then
  364. HAVE_FIPS_VERSION_MINOR=0
  365. fi
  366. if test -z "$HAVE_FIPS_VERSION"
  367. then
  368. HAVE_FIPS_VERSION=0
  369. fi
  370. if test "$ENABLED_FIPS" != "no"
  371. then
  372. REPRODUCIBLE_BUILD_DEFAULT=yes
  373. fi
  374. AS_CASE([$FIPS_VERSION],
  375. [none],
  376. [
  377. AS_IF([ test -s $srcdir/wolfcrypt/src/fips.c ],
  378. [AC_MSG_ERROR([FIPS source tree is incompatible with non-FIPS build (requires --enable-fips)])])
  379. ],
  380. [disabled],
  381. [],
  382. [
  383. AS_IF([ ! test -s $srcdir/wolfcrypt/src/fips.c],
  384. [AC_MSG_ERROR([non-FIPS source tree is incompatible with --enable-fips=$enableval])])
  385. ]
  386. )
  387. # For reproducible build, gate out from the build anything that might
  388. # introduce semantically frivolous jitter, maximizing chance of
  389. # identical object files.
  390. AC_ARG_ENABLE([reproducible-build],
  391. [AS_HELP_STRING([--enable-reproducible-build],[Enable maximally reproducible build (default: disabled)])],
  392. [ ENABLED_REPRODUCIBLE_BUILD=$enableval ],
  393. [ ENABLED_REPRODUCIBLE_BUILD=$REPRODUCIBLE_BUILD_DEFAULT ]
  394. )
  395. if test "$ENABLED_REPRODUCIBLE_BUILD" = "yes"
  396. then
  397. # Test ar for the "D" option. Should be checked before the libtool macros.
  398. if test -z "$AR"; then
  399. AR=ar
  400. fi
  401. xxx_ar_flags=$(${AR} --help 2>&1)
  402. if test -z "$RANLIB"; then
  403. RANLIB=ranlib
  404. fi
  405. xxx_ranlib_flags=$(${RANLIB} --help 2>&1)
  406. AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD"
  407. AS_CASE([$xxx_ar_flags],[*'use zero for timestamps and uids/gids'*],[AR_FLAGS="Dcr" lt_ar_flags="Dcr"])
  408. AS_CASE([$xxx_ranlib_flags],[*'Use zero for symbol map timestamp'*],[RANLIB="${RANLIB} -D"])
  409. fi
  410. AC_ARG_ENABLE([benchmark],
  411. [AS_HELP_STRING([--enable-benchmark],[Build benchmark when building crypttests (default: enabled)])],
  412. [ENABLED_BENCHMARK=$enableval],
  413. [ENABLED_BENCHMARK=yes]
  414. )
  415. # Linux Kernel Module
  416. AC_ARG_ENABLE([linuxkm],
  417. [AS_HELP_STRING([--enable-linuxkm],[Enable Linux Kernel Module (default: disabled)])],
  418. [ENABLED_LINUXKM=$enableval],
  419. [ENABLED_LINUXKM=no]
  420. )
  421. AC_ARG_ENABLE([linuxkm-defaults],
  422. [AS_HELP_STRING([--enable-linuxkm-defaults],[Enable feature defaults for Linux Kernel Module (default: disabled)])],
  423. [ENABLED_LINUXKM_DEFAULTS=$enableval],
  424. [ENABLED_LINUXKM_DEFAULTS=$ENABLED_LINUXKM]
  425. )
  426. AC_ARG_ENABLE([linuxkm-pie],
  427. [AS_HELP_STRING([--enable-linuxkm-pie],[Enable relocatable object build of Linux kernel module (default: disabled)])],
  428. [ENABLED_LINUXKM_PIE=$enableval],
  429. [ENABLED_LINUXKM_PIE=$ENABLED_FIPS]
  430. )
  431. if test "$ENABLED_LINUXKM_PIE" = "yes"
  432. then
  433. AM_CFLAGS="$AM_CFLAGS -DHAVE_LINUXKM_PIE_SUPPORT"
  434. elif test "$ENABLED_FIPS" = yes && test "$ENABLED_LINUXKM" = yes
  435. then
  436. AC_MSG_ERROR([FIPS linuxkm requires linuxkm-pie.])
  437. fi
  438. AC_SUBST([ENABLED_LINUXKM_PIE])
  439. AC_ARG_ENABLE([linuxkm-benchmarks],
  440. [AS_HELP_STRING([--enable-linuxkm-benchmarks],[Enable crypto benchmarking autorun at module load time for Linux kernel module (default: disabled)])],
  441. [ENABLED_LINUXKM_BENCHMARKS=$enableval],
  442. [ENABLED_LINUXKM_BENCHMARKS=no]
  443. )
  444. if test "$ENABLED_LINUXKM_BENCHMARKS" = "yes"
  445. then
  446. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM_BENCHMARKS"
  447. fi
  448. AC_SUBST([ENABLED_LINUXKM_BENCHMARKS])
  449. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  450. then
  451. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_CONST -DWOLFSSL_SP_MOD_WORD_RP -DWOLFSSL_SP_DIV_64 -DWOLFSSL_SP_DIV_WORD_HALF -DWOLFSSL_SMALL_STACK_STATIC -DWOLFSSL_TEST_SUBROUTINE=static"
  452. if test "$ENABLED_LINUXKM_PIE" = "yes"; then
  453. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OCSP_ISSUER_CHECK"
  454. fi
  455. if test "$ENABLED_FIPS" = "no"; then
  456. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OLD_PRIME_CHECK"
  457. fi
  458. DEF_SP_MATH="yes"
  459. DEF_FAST_MATH="no"
  460. fi
  461. AC_ARG_WITH([linux-source],
  462. [AS_HELP_STRING([--with-linux-source=PATH],[PATH to root of Linux kernel build tree])],
  463. [KERNEL_ROOT=$withval],
  464. [KERNEL_ROOT=""])
  465. AC_ARG_WITH([linux-arch],
  466. [AS_HELP_STRING([--with-linux-arch=arch],[built arch (SRCARCH) of Linux kernel build tree])],
  467. [KERNEL_ARCH=$withval],
  468. [KERNEL_ARCH=""])
  469. if test "x$ENABLED_LINUXKM" = "xyes"
  470. then
  471. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM"
  472. ENABLED_NO_LIBRARY=yes
  473. ENABLED_BENCHMARK=no
  474. output_objdir="$(realpath "$output_objdir")/linuxkm"
  475. if test "$KERNEL_ROOT" = ""; then
  476. AC_PATH_DEFAULT_KERNEL_SOURCE
  477. KERNEL_ROOT="$DEFAULT_KERNEL_ROOT"
  478. fi
  479. AC_SUBST([KERNEL_ROOT])
  480. if test "$KERNEL_ARCH" = ""; then
  481. AC_DEFAULT_KERNEL_ARCH
  482. KERNEL_ARCH="$DEFAULT_KERNEL_ARCH"
  483. fi
  484. AC_SUBST([KERNEL_ARCH])
  485. if test "${KERNEL_ROOT}" = ""; then
  486. AC_MSG_ERROR([Linux kernel source root not found -- supply with --with-linux-source=PATH.])
  487. fi
  488. if test "${KERNEL_ARCH}" = ""; then
  489. AC_MSG_ERROR([Linux kernel target architecture for build tree ${KERNEL_ROOT} could not be determined. Is target kernel configured?])
  490. fi
  491. AM_CFLAGS="$AM_CFLAGS -DNO_DEV_RANDOM -DNO_WRITEV -DNO_STDIO_FILESYSTEM -DWOLFSSL_NO_SOCK -DWOLFSSL_USER_IO"
  492. fi
  493. # MATH LIBRARY SELECTION
  494. # Single Precision maths implementation
  495. AC_ARG_ENABLE([sp],
  496. [AS_HELP_STRING([--enable-sp],[Enable Single Precision maths implementation (default: disabled)])],
  497. [ ENABLED_SP=$enableval ],
  498. [ ENABLED_SP=$ENABLED_SP_DEFAULT ],
  499. )
  500. AC_ARG_ENABLE([sp-math-all],
  501. [AS_HELP_STRING([--enable-sp-math-all],[Enable Single Precision math implementation for full algorithm suite (default: enabled)])],
  502. [ ENABLED_SP_MATH_ALL=$enableval ],
  503. [ ENABLED_SP_MATH_ALL=$DEF_SP_MATH ],
  504. )
  505. # Single Precision maths (acceleration for common key sizes and curves)
  506. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes" && test "$ENABLED_SP" != "no" && test "$ENABLED_SP_MATH_ALL" = "no"
  507. then
  508. ENABLED_SP_MATH_DEFAULT=yes
  509. else
  510. ENABLED_SP_MATH_DEFAULT=no
  511. fi
  512. AC_ARG_ENABLE([sp-math],
  513. [AS_HELP_STRING([--enable-sp-math],[Enable Single Precision math implementation with restricted algorithm suite (default: disabled)])],
  514. [ ENABLED_SP_MATH=$enableval ],
  515. [ ENABLED_SP_MATH=$ENABLED_SP_MATH_DEFAULT ],
  516. )
  517. if test "$enable_sp_math" != ""
  518. then
  519. # When the restricted SP Math is selected and not SP Math ALL, then disable
  520. # SP Math ALL.
  521. if test "$enable_sp_math" != "no" && test "$enable_sp_math_all" = ""
  522. then
  523. ENABLED_SP_MATH_ALL="no"
  524. else
  525. # Can't choose restricted and unrestricted SP Math
  526. if test "$enable_sp_math" != "no" && test "$enable_sp_math_all" != "no"
  527. then
  528. AC_MSG_ERROR([--enable-sp-math and --enable-sp-math-all are incompatible. Use --enable-sp-math-all only when all key sizes need to be supported.])
  529. fi
  530. fi
  531. fi
  532. # enable SP math assembly support automatically for x86_64 and aarch64 (except Linux kernel module)
  533. SP_ASM_DEFAULT=no
  534. if test "$ENABLED_SP_MATH" = "yes" && test "$ENABLED_LINUXKM_DEFAULTS" = "no"
  535. then
  536. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"
  537. then
  538. SP_ASM_DEFAULT=yes
  539. fi
  540. fi
  541. AC_ARG_ENABLE([sp-asm],
  542. [AS_HELP_STRING([--enable-sp-asm],[Enable Single Precision assembly implementation (default: enabled on x86_64/aarch64/amd64)])],
  543. [ ENABLED_SP_ASM=$enableval ],
  544. [ ENABLED_SP_ASM=$SP_ASM_DEFAULT ],
  545. )
  546. if test "$ENABLED_SP_ASM" != "no"
  547. then
  548. if test "$ENABLED_SP" = "no"
  549. then
  550. AC_MSG_ERROR([--enable-sp-asm requires SP to be enabled.])
  551. fi
  552. if test "$ENABLED_SP" = ""
  553. then
  554. ENABLED_SP=yes
  555. fi
  556. fi
  557. # fastmath
  558. AC_ARG_ENABLE([fastmath],
  559. [AS_HELP_STRING([--enable-fastmath],[Enable fast math ops (default: disabled)])],
  560. [ ENABLED_FASTMATH=$enableval ],
  561. [ ENABLED_FASTMATH=$DEF_FAST_MATH ]
  562. )
  563. # fast HUGE math
  564. AC_ARG_ENABLE([fasthugemath],
  565. [AS_HELP_STRING([--enable-fasthugemath],[Enable fast math + huge code (default: disabled)])],
  566. [ ENABLED_FASTHUGEMATH=$enableval ],
  567. [ ENABLED_FASTHUGEMATH=no ]
  568. )
  569. if test "$ENABLED_BUMP" = "yes"
  570. then
  571. ENABLED_FASTHUGEMATH="yes"
  572. fi
  573. if test "$ENABLED_FASTHUGEMATH" = "yes"
  574. then
  575. ENABLED_FASTMATH="yes"
  576. fi
  577. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"
  578. then
  579. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD"
  580. fi
  581. if test "$host_cpu" = "x86"
  582. then
  583. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_BUILD"
  584. fi
  585. # if sp-math-all is not set, then enable fast math
  586. if test "x$ENABLED_FASTMATH" = "xyes" && test "$enable_sp_math_all" = "" && test "$enable_sp_math" = ""
  587. then
  588. # turn off fastmath if leanpsk on or asn off (w/o DH and ECC)
  589. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_ASN" = "no"
  590. then
  591. if test "$ENABLED_DH" = "no" && test "$ENABLED_ECC" = "no" && test "$ENABLED_RSA" = "no"
  592. then
  593. ENABLED_FASTMATH="no"
  594. else
  595. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  596. ENABLED_HEAPMATH="no"
  597. fi
  598. else
  599. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  600. ENABLED_HEAPMATH="no"
  601. ENABLED_SP_MATH_ALL="no"
  602. fi
  603. AS_IF([test "x$host_cpu" = "xaarch64"],[AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AARCH64_BUILD"])
  604. if test "$ENABLED_SAKKE" = "yes" && test "$ENABLED_SAKKE_SMALL" != "yes"
  605. then
  606. AM_CFLAGS="$AM_CFLAGS -funroll-loops -DTFM_SMALL_SET"
  607. fi
  608. fi
  609. # heap based integer.c math (not timing resistant)
  610. AC_ARG_ENABLE([heapmath],
  611. [AS_HELP_STRING([--enable-heapmath],[Enable heap based integer.c math ops (default: disabled)])],
  612. [ ENABLED_HEAPMATH=$enableval ],
  613. [ ENABLED_HEAPMATH=no]
  614. )
  615. if test "x$ENABLED_HEAPMATH" = "xyes"
  616. then
  617. AM_CFLAGS="$AM_CFLAGS -DUSE_INTEGER_HEAP_MATH"
  618. ENABLED_HEAPMATH="yes"
  619. ENABLED_SP="no"
  620. ENABLED_SP_MATH_ALL="no"
  621. fi
  622. # ALL FEATURES
  623. AC_ARG_ENABLE([all],
  624. [AS_HELP_STRING([--enable-all],[Enable all wolfSSL features, except SSLv3 (default: disabled)])],
  625. [ ENABLED_ALL=$enableval ],
  626. [ ENABLED_ALL=no ]
  627. )
  628. if test "$ENABLED_ALL" = "yes"
  629. then
  630. test "$enable_dtls" = "" && enable_dtls=yes
  631. if test "x$FIPS_VERSION" != "xv1"
  632. then
  633. test "$enable_tls13" = "" && enable_tls13=yes
  634. test "$enable_rsapss" = "" && enable_rsapss=yes
  635. fi
  636. # this set is also enabled by enable-all-crypto:
  637. test "$enable_atomicuser" = "" && enable_atomicuser=yes
  638. test "$enable_aesgcm" = "" && enable_aesgcm=yes
  639. test "$enable_aesgcm_stream" = "" && enable_aesgcm_stream=yes
  640. test "$enable_aesccm" = "" && enable_aesccm=yes
  641. test "$enable_aesctr" = "" && enable_aesctr=yes
  642. test "$enable_aesofb" = "" && enable_aesofb=yes
  643. test "$enable_aescfb" = "" && enable_aescfb=yes
  644. test "$enable_aescbc_length_checks" = "" && enable_aescbc_length_checks=yes
  645. test "$enable_camellia" = "" && enable_camellia=yes
  646. test "$enable_ripemd" = "" && enable_ripemd=yes
  647. test "$enable_sha224" = "" && enable_sha224=yes
  648. test "$enable_shake128" = "" && enable_shake128=yes
  649. test "$enable_shake256" = "" && enable_shake256=yes
  650. test "$enable_sessioncerts" = "" && enable_sessioncerts=yes
  651. test "$enable_keygen" = "" && enable_keygen=yes
  652. test "$enable_certgen" = "" && enable_certgen=yes
  653. test "$enable_certreq" = "" && enable_certreq=yes
  654. test "$enable_certext" = "" && enable_certext=yes
  655. test "$enable_sep" = "" && enable_sep=yes
  656. test "$enable_hkdf" = "" && enable_hkdf=yes
  657. test "$enable_curve25519" = "" && enable_curve25519=yes
  658. test "$enable_curve448" = "" && enable_curve448=yes
  659. test "$enable_fpecc" = "" && enable_fpecc=yes
  660. test "$enable_eccencrypt" = "" && enable_eccencrypt=yes
  661. test "$enable_psk" = "" && enable_psk=yes
  662. test "$enable_cmac" = "" && enable_cmac=yes
  663. test "$enable_siphash" = "" && enable_siphash=yes
  664. test "$enable_xts" = "" && enable_xts=yes
  665. test "$enable_ocsp" = "" && enable_ocsp=yes
  666. test "$enable_ocspstapling" = "" && enable_ocspstapling=yes
  667. test "$enable_ocspstapling2" = "" && enable_ocspstapling2=yes
  668. test "$enable_crl" = "" && enable_crl=yes
  669. test "$enable_supportedcurves" = "" && enable_supportedcurves=yes
  670. test "$enable_tlsx" = "" && enable_tlsx=yes
  671. test "$enable_pwdbased" = "" && enable_pwdbased=yes
  672. test "$enable_aeskeywrap" = "" && enable_aeskeywrap=yes
  673. test "$enable_x963kdf" = "" && enable_x963kdf=yes
  674. test "$enable_scrypt" = "" && enable_scrypt=yes
  675. test "$enable_indef" = "" && enable_indef=yes
  676. test "$enable_enckeys" = "" && enable_enckeys=yes
  677. test "$enable_hashflags" = "" && enable_hashflags=yes
  678. test "$enable_defaultdhparams" = "" && enable_defaultdhparams=yes
  679. test "$enable_base64encode" = "" && enable_base64encode=yes
  680. test "$enable_base16" = "" && enable_base16=yes
  681. test "$enable_arc4" = "" && enable_arc4=yes
  682. test "$enable_des3" = "" && enable_des3=yes
  683. test "$enable_blake2" = "" && enable_blake2=yes
  684. test "$enable_blake2s" = "" && enable_blake2s=yes
  685. test "$enable_md2" = "" && enable_md2=yes
  686. test "$enable_md4" = "" && enable_md4=yes
  687. test "$enable_cryptocb" = "" && enable_cryptocb=yes
  688. test "$enable_anon" = "" && enable_anon=yes
  689. test "$enable_ssh" = "" && enable_ssh=yes
  690. test "$enable_savesession" = "" && enable_savesession=yes
  691. test "$enable_savecert" = "" && enable_savecert=yes
  692. test "$enable_postauth" = "" && enable_postauth=yes
  693. test "$enable_hrrcookie" = "" && enable_hrrcookie=yes
  694. test "$enable_fallback_scsv" = "" && enable_fallback_scsv=yes
  695. test "$enable_webserver" = "" && enable_webserver=yes
  696. test "$enable_crl_monitor" = "" && enable_crl_monitor=yes
  697. test "$enable_sni" = "" && enable_sni=yes
  698. test "$enable_maxfragment" = "" && enable_maxfragment=yes
  699. test "$enable_alpn" = "" && enable_alpn=yes
  700. test "$enable_truncatedhmac" = "" && enable_truncatedhmac=yes
  701. test "$enable_trusted_ca" = "" && enable_trusted_ca=yes
  702. test "$enable_session_ticket" = "" && enable_session_ticket=yes
  703. test "$enable_earlydata" = "" && enable_earlydata=yes
  704. test "$enable_ech" = "" && enable_ech=yes
  705. if test "$ENABLED_32BIT" != "yes"
  706. then
  707. test "$enable_sha512" = "" && enable_sha512=yes
  708. test "$enable_sha3" = "" && enable_sha3=yes
  709. fi
  710. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  711. then
  712. test "$enable_compkey" = "" && enable_compkey=yes
  713. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_IO -DHAVE_IO_TIMEOUT"
  714. fi
  715. # sp-math is incompatible with opensslextra, ECC custom curves, and DSA.
  716. if test "$ENABLED_SP_MATH" = "no"
  717. then
  718. test "$enable_dsa" = "" && enable_dsa=yes
  719. test "$enable_ecccustcurves" = "" && enable_ecccustcurves=yes
  720. test "$enable_brainpool" = "" && enable_brainpool=yes
  721. test "$enable_srp" = "" && enable_srp=yes
  722. # linuxkm is incompatible with opensslextra and its dependents.
  723. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  724. then
  725. if test "$ENABLED_FIPS" = "no"
  726. then
  727. if test "$ENABLED_32BIT" != "yes"
  728. then
  729. test "$enable_openssh" = "" && enable_openssh=yes
  730. fi
  731. # S/MIME support requires PKCS7, which requires no FIPS.
  732. test "$enable_smime" = "" && enable_smime=yes
  733. fi
  734. test "$enable_opensslextra" = "" && enable_opensslextra=yes
  735. test "$enable_opensslall" = "" && enable_opensslall=yes
  736. test "$enable_certservice" = "" && enable_certservice=yes
  737. test "$enable_lighty" = "" && enable_lighty=yes
  738. test "$enable_nginx" = "" && enable_nginx=yes
  739. test "$enable_openvpn" = "" && enable_openvpn=yes
  740. test "$enable_asio" = "" && enable_asio=yes
  741. test "$enable_libwebsockets" = "" && enable_libwebsockets=yes
  742. test "$enable_qt" = "" && enable_qt=yes
  743. fi
  744. fi
  745. if test "$ENABLED_FIPS" = "no"
  746. then
  747. test "$enable_pkcallbacks" = "" && enable_pkcallbacks=yes
  748. test "$enable_xchacha" = "" && enable_xchacha=yes
  749. test "$enable_scep" = "" && enable_scep=yes
  750. test "$enable_pkcs7" = "" && enable_pkcs7=yes
  751. test "$enable_nullcipher" = "" && enable_nullcipher=yes
  752. test "$enable_mcast" = "" && enable_mcast=yes
  753. if test "$ENABLED_32BIT" != "yes"
  754. then
  755. test "$enable_ed25519" = "" && enable_ed25519=yes
  756. test "$enable_ed25519_stream" = "" && enable_ed25519_stream=yes
  757. test "$enable_ed448" = "" && enable_ed448=yes
  758. test "$enable_ed448_stream" = "" && enable_ed448_stream=yes
  759. fi
  760. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  761. then
  762. # these use DES3:
  763. test "$enable_stunnel" = "" && enable_stunnel=yes
  764. test "$enable_curl" = "" && enable_curl=yes
  765. test "$enable_tcpdump" = "" && enable_tcpdump=yes
  766. test "$enable_eccsi" = "" && enable_eccsi=yes
  767. test "$enable_sakke" = "" && enable_sakke=yes
  768. fi
  769. fi
  770. if test "$ENABLED_FIPS" = "no" || test "$ENABLED_FIPS" = "dev"; then
  771. test "$enable_aessiv" = "" && enable_aessiv=yes
  772. fi
  773. # Enable DH const table speedups (eliminates `-lm` math lib dependency)
  774. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072"
  775. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  776. # Enable multiple attribute additions such as DC
  777. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTI_ATTRIB"
  778. # Enable AES Decrypt, AES ECB
  779. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB"
  780. # Enable Alt Names, DER Load, Keep Certs, CRL IO with Timeout
  781. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD -DKEEP_OUR_CERT -DKEEP_PEER_CERT"
  782. # Enable DH Extra
  783. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA"
  784. # Enable deterministic ECC signing API with variant
  785. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT"
  786. # Store issuer name components when parsing certificates.
  787. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_ISSUER_NAMES"
  788. # Certificate extensions and alt. names for FPKI use
  789. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SUBJ_DIR_ATTR -DWOLFSSL_FPKI -DWOLFSSL_SUBJ_INFO_ACC"
  790. # Handle as many subject/issuer name OIDs as possible
  791. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_NAME_ALL"
  792. # More thorough error queue usage.
  793. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VERBOSE_ERRORS"
  794. fi
  795. # ALL CRYPTO FEATURES
  796. AC_ARG_ENABLE([all-crypto],
  797. [AS_HELP_STRING([--enable-all-crypto],[Enable all wolfcrypt algorithms (default: disabled)])],
  798. [ ENABLED_ALL_CRYPT=$enableval ],
  799. [ ENABLED_ALL_CRYPT=no ]
  800. )
  801. if test "$ENABLED_ALL_CRYPT" = "yes"
  802. then
  803. test "$enable_atomicuser" = "" && enable_atomicuser=yes
  804. test "$enable_aesgcm" = "" && enable_aesgcm=yes
  805. test "$enable_aesgcm_stream" = "" && enable_aesgcm_stream=yes
  806. test "$enable_aesccm" = "" && enable_aesccm=yes
  807. test "$enable_aesctr" = "" && enable_aesctr=yes
  808. test "$enable_aesofb" = "" && enable_aesofb=yes
  809. test "$enable_aescfb" = "" && enable_aescfb=yes
  810. test "$enable_aescbc_length_checks" = "" && enable_aescbc_length_checks=yes
  811. test "$enable_camellia" = "" && enable_camellia=yes
  812. test "$enable_ripemd" = "" && enable_ripemd=yes
  813. test "$enable_sha224" = "" && enable_sha224=yes
  814. test "$enable_shake128" = "" && enable_shake128=yes
  815. test "$enable_shake256" = "" && enable_shake256=yes
  816. test "$enable_sessioncerts" = "" && enable_sessioncerts=yes
  817. test "$enable_keygen" = "" && enable_keygen=yes
  818. test "$enable_certgen" = "" && enable_certgen=yes
  819. test "$enable_certreq" = "" && enable_certreq=yes
  820. test "$enable_certext" = "" && enable_certext=yes
  821. test "$enable_sep" = "" && enable_sep=yes
  822. test "$enable_hkdf" = "" && enable_hkdf=yes
  823. test "$enable_curve25519" = "" && enable_curve25519=yes
  824. test "$enable_curve448" = "" && enable_curve448=yes
  825. test "$enable_fpecc" = "" && enable_fpecc=yes
  826. test "$enable_eccencrypt" = "" && enable_eccencrypt=yes
  827. test "$enable_psk" = "" && enable_psk=yes
  828. test "$enable_cmac" = "" && enable_cmac=yes
  829. test "$enable_siphash" = "" && enable_siphash=yes
  830. test "$enable_xts" = "" && enable_xts=yes
  831. test "$enable_ocsp" = "" && enable_ocsp=yes
  832. test "$enable_ocspstapling" = "" && enable_ocspstapling=yes
  833. test "$enable_ocspstapling2" = "" && enable_ocspstapling2=yes
  834. test "$enable_crl" = "" && enable_crl=yes
  835. test "$enable_supportedcurves" = "" && enable_supportedcurves=yes
  836. test "$enable_tlsx" = "" && enable_tlsx=yes
  837. test "$enable_pwdbased" = "" && enable_pwdbased=yes
  838. test "$enable_aeskeywrap" = "" && enable_aeskeywrap=yes
  839. test "$enable_x963kdf" = "" && enable_x963kdf=yes
  840. test "$enable_scrypt" = "" && enable_scrypt=yes
  841. test "$enable_indef" = "" && enable_indef=yes
  842. test "$enable_enckeys" = "" && enable_enckeys=yes
  843. test "$enable_hashflags" = "" && enable_hashflags=yes
  844. test "$enable_defaultdhparams" = "" && enable_defaultdhparams=yes
  845. test "$enable_base64encode" = "" && enable_base64encode=yes
  846. test "$enable_base16" = "" && enable_base16=yes
  847. test "$enable_arc4" = "" && enable_arc4=yes
  848. test "$enable_des3" = "" && enable_des3=yes
  849. test "$enable_blake2" = "" && enable_blake2=yes
  850. test "$enable_blake2s" = "" && enable_blake2s=yes
  851. test "$enable_md2" = "" && enable_md2=yes
  852. test "$enable_md4" = "" && enable_md4=yes
  853. test "$enable_cryptocb" = "" && enable_cryptocb=yes
  854. test "$enable_anon" = "" && enable_anon=yes
  855. test "$enable_ssh" = "" && enable_ssh=yes
  856. if test "$ENABLED_32BIT" != "yes"
  857. then
  858. test "$enable_sha512" = "" && enable_sha512=yes
  859. test "$enable_sha3" = "" && enable_sha3=yes
  860. fi
  861. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  862. then
  863. test "$enable_compkey" = "" && enable_compkey=yes
  864. fi
  865. if test "$ENABLED_SP_MATH" = "no"
  866. then
  867. test "$enable_dsa" = "" && enable_dsa=yes
  868. test "$enable_ecccustcurves" = "" && enable_ecccustcurves=yes
  869. test "$enable_brainpool" = "" && enable_brainpool=yes
  870. test "$enable_srp" = "" && enable_srp=yes
  871. fi
  872. if test "$ENABLED_FIPS" = "no"
  873. then
  874. test "$enable_pkcallbacks" = "" && enable_pkcallbacks=yes
  875. test "$enable_xchacha" = "" && enable_xchacha=yes
  876. test "$enable_pkcs7" = "" && enable_pkcs7=yes
  877. test "$enable_nullcipher" = "" && enable_nullcipher=yes
  878. if test "$ENABLED_32BIT" != "yes"
  879. then
  880. test "$enable_ed25519" = "" && enable_ed25519=yes
  881. test "$enable_ed25519_stream" = "" && enable_ed25519_stream=yes
  882. test "$enable_ed448" = "" && enable_ed448=yes
  883. test "$enable_ed448_stream" = "" && enable_ed448_stream=yes
  884. fi
  885. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  886. then
  887. test "$enable_eccsi" = "" && enable_eccsi=yes
  888. test "$enable_sakke" = "" && enable_sakke=yes
  889. fi
  890. fi
  891. if test "$ENABLED_FIPS" = "no" || test "$ENABLED_FIPS" = "dev"; then
  892. test "$enable_aessiv" = "" && enable_aessiv=yes
  893. fi
  894. # Enable AES Decrypt, AES ECB, Alt Names, DER Load
  895. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD"
  896. # Enable DH const table speedups (eliminates `-lm` math lib dependency)
  897. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072"
  898. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  899. # Enable multiple attribute additions such as DC
  900. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTI_ATTRIB"
  901. # Enable DH Extra
  902. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA"
  903. # Enable deterministic ECC signing API with variant
  904. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT"
  905. # Store issuer name components when parsing certificates.
  906. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_ISSUER_NAMES"
  907. fi
  908. # liboqs
  909. ENABLED_LIBOQS="no"
  910. tryliboqsdir=""
  911. AC_ARG_WITH([liboqs],
  912. [AS_HELP_STRING([--with-liboqs=PATH],[Path to liboqs install (default /usr/local) EXPERIMENTAL!])],
  913. [
  914. AC_MSG_CHECKING([for liboqs])
  915. LIBS="$LIBS -loqs"
  916. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <oqs/common.h>]], [[ OQS_init(); ]])], [ liboqs_linked=yes ],[ liboqs_linked=no ])
  917. if test "x$liboqs_linked" = "xno" ; then
  918. if test "x$withval" != "xno" ; then
  919. tryliboqsdir=$withval
  920. fi
  921. if test "x$withval" = "xyes" ; then
  922. tryliboqsdir="/usr/local"
  923. fi
  924. CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBOQS -DHAVE_TLS_EXTENSIONS -I$tryliboqsdir/include"
  925. LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$tryliboqsdir/lib"
  926. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <oqs/common.h>]], [[ OQS_init(); ]])], [ liboqs_linked=yes ],[ liboqs_linked=no ])
  927. if test "x$liboqs_linked" = "xno" ; then
  928. AC_MSG_ERROR([liboqs isn't found.
  929. If it's already installed, specify its path using --with-liboqs=/dir/])
  930. fi
  931. AC_MSG_RESULT([yes])
  932. AM_CPPFLAGS="$CPPFLAGS"
  933. AM_LDFLAGS="$AM_LDFLAGS -L$tryliboqsdir/lib"
  934. else
  935. AC_MSG_RESULT([yes])
  936. fi
  937. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  938. then
  939. ENABLED_OPENSSLEXTRA="yes"
  940. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  941. fi
  942. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBOQS -DHAVE_TLS_EXTENSIONS"
  943. ENABLED_LIBOQS="yes"
  944. ]
  945. )
  946. # KYBER
  947. # Used:
  948. # - SHA3, Shake128 and Shake256, or
  949. # - SHA256, SHA512, AES-CTR
  950. AC_ARG_ENABLE([kyber],
  951. [AS_HELP_STRING([--enable-kyber],[Enable KYBER (default: disabled)])],
  952. [ ENABLED_KYBER=$enableval ],
  953. [ ENABLED_KYBER=no ]
  954. )
  955. ENABLED_WC_KYBER=no
  956. for v in `echo $ENABLED_KYBER | tr "," " "`
  957. do
  958. case $v in
  959. yes | all)
  960. ENABLED_KYBER512=yes
  961. ENABLED_KYBER768=yes
  962. ENABLED_KYBER1024=yes
  963. ;;
  964. no)
  965. ;;
  966. wolfssl)
  967. ENABLED_WC_KYBER=yes
  968. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_KYBER"
  969. ;;
  970. small)
  971. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KYBER_SMALL"
  972. ;;
  973. 512)
  974. ENABLED_KYBER512=yes
  975. ;;
  976. 768)
  977. ENABLED_KYBER768=yes
  978. ;;
  979. 1024)
  980. ENABLED_KYBER1024=yes
  981. ;;
  982. *)
  983. AC_MSG_ERROR([Invalid choice for KYBER []: $ENABLED_KYBER.])
  984. break;;
  985. esac
  986. done
  987. if test "$ENABLED_KYBER" != "no"
  988. then
  989. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_KYBER"
  990. if test "$ENABLED_KYBER512" = ""; then
  991. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_KYBER512"
  992. fi
  993. if test "$ENABLED_KYBER768" = ""; then
  994. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_KYBER768"
  995. fi
  996. if test "$ENABLED_KYBER1024" = ""; then
  997. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_KYBER1024"
  998. fi
  999. if test "$ENABLED_WC_KYBER" = "yes"
  1000. then
  1001. test "$enable_sha3" = "" && enable_sha3=yes
  1002. test "$enable_shake128" = "" && enable_shake128=yes
  1003. test "$enable_shake256" = "" && enable_shake256=yes
  1004. else
  1005. # Default is to use liboqs. Make sure its enabled.
  1006. if test "$ENABLED_LIBOQS" = "no"; then
  1007. AC_MSG_ERROR([The default implementation for kyber is liboqs.
  1008. Please use --with-liboqs.])
  1009. fi
  1010. fi
  1011. fi
  1012. # LMS
  1013. AC_ARG_ENABLE([lms],
  1014. [AS_HELP_STRING([--enable-lms],[Enable stateful LMS/HSS signatures (default: disabled)])],
  1015. [ ENABLED_LMS=$enableval ],
  1016. [ ENABLED_LMS=no ]
  1017. )
  1018. ENABLED_WC_LMS=no
  1019. for v in `echo $ENABLED_LMS | tr "," " "`
  1020. do
  1021. case $v in
  1022. yes)
  1023. ;;
  1024. no)
  1025. ;;
  1026. verify-only)
  1027. LMS_VERIFY_ONLY=yes
  1028. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LMS_VERIFY_ONLY"
  1029. ;;
  1030. wolfssl)
  1031. ENABLED_WC_LMS=yes
  1032. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WC_LMS"
  1033. ;;
  1034. *)
  1035. AC_MSG_ERROR([Invalid choice for LMS []: $ENABLED_LMS.])
  1036. break;;
  1037. esac
  1038. done
  1039. if test "$ENABLED_LMS" != "no"
  1040. then
  1041. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_LMS"
  1042. if test "$ENABLED_WC_LMS" = "no";
  1043. then
  1044. # Default is to use hash-sigs LMS lib. Make sure it's enabled.
  1045. if test "$ENABLED_LIBLMS" = "no"; then
  1046. AC_MSG_ERROR([The default implementation for LMS is the hash-sigs LMS/HSS lib.
  1047. Please use --with-liblms.])
  1048. fi
  1049. fi
  1050. fi
  1051. # liblms
  1052. # Get the path to the hash-sigs LMS HSS lib.
  1053. ENABLED_LIBLMS="no"
  1054. tryliblmsdir=""
  1055. AC_ARG_WITH([liblms],
  1056. [AS_HELP_STRING([--with-liblms=PATH],[PATH to hash-sigs LMS/HSS install (default /usr/local) EXPERIMENTAL!])],
  1057. [
  1058. AC_MSG_CHECKING([for liblms])
  1059. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <hss.h>]], [[ param_set_t lm_type; param_set_t lm_ots_type; hss_get_public_key_len(4, &lm_type, &lm_ots_type); ]])], [ liblms_linked=yes ],[ liblms_linked=no ])
  1060. if test "x$liblms_linked" = "xno" ; then
  1061. if test "x$withval" != "xno" ; then
  1062. tryliblmsdir=$withval
  1063. fi
  1064. if test "x$withval" = "xyes" ; then
  1065. tryliblmsdir="/usr/local"
  1066. fi
  1067. # 1. If verify only build, use hss_verify.a
  1068. # 2. If normal build, by default use single-threaded hss_lib.a
  1069. # 3. If 2 not found, then use the multi-threaded hss_lib_thread.a
  1070. if test "$LMS_VERIFY_ONLY" = "yes"; then
  1071. if test -e $tryliblmsdir/hss_verify.a; then
  1072. CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
  1073. LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_verify.a"
  1074. enable_shared=no
  1075. enable_static=yes
  1076. liblms_linked=yes
  1077. else
  1078. AC_MSG_ERROR([hss_verify.a isn't found.
  1079. If it's already installed, specify its path using --with-liblms=/dir/])
  1080. fi
  1081. elif test -e $tryliblmsdir/hss_lib.a; then
  1082. CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
  1083. LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib.a"
  1084. enable_shared=no
  1085. enable_static=yes
  1086. liblms_linked=yes
  1087. elif test -e $tryliblmsdir/hss_lib_thread.a; then
  1088. CPPFLAGS="$AM_CPPFLAGS -DHAVE_LIBLMS -I$tryliblmsdir"
  1089. LIB_STATIC_ADD="$LIB_STATIC_ADD $tryliblmsdir/hss_lib_thread.a"
  1090. enable_shared=no
  1091. enable_static=yes
  1092. liblms_linked=yes
  1093. else
  1094. AC_MSG_ERROR([liblms isn't found.
  1095. If it's already installed, specify its path using --with-liblms=/dir/])
  1096. fi
  1097. if test "x$liblms_linked" = "xno" ; then
  1098. AC_MSG_ERROR([liblms isn't found.
  1099. If it's already installed, specify its path using --with-liblms=/dir/])
  1100. fi
  1101. AC_MSG_RESULT([yes])
  1102. AM_CPPFLAGS="$CPPFLAGS"
  1103. AM_LDFLAGS="$LDFLAGS"
  1104. else
  1105. AC_MSG_RESULT([yes])
  1106. fi
  1107. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBLMS"
  1108. ENABLED_LIBLMS="yes"
  1109. ]
  1110. )
  1111. # SINGLE THREADED
  1112. AC_ARG_ENABLE([singlethreaded],
  1113. [AS_HELP_STRING([--enable-singlethreaded],[Enable wolfSSL single threaded (default: disabled)])],
  1114. [ ENABLED_SINGLETHREADED=$enableval ],
  1115. [ ENABLED_SINGLETHREADED=no ])
  1116. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xno" ],[
  1117. AX_PTHREAD([
  1118. AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
  1119. # If AX_PTHREAD is adding -Qunused-arguments, need to prepend with -Xcompiler libtool will use it. Newer
  1120. # versions of clang don't need the -Q flag when using pthreads.
  1121. AS_CASE([$PTHREAD_CFLAGS],[-Qunused-arguments*],[PTHREAD_CFLAGS="-Xcompiler $PTHREAD_CFLAGS"])
  1122. AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
  1123. LIBS="$LIBS $PTHREAD_LIBS"
  1124. ],[
  1125. ENABLED_SINGLETHREADED=yes
  1126. ])
  1127. ])
  1128. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xyes" ],[ AM_CFLAGS="$AM_CFLAGS -DSINGLE_THREADED" ])
  1129. # Enable rwlock
  1130. AC_ARG_ENABLE([rwlock],
  1131. [AS_HELP_STRING([--enable-rwlock],[Enable use of rwlock (default: disabled)])],
  1132. [ENABLED_RWLOCK=$enableval],
  1133. [ENABLED_RWLOCK=no])
  1134. if test "$ENABLED_RWLOCK" = "yes"
  1135. then
  1136. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_USE_RWLOCK"
  1137. fi
  1138. # wolfCrypt Only Build
  1139. AC_ARG_ENABLE([cryptonly],
  1140. [AS_HELP_STRING([--enable-cryptonly],[Enable wolfCrypt Only build (default: disabled)])],
  1141. [ENABLED_CRYPTONLY=$enableval],
  1142. [ENABLED_CRYPTONLY=no])
  1143. AS_IF([test "x$FIPS_VERSION" = "xrand"],[ENABLED_CRYPTONLY="yes"])
  1144. # ECH
  1145. AC_ARG_ENABLE([ech],
  1146. [AS_HELP_STRING([--enable-ech],[Enable ECH (default: disabled)])],
  1147. [ ENABLED_ECH=$enableval ],
  1148. [ ENABLED_ECH=no ]
  1149. )
  1150. if test "$ENABLED_ECH" = "yes"
  1151. then
  1152. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECH"
  1153. test "$enable_hpke" = "" && enable_hpke=yes
  1154. test "$enable_ecc" = "" && enable_ecc=yes
  1155. test "$enable_curve25519" = "" && enable_curve25519=yes
  1156. test "$enable_sha256" = "" && enable_sha256=yes
  1157. test "$enable_tlsx" = "" && enable_tlsx=yes
  1158. test "$enable_sni" = "" && enable_sni=yes
  1159. test "$enable_tls13" = "" && enable_tls13=yes
  1160. fi
  1161. # DTLS
  1162. # DTLS is a prereq for the options mcast, sctp, and jni. Enabling any of those
  1163. # without DTLS will also enable DTLS.
  1164. AC_ARG_ENABLE([dtls],
  1165. [AS_HELP_STRING([--enable-dtls],[Enable wolfSSL DTLS (default: disabled)])],
  1166. [ ENABLED_DTLS=$enableval ],
  1167. [ ENABLED_DTLS=no ]
  1168. )
  1169. if test "$ENABLED_DTLS" = "yes"
  1170. then
  1171. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  1172. fi
  1173. # DTLS change MTU
  1174. AC_ARG_ENABLE([dtls-mtu],
  1175. [AS_HELP_STRING([--enable-dtls-mtu],[Enable setting the MTU size for wolfSSL DTLS (default: disabled)])],
  1176. [ ENABLED_DTLS_MTU=$enableval ],
  1177. [ ENABLED_DTLS_MTU=no ]
  1178. )
  1179. if test "$ENABLED_DTLS_MTU" = "yes"
  1180. then
  1181. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS_MTU"
  1182. fi
  1183. # KeyLog file export
  1184. AC_ARG_ENABLE([keylog-export],
  1185. [AS_HELP_STRING([--enable-keylog-export],[Enable (DANGEROUS INSECURE) exporting TLS secrets to an NSS keylog file (default: disabled)])],
  1186. [ ENABLED_KEYLOG_EXPORT=$enableval ],
  1187. [ ENABLED_KEYLOG_EXPORT=no ]
  1188. )
  1189. if test "$ENABLED_KEYLOG_EXPORT" = "yes"
  1190. then
  1191. AM_CFLAGS="$AM_CFLAGS -DSHOW_SECRETS -DHAVE_SECRET_CALLBACK -DWOLFSSL_SSLKEYLOGFILE"
  1192. fi
  1193. # TLS v1.3 Draft 18 (Note: only final TLS v1.3 supported, here for backwards build compatibility)
  1194. AC_ARG_ENABLE([tls13-draft18],
  1195. [AS_HELP_STRING([--enable-tls13-draft18],[Enable wolfSSL TLS v1.3 Draft 18 (default: disabled)])],
  1196. [ ENABLED_TLS13_DRAFT18=$enableval ],
  1197. [ ENABLED_TLS13_DRAFT18=no ]
  1198. )
  1199. # TLS v1.3
  1200. AC_ARG_ENABLE([tls13],
  1201. [AS_HELP_STRING([--enable-tls13],[Enable wolfSSL TLS v1.3 (default: enabled)])],
  1202. [ ENABLED_TLS13=$enableval ],
  1203. [ ENABLED_TLS13=yes ]
  1204. )
  1205. if test "x$FIPS_VERSION" = "xv1" ||
  1206. ( test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 1 ) ||
  1207. test "$ENABLED_CRYPTONLY" = "yes"
  1208. then
  1209. ENABLED_TLS13="no"
  1210. fi
  1211. # QUIC support
  1212. AC_ARG_ENABLE([quic],
  1213. [AS_HELP_STRING([--enable-quic],[Enable QUIC API with wolfSSL TLS v1.3 (default: disabled)])],
  1214. [ ENABLED_QUIC=$enableval ],
  1215. [ ENABLED_QUIC=no ]
  1216. )
  1217. if test "$ENABLED_QUIC" = "yes"
  1218. then
  1219. if test "x$ENABLED_TLS13" = "xno"
  1220. then
  1221. AC_MSG_ERROR([TLS 1.3 is disabled - necessary for QUIC])
  1222. fi
  1223. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_QUIC"
  1224. # QUIC proto handlers need app_data at WOLFSSL*
  1225. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  1226. fi
  1227. # Post-handshake Authentication
  1228. AC_ARG_ENABLE([postauth],
  1229. [AS_HELP_STRING([--enable-postauth],[Enable wolfSSL Post-handshake Authentication (default: disabled)])],
  1230. [ ENABLED_TLS13_POST_AUTH=$enableval ],
  1231. [ ENABLED_TLS13_POST_AUTH=no ]
  1232. )
  1233. if test "$ENABLED_TLS13_POST_AUTH" = "yes"
  1234. then
  1235. if test "x$ENABLED_TLS13" = "xno"
  1236. then
  1237. AC_MSG_NOTICE([TLS 1.3 is disabled - disabling Post-handshake Authentication])
  1238. ENABLED_TLS13_POST_AUTH="no"
  1239. else
  1240. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_POST_HANDSHAKE_AUTH"
  1241. fi
  1242. fi
  1243. # Hello Retry Request Cookie
  1244. AC_ARG_ENABLE([hrrcookie],
  1245. [AS_HELP_STRING([--enable-hrrcookie],[Enable the server to send Cookie Extension in HRR with state (default: disabled)])],
  1246. [ ENABLED_SEND_HRR_COOKIE=$enableval ],
  1247. [ ENABLED_SEND_HRR_COOKIE=undefined ]
  1248. )
  1249. if test "$ENABLED_SEND_HRR_COOKIE" = "yes"
  1250. then
  1251. if test "x$ENABLED_TLS13" = "xno"
  1252. then
  1253. AC_MSG_NOTICE([TLS 1.3 is disabled - disabling HRR Cookie])
  1254. ENABLED_SEND_HRR_COOKIE="no"
  1255. else
  1256. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SEND_HRR_COOKIE"
  1257. fi
  1258. fi
  1259. # RNG
  1260. AC_ARG_ENABLE([rng],
  1261. [AS_HELP_STRING([--enable-rng],[Enable compiling and using RNG (default: enabled)])],
  1262. [ ENABLED_RNG=$enableval ],
  1263. [ ENABLED_RNG=yes ]
  1264. )
  1265. if test "$ENABLED_RNG" = "no"
  1266. then
  1267. AM_CFLAGS="$AM_CFLAGS -DWC_NO_RNG"
  1268. fi
  1269. # DTLS-SCTP
  1270. AC_ARG_ENABLE([sctp],
  1271. [AS_HELP_STRING([--enable-sctp],[Enable wolfSSL DTLS-SCTP support (default: disabled)])],
  1272. [ENABLED_SCTP=$enableval],
  1273. [ENABLED_SCTP=no])
  1274. AS_IF([test "x$ENABLED_SCTP" = "xyes"],
  1275. [AC_MSG_CHECKING([for SCTP])
  1276. AC_RUN_IFELSE(
  1277. [AC_LANG_PROGRAM(
  1278. [[
  1279. #include <sys/socket.h>
  1280. #include <arpa/inet.h>
  1281. ]],
  1282. [[int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); if (s == -1) return 1;]])],
  1283. [AC_MSG_RESULT(yes)],
  1284. [AC_MSG_RESULT(no)
  1285. AC_MSG_ERROR([SCTP not available, remove enable-sctp from configure])],
  1286. : ,
  1287. : ,
  1288. : )])
  1289. # DTLS-SRTP
  1290. AC_ARG_ENABLE([srtp],
  1291. [AS_HELP_STRING([--enable-srtp],[Enable wolfSSL DTLS-SRTP support (default: disabled)])],
  1292. [ENABLED_SRTP=$enableval],
  1293. [ENABLED_SRTP=no])
  1294. # DTLS-MULTICAST
  1295. AC_ARG_ENABLE([mcast],
  1296. [AS_HELP_STRING([--enable-mcast],[Enable wolfSSL DTLS multicast support (default: disabled)])],
  1297. [ENABLED_MCAST=$enableval],
  1298. [ENABLED_MCAST=no])
  1299. # List of open source project defines using our openssl compatibility layer:
  1300. # bind dns (--enable-bind) WOLFSSL_BIND
  1301. # libssh2 (--enable-libssh2)
  1302. # openssh (--enable-openssh) WOLFSSL_OPENSSH
  1303. # openvpn (--enable-openvpn) WOLFSSL_OPENVPN
  1304. # nginx (--enable-nginx) WOLFSSL_NGINX
  1305. # ntp (--enable-ntp)
  1306. # openresty (--enable-openresty)
  1307. # haproxy (--enable-haproxy) WOLFSSL_HAPROXY
  1308. # wpa_supplicant (--enable-wpas) WOLFSSL_WPAS
  1309. # ssl fortress (--enable-fortress) FORTRESS
  1310. # ssl bump (--enable-bump)
  1311. # signal (--enable-signal)
  1312. # lighty (--enable-lighty) HAVE_LIGHTY
  1313. # rsyslog (--enable-rsyslog)
  1314. # stunnel (--enable-stunnel) HAVE_STUNNEL
  1315. # curl (--enable-curl) HAVE_CURL
  1316. # libest (--enable-libest) HAVE_LIBEST
  1317. # asio (--enable-asio) WOLFSSL_ASIO
  1318. # libwebsockets (--enable-libwebsockets) WOLFSSL_LIBWEBSOCKETS
  1319. # qt (--enable-qt) WOLFSSL_QT
  1320. # qt test (--enable-qt-test) WOLFSSL_QT_TEST
  1321. # HAVE_POCO_LIB
  1322. # WOLFSSL_MYSQL_COMPATIBLE
  1323. # web server (--enable-webserver) HAVE_WEBSERVER
  1324. # net-snmp (--enable-net-snmp)
  1325. # krb (--enable-krb) WOLFSSL_KRB
  1326. # FFmpeg (--enable-ffmpeg) WOLFSSL_FFMPEG
  1327. # strongSwan (--enable-strongswan)
  1328. # OpenLDAP (--enable-openldap)
  1329. # hitch (--enable-hitch)
  1330. # Bind DNS compatibility Build
  1331. AC_ARG_ENABLE([bind],
  1332. [AS_HELP_STRING([--enable-bind],[Enable Bind DNS compatibility build (default: disabled)])],
  1333. [ENABLED_BIND=$enableval],
  1334. [ENABLED_BIND=no])
  1335. AC_ARG_ENABLE([libssh2],
  1336. [AS_HELP_STRING([--enable-libssh2],[Enable libssh2 compatibility build (default: disabled)])],
  1337. [ENABLED_LIBSSH2=$enableval],
  1338. [ENABLED_LIBSSH2=no])
  1339. # OpenSSH compatibility Build
  1340. AC_ARG_ENABLE([openssh],
  1341. [AS_HELP_STRING([--enable-openssh],[Enable OpenSSH compatibility build (default: disabled)])],
  1342. [ENABLED_OPENSSH=$enableval],
  1343. [ENABLED_OPENSSH=no])
  1344. # OpenVPN compatibility Build
  1345. AC_ARG_ENABLE([openvpn],
  1346. [AS_HELP_STRING([--enable-openvpn],[Enable OpenVPN compatibility build (default: disabled)])],
  1347. [ENABLED_OPENVPN=$enableval],
  1348. [ENABLED_OPENVPN=no])
  1349. # openresty compatibility build
  1350. AC_ARG_ENABLE([openresty],
  1351. [AS_HELP_STRING([--enable-openresty],[Enable openresty (default: disabled)])],
  1352. [ ENABLED_OPENRESTY=$enableval ],
  1353. [ ENABLED_OPENRESTY=no ]
  1354. )
  1355. # nginx compatibility build
  1356. AC_ARG_ENABLE([nginx],
  1357. [AS_HELP_STRING([--enable-nginx],[Enable nginx (default: disabled)])],
  1358. [ ENABLED_NGINX=$enableval ],
  1359. [ ENABLED_NGINX=no ]
  1360. )
  1361. # chrony support. Needs the compatibility layer for SNI callback functionality,
  1362. # but otherwise uses pure wolfCrypt.
  1363. AC_ARG_ENABLE([chrony],
  1364. [AS_HELP_STRING([--enable-chrony],[Enable chrony support (default: disabled)])],
  1365. [ ENABLED_CHRONY=$enableval ],
  1366. [ ENABLED_CHRONY=no ]
  1367. )
  1368. if test "$ENABLED_CHRONY" = "yes"
  1369. then
  1370. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  1371. fi
  1372. if test "$ENABLED_OPENRESTY" = "yes"
  1373. then
  1374. ENABLED_NGINX="yes"
  1375. fi
  1376. # OpenLDAP support
  1377. AC_ARG_ENABLE([openldap],
  1378. [AS_HELP_STRING([--enable-openldap],[Enable OpenLDAP support (default: disabled)])],
  1379. [ ENABLED_OPENLDAP=$enableval ],
  1380. [ ENABLED_OPENLDAP=no ]
  1381. )
  1382. # lighty Support
  1383. AC_ARG_ENABLE([lighty],
  1384. [AS_HELP_STRING([--enable-lighty],[Enable lighttpd/lighty (default: disabled)])],
  1385. [ ENABLED_LIGHTY=$enableval ],
  1386. [ ENABLED_LIGHTY=no ]
  1387. )
  1388. # rsyslog Support
  1389. AC_ARG_ENABLE([rsyslog],
  1390. [AS_HELP_STRING([--enable-rsyslog],[Enable rsyslog (default: disabled)])],
  1391. [ ENABLED_RSYSLOG=$enableval ],
  1392. [ ENABLED_RSYSLOG=no ]
  1393. )
  1394. # haproxy compatibility build
  1395. AC_ARG_ENABLE([haproxy],
  1396. [AS_HELP_STRING([--enable-haproxy],[Enable haproxy (default: disabled)])],
  1397. [ ENABLED_HAPROXY=$enableval ],
  1398. [ ENABLED_HAPROXY=no ]
  1399. )
  1400. # wpa_supplicant support
  1401. AC_ARG_ENABLE([wpas],
  1402. [AS_HELP_STRING([--enable-wpas],[Enable wpa_supplicant support (default: disabled)])],
  1403. [ ENABLED_WPAS=$enableval ],
  1404. [ ENABLED_WPAS=no ]
  1405. )
  1406. # wpa_supplicant support
  1407. AC_ARG_ENABLE([wpas-dpp],
  1408. [AS_HELP_STRING([--enable-wpas-dpp],[Enable wpa_supplicant support with dpp (default: disabled)])],
  1409. [ ENABLED_WPAS_DPP=$enableval ],
  1410. [ ENABLED_WPAS_DPP=no ]
  1411. )
  1412. if test "$ENABLED_WPAS_DPP" = "yes"
  1413. then
  1414. ENABLED_WPAS="yes"
  1415. fi
  1416. # ntp support
  1417. AC_ARG_ENABLE([ntp],
  1418. [AS_HELP_STRING([--enable-ntp],[Enable ntp support (default: disabled)])],
  1419. [ ENABLED_NTP=$enableval ],
  1420. [ ENABLED_NTP=no ]
  1421. )
  1422. # Fortress build
  1423. AC_ARG_ENABLE([fortress],
  1424. [AS_HELP_STRING([--enable-fortress],[Enable SSL fortress build (default: disabled)])],
  1425. [ ENABLED_FORTRESS=$enableval ],
  1426. [ ENABLED_FORTRESS=no ]
  1427. )
  1428. # libwebsockets Support
  1429. AC_ARG_ENABLE([libwebsockets],
  1430. [AS_HELP_STRING([--enable-libwebsockets],[Enable libwebsockets (default: disabled)])],
  1431. [ ENABLED_LIBWEBSOCKETS=$enableval ],
  1432. [ ENABLED_LIBWEBSOCKETS=no ]
  1433. )
  1434. if test "$ENABLED_LIBWEBSOCKETS" = "yes"
  1435. then
  1436. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LIBWEBSOCKETS -DHAVE_EX_DATA -DOPENSSL_NO_EC"
  1437. fi
  1438. if test "$ENABLED_OPENSSH" = "yes"
  1439. then
  1440. ENABLED_FORTRESS="yes"
  1441. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OPENSSH -DHAVE_EX_DATA -DWOLFSSL_BASE16"
  1442. fi
  1443. # net-snmp Build
  1444. AC_ARG_ENABLE([net-snmp],
  1445. [AS_HELP_STRING([--enable-net-snmp],[Enable net-snmp (default: disabled)])],
  1446. [ ENABLED_NETSNMP=$enableval ],
  1447. [ ENABLED_NETSNMP=no ]
  1448. )
  1449. # kerberos 5 Build
  1450. AC_ARG_ENABLE([krb],
  1451. [AS_HELP_STRING([--enable-krb],[Enable kerberos 5 support (default: disabled)])],
  1452. [ ENABLED_KRB=$enableval ],
  1453. [ ENABLED_KRB=no ]
  1454. )
  1455. # FFmpeg Build
  1456. AC_ARG_ENABLE([ffmpeg],
  1457. [AS_HELP_STRING([--enable-ffmpeg],[Enable FFmpeg support (default: disabled)])],
  1458. [ ENABLED_FFMPEG=$enableval ],
  1459. [ ENABLED_FFMPEG=no ]
  1460. )
  1461. #IP alternative name Support
  1462. AC_ARG_ENABLE([ip-alt-name],
  1463. [AS_HELP_STRING([--enable-ip-alt-name],[Enable IP subject alternative name (default: disabled)])],
  1464. [ ENABLE_IP_ALT_NAME=$enableval ],
  1465. [ ENABLE_IP_ALT_NAME=no ]
  1466. )
  1467. if test "$ENABLE_IP_ALT_NAME" = "yes"
  1468. then
  1469. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IP_ALT_NAME"
  1470. fi
  1471. #Qt Support
  1472. AC_ARG_ENABLE([qt],
  1473. [AS_HELP_STRING([--enable-qt],[Enable qt (default: disabled)])],
  1474. [ ENABLED_QT=$enableval ],
  1475. [ ENABLED_QT=no ]
  1476. )
  1477. # ssl bump build
  1478. AC_ARG_ENABLE([bump],
  1479. [AS_HELP_STRING([--enable-bump],[Enable SSL Bump build (default: disabled)])],
  1480. [ ENABLED_BUMP=$enableval ],
  1481. [ ENABLED_BUMP=no ]
  1482. )
  1483. # SNIFFER
  1484. AC_ARG_ENABLE([sniffer],
  1485. [AS_HELP_STRING([--enable-sniffer],[Enable wolfSSL sniffer support (default: disabled)])],
  1486. [ ENABLED_SNIFFER=$enableval ],
  1487. [ ENABLED_SNIFFER=no ]
  1488. )
  1489. # signal compatibility build
  1490. AC_ARG_ENABLE([signal],
  1491. [AS_HELP_STRING([--enable-signal],[Enable signal (default: disabled)])],
  1492. [ ENABLED_SIGNAL=$enableval ],
  1493. [ ENABLED_SIGNAL=no ]
  1494. )
  1495. # strongSwan support
  1496. AC_ARG_ENABLE([strongswan],
  1497. [AS_HELP_STRING([--enable-strongswan],[Enable strongSwan support (default: disabled)])],
  1498. [ ENABLED_STRONGSWAN=$enableval ],
  1499. [ ENABLED_STRONGSWAN=no ]
  1500. )
  1501. # hitch support
  1502. AC_ARG_ENABLE([hitch],
  1503. [AS_HELP_STRING([--enable-hitch],[Enable hitch support (default: disabled)])],
  1504. [ ENABLED_HITCH=$enableval ],
  1505. [ ENABLED_HITCH=no ]
  1506. )
  1507. # OpenSSL Coexist
  1508. AC_ARG_ENABLE([opensslcoexist],
  1509. [AS_HELP_STRING([--enable-opensslcoexist],[Enable coexistence of wolfssl/openssl (default: disabled)])],
  1510. [ ENABLED_OPENSSLCOEXIST=$enableval ],
  1511. [ ENABLED_OPENSSLCOEXIST=no ]
  1512. )
  1513. if test "x$ENABLED_OPENSSLCOEXIST" = "xyes" || test "$ENABLED_WOLFENGINE" = "yes"
  1514. then
  1515. # make sure old names are disabled
  1516. enable_oldnames=no
  1517. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COEXIST"
  1518. fi
  1519. # S/MIME
  1520. AC_ARG_ENABLE([smime],
  1521. [AS_HELP_STRING([--enable-smime],[Enable S/MIME (default: disabled)])],
  1522. [ ENABLED_SMIME=$enableval ],
  1523. [ ENABLED_SMIME=no ]
  1524. )
  1525. # Platform Security Architecture (PSA)
  1526. AC_ARG_ENABLE([psa],
  1527. [AS_HELP_STRING([--enable-psa],[use Platform Security Architecture (PSA) interface (default: disabled)])],
  1528. [ ENABLED_PSA=$enableval ],
  1529. [ ENABLED_PSA=no ]
  1530. )
  1531. AC_ARG_WITH([psa-include],
  1532. [AS_HELP_STRING([--with-psa-include=PATH],
  1533. [PATH to directory with PSA header files])],
  1534. [PSA_INCLUDE=$withval],
  1535. [PSA_INCLUDE=""])
  1536. AC_ARG_WITH([psa-lib],
  1537. [AS_HELP_STRING([--with-psa-lib=PATH],[PATH to directory with the PSA library])],
  1538. [PSA_LIB=$withval],
  1539. [PSA_LIB=""])
  1540. AC_ARG_WITH([psa-lib-name],
  1541. [AS_HELP_STRING([--with-psa-lib-name=NAME],[NAME of PSA library])],
  1542. [PSA_LIB_NAME=$withval],
  1543. [PSA_LIB_NAME=""])
  1544. AC_ARG_ENABLE([psa-lib-static],
  1545. [AS_HELP_STRING([--enable-psa-lib-static],[Link PSA as static library (default: disable)])],
  1546. [ ENABLED_PSA_STATIC=$enableval ],
  1547. [ ENABLED_PSA_STATIC=no ]
  1548. )
  1549. if test "x$ENABLED_PSA" = "xyes"
  1550. then
  1551. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_PSA"
  1552. fi
  1553. if test "x$ENABLED_PSA" != "xyes" && \
  1554. (test "x$PSA_LIB" != "x" || test "x$PSA_INCLUDE" != "x" || test "x$PSA_LIB_NAME" != "x" )
  1555. then
  1556. AC_MSG_ERROR([to use PSA you need to enable it with --enable-psa])
  1557. fi
  1558. if test -n "$PSA_LIB"
  1559. then
  1560. AC_MSG_CHECKING([for $PSA_LIB])
  1561. if ! test -d "$PSA_LIB"
  1562. then
  1563. AC_MSG_ERROR([PSA lib dir $PSA_LIB not found.])
  1564. fi
  1565. AC_MSG_RESULT([yes])
  1566. AM_LDFLAGS="$AM_LDFLAGS -L$PSA_LIB"
  1567. fi
  1568. if test -n "$PSA_LIB_NAME"
  1569. then
  1570. if test "x$ENABLED_PSA_STATIC" = "xyes"
  1571. then
  1572. LIB_STATIC_ADD="$LIB_STATIC_ADD $PSA_LIB/$PSA_LIB_NAME"
  1573. else
  1574. LIB_ADD="$LIB_ADD -l$PSA_LIB_NAME"
  1575. fi
  1576. fi
  1577. if test -n "$PSA_INCLUDE"
  1578. then
  1579. AC_MSG_CHECKING([for $PSA_INCLUDE])
  1580. if ! test -d "$PSA_INCLUDE"
  1581. then
  1582. AC_MSG_ERROR([psa include dir $PSA_INCLUDE not found.])
  1583. fi
  1584. AC_MSG_RESULT([yes])
  1585. AM_CFLAGS="$AM_CFLAGS -I$PSA_INCLUDE"
  1586. fi
  1587. AC_SUBST([PSA_LIB])
  1588. AC_SUBST([PSA_LIB_NAME])
  1589. AC_SUBST([PSA_INCLUDE])
  1590. # OPENSSL Compatibility ALL
  1591. AC_ARG_ENABLE([opensslall],
  1592. [AS_HELP_STRING([--enable-opensslall],[Enable all OpenSSL API, size++ (default: disabled)])],
  1593. [ ENABLED_OPENSSLALL=$enableval ],
  1594. [ ENABLED_OPENSSLALL=no ]
  1595. )
  1596. if test "$ENABLED_LIBWEBSOCKETS" = "yes" || test "$ENABLED_OPENVPN" = "yes" || \
  1597. test "$ENABLED_WPAS_DPP" = "yes" || test "$ENABLED_SMIME" = "yes" || \
  1598. test "$ENABLED_HAPROXY" = "yes" || test "$ENABLED_BIND" = "yes" || \
  1599. test "$ENABLED_NTP" = "yes" || test "$ENABLED_NETSNMP" = "yes" || \
  1600. test "$ENABLED_OPENRESTY" = "yes" || test "$ENABLED_RSYSLOG" = "yes" || \
  1601. test "$ENABLED_KRB" = "yes" || test "$ENABLED_CHRONY" = "yes" || \
  1602. test "$ENABLED_FFMPEG" = "yes" || test "$ENABLED_STRONGSWAN" = "yes" || \
  1603. test "$ENABLED_OPENLDAP" = "yes" || test "$ENABLED_HITCH" = "yes"
  1604. then
  1605. ENABLED_OPENSSLALL="yes"
  1606. fi
  1607. # OPENSSL Extra Compatibility
  1608. AC_ARG_ENABLE([opensslextra],
  1609. [AS_HELP_STRING([--enable-opensslextra],[Enable extra OpenSSL API, size+ (default: disabled)])],
  1610. [ ENABLED_OPENSSLEXTRA=$enableval ],
  1611. [ ENABLED_OPENSSLEXTRA=no ]
  1612. )
  1613. if test "$ENABLED_QUIC" = "yes"
  1614. then
  1615. ENABLED_OPENSSLEXTRA="yes"
  1616. fi
  1617. # One Error Queue per Thread
  1618. AC_ARG_ENABLE([error-queue-per-thread],
  1619. [AS_HELP_STRING([--enable-error-queue-per-thread],[Enable one error queue per thread. Requires thread local storage. (default: disabled)])],
  1620. [ ENABLED_ERRORQUEUEPERTHREAD=$enableval ],
  1621. [ ENABLED_ERRORQUEUEPERTHREAD=check ]
  1622. )
  1623. if test "$ENABLED_ERRORQUEUEPERTHREAD" = "check"
  1624. then
  1625. AS_IF([test "$thread_ls_on" = "no" ||
  1626. test "$ENABLED_SINGLETHREADED" = "yes"],
  1627. [ENABLED_ERRORQUEUEPERTHREAD=no],
  1628. [ENABLED_ERRORQUEUEPERTHREAD=yes])
  1629. fi
  1630. if test "$ENABLED_ERRORQUEUEPERTHREAD" = "yes"
  1631. then
  1632. if test "$thread_ls_on" != "yes"
  1633. then
  1634. AC_MSG_ERROR(error-queue-per-thread needs thread-local storage.)
  1635. fi
  1636. AM_CFLAGS="$AM_CFLAGS -DERROR_QUEUE_PER_THREAD"
  1637. fi
  1638. # High Strength Build
  1639. AC_ARG_ENABLE([maxstrength],
  1640. [AS_HELP_STRING([--enable-maxstrength],[Enable Max Strength build, allows TLSv1.2-AEAD-PFS ciphers only (default: disabled)])],
  1641. [ENABLED_MAXSTRENGTH=$enableval],
  1642. [ENABLED_MAXSTRENGTH=no])
  1643. # Harden, enable Timing Resistance and Blinding by default
  1644. AC_ARG_ENABLE([harden],
  1645. [AS_HELP_STRING([--enable-harden],[Enable Hardened build, Enables Timing Resistance and Blinding (default: enabled)])],
  1646. [ENABLED_HARDEN=$enableval],
  1647. [ENABLED_HARDEN=yes])
  1648. if test "$ENABLED_HARDEN" = "yes"
  1649. then
  1650. AM_CFLAGS="$AM_CFLAGS -DTFM_TIMING_RESISTANT -DECC_TIMING_RESISTANT"
  1651. if test "$ENABLED_RNG" = "yes"
  1652. then
  1653. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_BLINDING"
  1654. fi
  1655. else
  1656. AM_CFLAGS="$AM_CFLAGS -DWC_NO_HARDEN -DWC_NO_CACHE_RESISTANT"
  1657. fi
  1658. # IPv6 Test Apps
  1659. AC_ARG_ENABLE([ipv6],
  1660. [AS_HELP_STRING([--enable-ipv6],[Enable testing of IPV6 (default: disabled)])],
  1661. [ ENABLED_IPV6=$enableval ],
  1662. [ ENABLED_IPV6=no ]
  1663. )
  1664. if test "$ENABLED_IPV6" = "yes"
  1665. then
  1666. AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6 -DWOLFSSL_IPV6"
  1667. fi
  1668. if test "$ENABLED_WPAS" = "small"
  1669. then
  1670. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WPAS_SMALL"
  1671. fi
  1672. if test "$ENABLED_WPAS" = "yes"
  1673. then
  1674. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WPAS"
  1675. AM_CFLAGS="$AM_CFLAGS -DHAVE_SECRET_CALLBACK"
  1676. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_ECC_ADD_DBL"
  1677. fi
  1678. if test "$ENABLED_WPAS" != "no"
  1679. then
  1680. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_VERIFY_CB"
  1681. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  1682. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  1683. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE"
  1684. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE"
  1685. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
  1686. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
  1687. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DER_LOAD"
  1688. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  1689. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  1690. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB"
  1691. AM_CFLAGS="$AM_CFLAGS -DKEEP_OUR_CERT"
  1692. AM_CFLAGS="$AM_CFLAGS -DKEEP_PEER_CERT"
  1693. AM_CFLAGS="$AM_CFLAGS -DHAVE_KEYING_MATERIAL"
  1694. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE_REF"
  1695. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VALIDATE_ECC_IMPORT"
  1696. AM_CFLAGS="$AM_CFLAGS -DWC_CTC_NAME_SIZE=128"
  1697. if test "$ENABLED_OPENSSLEXTRA" = "no"
  1698. then
  1699. ENABLED_OPENSSLEXTRA="yes"
  1700. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  1701. fi
  1702. fi
  1703. if test "$ENABLED_FORTRESS" = "yes"
  1704. then
  1705. AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DWOLFSSL_ALWAYS_VERIFY_CB -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT -DWOLFSSL_DER_LOAD -DWOLFSSL_KEY_GEN"
  1706. fi
  1707. if test "$ENABLED_BUMP" = "yes"
  1708. then
  1709. AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DWOLFSSL_CERT_GEN -DWOLFSSL_KEY_GEN -DHUGE_SESSION_CACHE -DWOLFSSL_DER_LOAD -DWOLFSSL_ALT_NAMES -DWOLFSSL_TEST_CERT"
  1710. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  1711. fi
  1712. # lean psk build
  1713. AC_ARG_ENABLE([leanpsk],
  1714. [AS_HELP_STRING([--enable-leanpsk],[Enable Lean PSK build (default: disabled)])],
  1715. [ ENABLED_LEANPSK=$enableval ],
  1716. [ ENABLED_LEANPSK=no ]
  1717. )
  1718. if test "$ENABLED_LEANPSK" = "yes"
  1719. then
  1720. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANPSK -DWOLFSSL_STATIC_PSK -DHAVE_NULL_CIPHER -DSINGLE_THREADED -DNO_AES -DNO_FILESYSTEM -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_MD4 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_WRITEV -DNO_DEV_RANDOM -DWOLFSSL_USER_IO -DNO_SHA"
  1721. ENABLED_SLOWMATH="no"
  1722. ENABLED_SINGLETHREADED="yes"
  1723. enable_lowresource=yes
  1724. fi
  1725. # lean TLS build (TLS 1.2 client only (no client auth), ECC256, AES128 and SHA256 w/o Shamir)
  1726. AC_ARG_ENABLE([leantls],
  1727. [AS_HELP_STRING([--enable-leantls],[Enable Lean TLS build (default: disabled)])],
  1728. [ ENABLED_LEANTLS=$enableval ],
  1729. [ ENABLED_LEANTLS=no ]
  1730. )
  1731. if test "$ENABLED_LEANTLS" = "yes"
  1732. then
  1733. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SHA -DNO_PSK -DNO_WOLFSSL_MEMORY -DNO_WOLFSSL_CM_VERIFY"
  1734. enable_lowresource=yes
  1735. fi
  1736. # low resource options to reduce flash and memory use
  1737. AC_ARG_ENABLE([lowresource],
  1738. [AS_HELP_STRING([--enable-lowresource],[Enable low resource options for memory/flash (default: disabled)])],
  1739. [ ENABLED_LOWRESOURCE=$enableval ],
  1740. [ ENABLED_LOWRESOURCE=no ]
  1741. )
  1742. if test "$ENABLED_LOWRESOURCE" = "yes"
  1743. then
  1744. # low memory / flash flags
  1745. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE -DRSA_LOW_MEM -DCURVE25519_SMALL -DED25519_SMALL -DWOLFSSL_SMALL_CERT_VERIFY -DWOLFSSL_NO_ASYNC_IO"
  1746. # low flash flags
  1747. AM_CFLAGS="$AM_CFLAGS -DUSE_SLOW_SHA -DUSE_SLOW_SHA256 -DUSE_SLOW_SHA512"
  1748. # AES small
  1749. AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL -DWOLFSSL_AES_NO_UNROLL -DWOLFSSL_AES_SMALL_TABLES"
  1750. fi
  1751. # TITAN cache
  1752. AC_ARG_ENABLE([titancache],
  1753. [AS_HELP_STRING([--enable-titancache],[Enable titan session cache (default: disabled)])],
  1754. [ ENABLED_TITANCACHE=$enableval ],
  1755. [ ENABLED_TITANCACHE=no ]
  1756. )
  1757. if test "$ENABLED_TITANCACHE" = "yes"
  1758. then
  1759. AM_CFLAGS="$AM_CFLAGS -DTITAN_SESSION_CACHE"
  1760. fi
  1761. # HUGE cache
  1762. AC_ARG_ENABLE([hugecache],
  1763. [AS_HELP_STRING([--enable-hugecache],[Enable huge session cache (default: disabled)])],
  1764. [ ENABLED_HUGECACHE=$enableval ],
  1765. [ ENABLED_HUGECACHE=no ]
  1766. )
  1767. if test "$ENABLED_HUGECACHE" = "yes"
  1768. then
  1769. AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
  1770. fi
  1771. # big cache
  1772. AC_ARG_ENABLE([bigcache],
  1773. [AS_HELP_STRING([--enable-bigcache],[Enable big session cache (default: disabled)])],
  1774. [ ENABLED_BIGCACHE=$enableval ],
  1775. [ ENABLED_BIGCACHE=no ]
  1776. )
  1777. if test "$ENABLED_BIGCACHE" = "yes"
  1778. then
  1779. AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
  1780. fi
  1781. # SMALL cache
  1782. AC_ARG_ENABLE([smallcache],
  1783. [AS_HELP_STRING([--enable-smallcache],[Enable small session cache (default: disabled)])],
  1784. [ ENABLED_SMALLCACHE=$enableval ],
  1785. [ ENABLED_SMALLCACHE=no ]
  1786. )
  1787. if test "$ENABLED_SMALLCACHE" = "yes"
  1788. then
  1789. AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
  1790. fi
  1791. # Persistent session cache
  1792. AC_ARG_ENABLE([savesession],
  1793. [AS_HELP_STRING([--enable-savesession],[Enable persistent session cache (default: disabled)])],
  1794. [ ENABLED_SAVESESSION=$enableval ],
  1795. [ ENABLED_SAVESESSION=no ]
  1796. )
  1797. if test "$ENABLED_SAVESESSION" = "yes"
  1798. then
  1799. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  1800. fi
  1801. # Persistent cert cache
  1802. AC_ARG_ENABLE([savecert],
  1803. [AS_HELP_STRING([--enable-savecert],[Enable persistent cert cache (default: disabled)])],
  1804. [ ENABLED_SAVECERT=$enableval ],
  1805. [ ENABLED_SAVECERT=no ]
  1806. )
  1807. if test "$ENABLED_SAVECERT" = "yes"
  1808. then
  1809. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  1810. fi
  1811. # Write duplicate WOLFSSL object
  1812. AC_ARG_ENABLE([writedup],
  1813. [AS_HELP_STRING([--enable-writedup],[Enable write duplication of WOLFSSL objects (default: disabled)])],
  1814. [ ENABLED_WRITEDUP=$enableval ],
  1815. [ ENABLED_WRITEDUP=no ]
  1816. )
  1817. if test "$ENABLED_WRITEDUP" = "yes"
  1818. then
  1819. AM_CFLAGS="$AM_CFLAGS -DHAVE_WRITE_DUP"
  1820. fi
  1821. # Atomic User Record Layer
  1822. AC_ARG_ENABLE([atomicuser],
  1823. [AS_HELP_STRING([--enable-atomicuser],[Enable Atomic User Record Layer (default: disabled)])],
  1824. [ ENABLED_ATOMICUSER=$enableval ],
  1825. [ ENABLED_ATOMICUSER=no ]
  1826. )
  1827. if test "$ENABLED_ATOMICUSER" = "yes"
  1828. then
  1829. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  1830. fi
  1831. # Public Key Callbacks
  1832. AC_ARG_ENABLE([pkcallbacks],
  1833. [AS_HELP_STRING([--enable-pkcallbacks],[Enable Public Key Callbacks (default: disabled)])],
  1834. [ ENABLED_PKCALLBACKS=$enableval ],
  1835. [ ENABLED_PKCALLBACKS=no ]
  1836. )
  1837. if test "$ENABLED_PKCALLBACKS" = "yes"
  1838. then
  1839. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  1840. fi
  1841. # Maxim Integrated MAXQ10XX
  1842. ENABLED_MAXQ10XX="no"
  1843. maxqpartnumber=""
  1844. AC_ARG_WITH([maxq10xx],
  1845. [AS_HELP_STRING([--with-maxq10xx=PART],[MAXQ10XX PART Number])],
  1846. [
  1847. AC_MSG_CHECKING([for maxq10xx])
  1848. # Read the part number
  1849. maxqpartnumber=$withval
  1850. if test "$maxqpartnumber" = "MAXQ1065"; then
  1851. LIB_STATIC_ADD="$LIB_STATIC_ADD lib/libmaxq1065_api.a"
  1852. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAXQ1065"
  1853. ENABLED_MAXQ10XX="yes"
  1854. AC_CHECK_LIB([rt], [clock_gettime])
  1855. elif test "$maxqpartnumber" = "MAXQ108x"; then
  1856. LIB_STATIC_ADD="$LIB_STATIC_ADD lib/libmaxq108x_api.a"
  1857. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAXQ108X"
  1858. ENABLED_MAXQ10XX="yes"
  1859. AC_CHECK_LIB([rt], [clock_gettime])
  1860. else
  1861. AC_MSG_ERROR([need a valid MAXQ part number])
  1862. fi
  1863. AC_MSG_RESULT([yes])
  1864. ]
  1865. )
  1866. # Microchip/Atmel CryptoAuthLib
  1867. ENABLED_CRYPTOAUTHLIB="no"
  1868. trylibatcadir=""
  1869. AC_ARG_WITH([cryptoauthlib],
  1870. [AS_HELP_STRING([--with-cryptoauthlib=PATH],[PATH to CryptoAuthLib install (default /usr/)])],
  1871. [
  1872. AC_MSG_CHECKING([for cryptoauthlib])
  1873. CPPFLAGS="$CPPFLAGS -DWOLFSSL_ATECC508A"
  1874. LIBS="$LIBS -lcryptoauth"
  1875. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cryptoauthlib.h>]], [[ atcab_init(0); ]])],[ libatca_linked=yes ],[ libatca_linked=no ])
  1876. if test "x$libatca_linked" = "xno" ; then
  1877. if test "x$withval" != "xno" ; then
  1878. trylibatcadir=$withval
  1879. fi
  1880. if test "x$withval" = "xyes" ; then
  1881. trylibatcadir="/usr"
  1882. fi
  1883. LDFLAGS="$LDFLAGS -L$trylibatcadir/lib"
  1884. CPPFLAGS="$CPPFLAGS -I$trylibatcadir/lib"
  1885. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cryptoauthlib.h>]], [[ atcab_init(0); ]])],[ libatca_linked=yes ],[ libatca_linked=no ])
  1886. if test "x$libatca_linked" = "xno" ; then
  1887. AC_MSG_ERROR([cryptoauthlib isn't found.
  1888. If it's already installed, specify its path using --with-cryptoauthlib=/dir/])
  1889. fi
  1890. AM_LDFLAGS="$AM_LDFLAGS -L$trylibatcadir/lib"
  1891. AM_CFLAGS="$AM_CFLAGS -I$trylibatcadir/lib"
  1892. AC_MSG_RESULT([yes])
  1893. else
  1894. AC_MSG_RESULT([yes])
  1895. fi
  1896. ENABLED_CRYPTOAUTHLIB="yes"
  1897. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ATECC508A"
  1898. ]
  1899. )
  1900. # NXP SE050
  1901. # Example: "./configure --with-se050=/home/pi/simw_top"
  1902. ENABLED_SE050="no"
  1903. trylibse050dir=""
  1904. AC_ARG_WITH([se050],
  1905. [AS_HELP_STRING([--with-se050=PATH],[PATH to SE050 install (default /usr/local)])],
  1906. [
  1907. AC_MSG_CHECKING([for SE050])
  1908. LIBS="$LIBS -lSSS_APIs"
  1909. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fsl_sss_api.h>]], [[ sss_mac_init(0);]])],[ libse050_linked=yes ],[ libse050_linked=no ])
  1910. if test "x$libse050_linked" = "xno" ; then
  1911. if test "x$withval" != "xno" ; then
  1912. trylibse050dir=$withval
  1913. fi
  1914. if test "x$withval" = "xyes" ; then
  1915. trylibse050dir="/usr/local"
  1916. fi
  1917. LDFLAGS="$LDFLAGS -L$trylibse050dir/lib"
  1918. LDFLAGS="$LDFLAGS -L$trylibse050dir/build/sss"
  1919. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/include/se05x"
  1920. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/build"
  1921. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/inc"
  1922. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/ex/inc"
  1923. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/port/default"
  1924. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/inc"
  1925. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/libCommon/log"
  1926. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/libCommon/infra"
  1927. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/se05x_03_xx_xx"
  1928. if test -e "$trylibse050dir/build/sss/libSSS_APIs.a"; then
  1929. SE050_STATIC=yes
  1930. else
  1931. SE050_STATIC=no
  1932. fi
  1933. if test "x$SE050_STATIC" = "xyes"; then
  1934. LIB_STATIC_ADD="$trylibse050dir/build/sss/ex/src/libex_common.a \
  1935. $trylibse050dir/build/sss/libSSS_APIs.a \
  1936. $trylibse050dir/build/hostlib/hostLib/se05x/libse05x.a \
  1937. $trylibse050dir/build/hostlib/hostLib/liba7x_utils.a \
  1938. $trylibse050dir/build/hostlib/hostLib/libCommon/log/libmwlog.a \
  1939. $trylibse050dir/build/hostlib/hostLib/libCommon/libsmCom.a $LIB_STATIC_ADD"
  1940. else
  1941. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fsl_sss_api.h>]], [[ sss_mac_init(0); ]])],[ libse050_linked=yes ],[ libse050_linked=no ])
  1942. if test "x$libse050_linked" = "xno" ; then
  1943. AC_MSG_ERROR([SE050 isn't found.
  1944. If it's already installed, specify its path using --with-se050=/dir/])
  1945. fi
  1946. fi
  1947. # Requires AES direct
  1948. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"
  1949. # Does not support SHA2-512 224/256
  1950. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  1951. AC_MSG_RESULT([yes])
  1952. else
  1953. AC_MSG_RESULT([yes])
  1954. fi
  1955. ENABLED_SE050="yes"
  1956. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SE050 -DSSS_USE_FTR_FILE"
  1957. ]
  1958. )
  1959. ENABLED_SNIFFTEST=no
  1960. AS_IF([ test "x$ENABLED_SNIFFER" = "xyes" ],
  1961. [
  1962. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SNIFFER -DWOLFSSL_STATIC_EPHEMERAL"
  1963. AC_CHECK_HEADERS([pcap/pcap.h],
  1964. [ ENABLED_SNIFFTEST=yes ],
  1965. [ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]
  1966. )
  1967. ])
  1968. # AES-CBC
  1969. AC_ARG_ENABLE([aescbc],
  1970. [AS_HELP_STRING([--enable-aescbc],[Enable wolfSSL AES-CBC support (default: enabled)])],
  1971. [ ENABLED_AESCBC=$enableval ],
  1972. [ ENABLED_AESCBC=yes ]
  1973. )
  1974. if test "$ENABLED_AESCBC" = "no"
  1975. then
  1976. AM_CFLAGS="$AM_CFLAGS -DNO_AES_CBC"
  1977. AM_CCASFLAGS="$AM_CCASFLAGS -DNO_AES_CBC"
  1978. fi
  1979. # AES-CBC length checks (checks that input lengths are multiples of block size)
  1980. AC_ARG_ENABLE([aescbc_length_checks],
  1981. [AS_HELP_STRING([--enable-aescbc-length-checks],[Enable AES-CBC length validity checks (default: disabled)])],
  1982. [ ENABLED_AESCBC_LENGTH_CHECKS=$enableval ],
  1983. [ ENABLED_AESCBC_LENGTH_CHECKS=no ]
  1984. )
  1985. if test "$ENABLED_AESCBC_LENGTH_CHECKS" = "yes"
  1986. then
  1987. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CBC_LENGTH_CHECKS"
  1988. fi
  1989. # leanpsk and leantls don't need gcm
  1990. # AES-GCM
  1991. AC_ARG_ENABLE([aesgcm],
  1992. [AS_HELP_STRING([--enable-aesgcm],[Enable wolfSSL AES-GCM support (default: enabled)])],
  1993. [ ENABLED_AESGCM=$enableval ],
  1994. [ ENABLED_AESGCM=yes ]
  1995. )
  1996. AC_ARG_ENABLE([aesgcm-stream],
  1997. [AS_HELP_STRING([--enable-aesgcm-stream],[Enable wolfSSL AES-GCM support with streaming APIs (default: disabled)])],
  1998. [ ENABLED_AESGCM_STREAM=$enableval ],
  1999. [ ENABLED_AESGCM_STREAM=no ]
  2000. )
  2001. # leanpsk and leantls don't need gcm
  2002. if test "$FIPS_VERSION" = "rand" || test "$ENABLED_LEANPSK" = "yes" ||
  2003. (test "$ENABLED_LEANTLS" = "yes" && test "$ENABLED_TLS13" = "no")
  2004. then
  2005. ENABLED_AESGCM=no
  2006. fi
  2007. if test "$ENABLED_AESGCM" = "yes" && test "$ac_cv_c_bigendian" != "yes"
  2008. then
  2009. ENABLED_AESGCM="4bit"
  2010. fi
  2011. # AES-CCM
  2012. AC_ARG_ENABLE([aesccm],
  2013. [AS_HELP_STRING([--enable-aesccm],[Enable wolfSSL AES-CCM support (default: disabled)])],
  2014. [ ENABLED_AESCCM=$enableval ],
  2015. [ ENABLED_AESCCM=no ]
  2016. )
  2017. if test "$ENABLED_AESCCM" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  2018. then
  2019. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"
  2020. AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESCCM"
  2021. fi
  2022. # AES-SIV (RFC 5297)
  2023. AC_ARG_ENABLE([aessiv],
  2024. [AS_HELP_STRING([--enable-aessiv],[Enable AES-SIV (RFC 5297) (default: disabled)])],
  2025. [ ENABLED_AESSIV=$enableval ],
  2026. [ ENABLED_AESSIV=no ]
  2027. )
  2028. if test "$ENABLED_CHRONY" = "yes"
  2029. then
  2030. ENABLED_AESSIV=yes
  2031. fi
  2032. # AES-CTRf
  2033. AC_ARG_ENABLE([aesctr],
  2034. [AS_HELP_STRING([--enable-aesctr],[Enable wolfSSL AES-CTR support (default: disabled)])],
  2035. [ ENABLED_AESCTR=$enableval ],
  2036. [ ENABLED_AESCTR=no ]
  2037. )
  2038. if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  2039. then
  2040. ENABLED_AESCTR=yes
  2041. fi
  2042. if test "$ENABLED_QUIC" = "yes"
  2043. then
  2044. ENABLED_AESCTR=yes
  2045. fi
  2046. # AES-OFB
  2047. AC_ARG_ENABLE([aesofb],
  2048. [AS_HELP_STRING([--enable-aesofb],[Enable wolfSSL AES-OFB support (default: disabled)])],
  2049. [ ENABLED_AESOFB=$enableval ],
  2050. [ ENABLED_AESOFB=no ]
  2051. )
  2052. if test "$ENABLED_AESOFB" = "yes"
  2053. then
  2054. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB -DWOLFSSL_AES_DIRECT"
  2055. fi
  2056. # AES-CFB
  2057. AC_ARG_ENABLE([aescfb],
  2058. [AS_HELP_STRING([--enable-aescfb],[Enable wolfSSL AES-CFB support (default: disabled)])],
  2059. [ ENABLED_AESCFB=$enableval ],
  2060. [ ENABLED_AESCFB=no ]
  2061. )
  2062. if test "$ENABLED_AESCFB" = "yes"
  2063. then
  2064. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  2065. fi
  2066. # SM4
  2067. ENABLED_SM4="no"
  2068. AC_ARG_ENABLE([sm4-ecb],
  2069. [AS_HELP_STRING([--enable-sm4-ecb],[Enable wolfSSL SM4-ECB support (default: disabled)])],
  2070. [ ENABLED_SM4_ECB=$enableval ],
  2071. [ ENABLED_SM4_ECB=no ]
  2072. )
  2073. if test "$ENABLED_SM4_ECB" = "small"
  2074. then
  2075. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_SMALL"
  2076. fi
  2077. if test "$ENABLED_SM4_ECB" != "no"
  2078. then
  2079. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_ECB"
  2080. ENABLED_SM4="yes"
  2081. fi
  2082. AC_ARG_ENABLE([sm4-cbc],
  2083. [AS_HELP_STRING([--enable-sm4-cbc],[Enable wolfSSL SM4-CBC support (default: disabled)])],
  2084. [ ENABLED_SM4_CBC=$enableval ],
  2085. [ ENABLED_SM4_CBC=no ]
  2086. )
  2087. if test "$ENABLED_SM4_CBC" = "small"
  2088. then
  2089. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_SMALL"
  2090. fi
  2091. if test "$ENABLED_SM4_CBC" != "no"
  2092. then
  2093. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_CBC"
  2094. ENABLED_SM4="yes"
  2095. fi
  2096. AC_ARG_ENABLE([sm4-ctr],
  2097. [AS_HELP_STRING([--enable-sm4-ctr],[Enable wolfSSL SM4-CTR support (default: disabled)])],
  2098. [ ENABLED_SM4_CTR=$enableval ],
  2099. [ ENABLED_SM4_CTR=no ]
  2100. )
  2101. if test "$ENABLED_SM4_CTR" = "small"
  2102. then
  2103. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_SMALL"
  2104. fi
  2105. if test "$ENABLED_SM4_CTR" != "no"
  2106. then
  2107. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_CTR"
  2108. ENABLED_SM4="yes"
  2109. fi
  2110. AC_ARG_ENABLE([sm4-gcm],
  2111. [AS_HELP_STRING([--enable-sm4-gcm],[Enable wolfSSL SM4-GCM support (default: disabled)])],
  2112. [ ENABLED_SM4_GCM=$enableval ],
  2113. [ ENABLED_SM4_GCM=no ]
  2114. )
  2115. if test "$ENABLED_SM4_GCM" = "small"
  2116. then
  2117. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_SMALL"
  2118. fi
  2119. if test "$ENABLED_SM4_GCM" != "no"
  2120. then
  2121. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_GCM"
  2122. ENABLED_SM4="yes"
  2123. fi
  2124. AC_ARG_ENABLE([sm4-ccm],
  2125. [AS_HELP_STRING([--enable-sm4-ccm],[Enable wolfSSL SM4-CCM support (default: disabled)])],
  2126. [ ENABLED_SM4_CCM=$enableval ],
  2127. [ ENABLED_SM4_CCM=no ]
  2128. )
  2129. if test "$ENABLED_SM4_CCM" = "small"
  2130. then
  2131. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_SMALL"
  2132. fi
  2133. if test "$ENABLED_SM4_CCM" != "no"
  2134. then
  2135. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4_CCM"
  2136. ENABLED_SM4="yes"
  2137. fi
  2138. if test "$ENABLED_SM4" = "yes"
  2139. then
  2140. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM4"
  2141. fi
  2142. ENABLED_ARMASM_INLINE="no"
  2143. ENABLED_ARMASM_SHA3="no"
  2144. ENABLED_ARMASM_CRYPTO_SM4="no"
  2145. # ARM Assembly
  2146. # Both SHA3 and SHA512 instructions available with ARMV8.2-a
  2147. AC_ARG_ENABLE([armasm],
  2148. [AS_HELP_STRING([--enable-armasm],[Enable wolfSSL ARMv8 ASM support (default: disabled). Set to sha512-crypto or sha3-crypto to use SHA512 and SHA3 instructions with Aarch64 CPU.])],
  2149. [ ENABLED_ARMASM=$enableval ],
  2150. [ ENABLED_ARMASM=no ]
  2151. )
  2152. if test "$ENABLED_ARMASM" != "no" && test "$ENABLED_ASM" = "yes"
  2153. then
  2154. for v in `echo $ENABLED_ARMASM | tr "," " "`
  2155. do
  2156. case $v in
  2157. yes)
  2158. ;;
  2159. inline)
  2160. ENABLED_ARMASM_INLINE=yes
  2161. ;;
  2162. sha512-crypto | sha3-crypto)
  2163. case $host_cpu in
  2164. *aarch64*)
  2165. ;;
  2166. *)
  2167. AC_MSG_ERROR([SHA512/SHA3 instructions only available on Aarch64 CPU.])
  2168. break;;
  2169. esac
  2170. ENABLED_ARMASM_SHA3=yes
  2171. ENABLED_ARMASM_PLUS=yes
  2172. ;;
  2173. sm4)
  2174. case $host_cpu in
  2175. *aarch64*)
  2176. ;;
  2177. *)
  2178. AC_MSG_ERROR([SM4 instructions only available on Aarch64 CPU.])
  2179. break;;
  2180. esac
  2181. ENABLED_ARMASM_SM4=yes
  2182. # gcc requires -march=...+sm4 to enable SM4 instructions
  2183. ENABLED_ARMASM_CRYPTO_SM4=yes
  2184. ENABLED_ARMASM_PLUS=yes
  2185. ;;
  2186. sm3)
  2187. case $host_cpu in
  2188. *aarch64*)
  2189. ;;
  2190. *)
  2191. AC_MSG_ERROR([SM3 instructions only available on Aarch64 CPU.])
  2192. break;;
  2193. esac
  2194. ENABLED_ARMASM_SM3=yes
  2195. # gcc requires -march=...+sm4 to enable SM3 instructions
  2196. ENABLED_ARMASM_CRYPTO_SM4=yes
  2197. ENABLED_ARMASM_PLUS=yes
  2198. ;;
  2199. *)
  2200. AC_MSG_ERROR([Invalid choice of ARM asm inclusions (yes, sha512-crypto, sha3-crypto): $ENABLED_ARMASM.])
  2201. break;;
  2202. esac
  2203. done
  2204. ENABLED_ARMASM="yes"
  2205. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ARMASM"
  2206. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM -DWOLFSSL_NO_HASH_RAW"
  2207. #Check if mcpu and mfpu values already set if not use default
  2208. case $CPPFLAGS in
  2209. *mcpu* | *mfpu*)
  2210. break;; #Do not override user set values
  2211. *)
  2212. case $host_cpu in
  2213. *aarch64*)
  2214. case $host_os in
  2215. *darwin*)
  2216. # All known Aarch64 Mac computers support SHA-512 instructions
  2217. ENABLED_ARMASM_SHA3=yes
  2218. ;;
  2219. *)
  2220. # +crypto needed for hardware acceleration
  2221. if test "$ENABLED_ARMASM_PLUS" = "yes"; then
  2222. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv8.2-a+crypto"
  2223. if test "$ENABLED_ARMASM_SHA3" = "yes"; then
  2224. AM_CPPFLAGS="$AM_CPPFLAGS+sha3"
  2225. fi
  2226. if test "$ENABLED_ARMASM_CRYPTO_SM4" = "yes"; then
  2227. AM_CPPFLAGS="$AM_CPPFLAGS+sm4"
  2228. fi
  2229. else
  2230. AM_CPPFLAGS="$AM_CPPFLAGS -mcpu=generic+crypto"
  2231. fi
  2232. ;;
  2233. esac
  2234. # Include options.h
  2235. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2236. ENABLED_ARMASM_CRYPTO=yes
  2237. ENABLED_ARMASM_NEON=yes
  2238. # Check for and set -mstrict-align compiler flag
  2239. # Used to set assumption that Aarch64 systems will not handle
  2240. # unaligned memory references. The flag -mstrict-align is needed
  2241. # on some compiler versions to avoid an invalid addressing mode
  2242. # error with "m" constraint variables in the inline assembly AES
  2243. # code. Even though unaligned load/store access is permitted on
  2244. # normal memory with Cortex-A series boards with the exception
  2245. # being exclusive and ordered access.
  2246. case $CPPFLAGS in
  2247. *mstrict-align*)
  2248. break;; # already set by user
  2249. *)
  2250. AM_CPPFLAGS="$AM_CPPFLAGS -mstrict-align"
  2251. AC_MSG_NOTICE([64bit ARMv8, setting -mstrict-align]);;
  2252. esac
  2253. AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto])
  2254. ;;
  2255. armv7a*)
  2256. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-a -mfpu=neon -DWOLFSSL_ARM_ARCH=7 -marm"
  2257. # Include options.h
  2258. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2259. ENABLED_ARMASM_CRYPTO=no
  2260. ENABLED_AESGCM_STREAM=no # not yet implemented
  2261. ENABLED_ARMASM_NEON=yes
  2262. AC_MSG_NOTICE([32bit ARMv7-a found, setting mfpu to neon])
  2263. ;;
  2264. armv7m*)
  2265. # QEMU doesn't work with armv7-m
  2266. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -D__thumb__ -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=7"
  2267. # Include options.h
  2268. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2269. ENABLED_ARMASM_CRYPTO=no
  2270. ENABLED_AESGCM_STREAM=no # not yet implemented
  2271. ENABLED_ARMASM_NEON=no
  2272. AC_MSG_NOTICE([32bit ARMv7-m found])
  2273. ;;
  2274. armv6*)
  2275. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv6 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=6"
  2276. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2277. ENABLED_ARMASM_CRYPTO=no
  2278. ENABLED_AESGCM_STREAM=no # not yet implemented
  2279. ENABLED_ARMASM_NEON=no
  2280. AC_MSG_NOTICE([32bit ARMv6 found])
  2281. ;;
  2282. armv4*)
  2283. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv4 -fomit-frame-pointer -DWOLFSSL_ARMASM_NO_HW_CRYPTO -DWOLFSSL_ARM_ARCH=4"
  2284. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2285. ENABLED_ARMASM_CRYPTO=no
  2286. ENABLED_AESGCM_STREAM=no # not yet implemented
  2287. ENABLED_ARMASM_NEON=no
  2288. AC_MSG_NOTICE([32bit ARMv4 found])
  2289. ;;
  2290. *)
  2291. AM_CPPFLAGS="$AM_CPPFLAGS -mfpu=crypto-neon-fp-armv8 -marm"
  2292. # Include options.h
  2293. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  2294. ENABLED_ARMASM_CRYPTO=yes
  2295. ENABLED_ARMASM_NEON=yes
  2296. AC_MSG_NOTICE([32bit ARMv8 found, setting mfpu to crypto-neon-fp-armv8])
  2297. ;;
  2298. esac
  2299. esac
  2300. fi
  2301. if test "$ENABLED_ARMASM_SHA3" = "yes"; then
  2302. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_CRYPTO_SHA512 -DWOLFSSL_ARMASM_CRYPTO_SHA3"
  2303. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ARMASM_CRYPTO_SHA512 -DWOLFSSL_ARMASM_CRYPTO_SHA3"
  2304. fi
  2305. if test "$ENABLED_ARMASM_SM3" = "yes"; then
  2306. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_CRYPTO_SM3"
  2307. fi
  2308. if test "$ENABLED_ARMASM_SM4" = "yes"; then
  2309. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_CRYPTO_SM4"
  2310. fi
  2311. if test "$ENABLED_ARMASM_CRYPTO" = "no"; then
  2312. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_NO_HW_CRYPTO"
  2313. fi
  2314. if test "$ENABLED_ARMASM_NEON" = "no"; then
  2315. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_NO_NEON"
  2316. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ARMASM_NO_NEON"
  2317. fi
  2318. if test "$ENABLED_ARMASM_INLINE" = "yes"; then
  2319. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_INLINE"
  2320. fi
  2321. # Xilinx hardened crypto
  2322. AC_ARG_ENABLE([xilinx],
  2323. [AS_HELP_STRING([--enable-xilinx],[Enable wolfSSL support for Xilinx hardened crypto(default: disabled)])],
  2324. [ ENABLED_XILINX=$enableval ],
  2325. [ ENABLED_XILINX=no ]
  2326. )
  2327. if test "$ENABLED_XILINX" = "yes"
  2328. then
  2329. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XILINX -DWOLFSSL_XILINX_CRYPT"
  2330. fi
  2331. # CAAM build
  2332. trylibsecodir="/usr"
  2333. AC_ARG_WITH([seco],
  2334. [AS_HELP_STRING([--with-seco=PATH],[PATH to SECO install (default /usr/lib/)])],
  2335. [
  2336. AC_MSG_CHECKING([for SECO])
  2337. if test "x$withval" != "xno" ; then
  2338. trylibsecodir=$withval
  2339. fi
  2340. ]
  2341. )
  2342. AC_ARG_ENABLE([aria],
  2343. [AS_HELP_STRING([--enable-aria],[Enable wolfSSL support for ARIA (default: disabled)])],
  2344. [ ENABLED_ARIA=$enableval ],
  2345. [ ENABLED_ARIA=no ]
  2346. )
  2347. if test "$ENABLED_ARIA" = "yes"
  2348. then
  2349. ARIA_DIR=MagicCrypto
  2350. # Enable dependency
  2351. CFLAGS="$CFLAGS -I$ARIA_DIR/include"
  2352. AM_CFLAGS="$AM_CFLAGS -DHAVE_ARIA"
  2353. AM_LDFLAGS="$AM_LDFLAGS -L$ARIA_DIR/lib -lMagicCrypto"
  2354. build_pwd="$(pwd)"
  2355. headers="mcapi_error.h mcapi_type.h mcapi.h"
  2356. for header in $headers
  2357. do
  2358. AC_CHECK_HEADER([$header], [], [
  2359. AC_MSG_ERROR([Error including $header. Please put the MagicCrypto library in $build_pwd.])
  2360. ], [
  2361. extern int dummy_int_to_make_compiler_happy;
  2362. ])
  2363. done
  2364. fi
  2365. AC_ARG_ENABLE([caam],
  2366. [AS_HELP_STRING([--enable-caam],[Enable wolfSSL support for CAAM (default: disabled)])],
  2367. [ ENABLED_CAAM=$enableval ],
  2368. [ ENABLED_CAAM=no ]
  2369. )
  2370. if test "$ENABLED_CAAM" != "no"
  2371. then
  2372. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM"
  2373. for v in `echo $ENABLED_CAAM | tr "," " "`
  2374. do
  2375. case $v in
  2376. qnx)
  2377. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_QNX_CAAM"
  2378. ENABLED_CAAM_QNX="yes"
  2379. ;;
  2380. imx6q)
  2381. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IMX6Q_CAAM"
  2382. ;;
  2383. imx6ul)
  2384. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IMX6UL_CAAM"
  2385. ;;
  2386. seco)
  2387. SECO_DIR=$trylibsecodir
  2388. AM_CPPFLAGS="$AM_CPPFLAGS -I$SECO_DIR/include"
  2389. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM -DWOLFSSL_SECO_CAAM"
  2390. AC_CHECK_LIB([hsm_lib],[hsm_open_session])
  2391. AC_CHECK_LIB([seco_nvm_manager],[seco_nvm_manager])
  2392. LIB_STATIC_ADD="$LIB_STATIC_ADD $SECO_DIR/lib/hsm_lib.a $SECO_DIR/lib/seco_nvm_manager.a"
  2393. LIB_ADD="$LIB_ADD -lz"
  2394. ;;
  2395. esac
  2396. done
  2397. fi
  2398. # INTEL AES-NI
  2399. AC_ARG_ENABLE([aesni],
  2400. [AS_HELP_STRING([--enable-aesni],[Enable wolfSSL AES-NI support (default: disabled)])],
  2401. [ ENABLED_AESNI=$enableval ],
  2402. [ ENABLED_AESNI=no ]
  2403. )
  2404. # INTEL ASM
  2405. AC_ARG_ENABLE([intelasm],
  2406. [AS_HELP_STRING([--enable-intelasm],[Enable All Intel ASM speedups (default: disabled)])],
  2407. [ ENABLED_INTELASM=$enableval ],
  2408. [ ENABLED_INTELASM=no ]
  2409. )
  2410. if test "$ENABLED_ASM" = "yes"
  2411. then
  2412. if test "$ENABLED_AESNI" = "small"
  2413. then
  2414. AM_CFLAGS="$AM_CFLAGS -DAES_GCM_AESNI_NO_UNROLL"
  2415. ENABLED_AESNI=yes
  2416. fi
  2417. if test "$ENABLED_AESNI" = "yes" || test "$ENABLED_INTELASM" = "yes"
  2418. then
  2419. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESNI"
  2420. if test "$CC" != "icc"
  2421. then
  2422. case $host_os in
  2423. mingw*)
  2424. # Windows uses intrinsics for GCM which uses SSE4 instructions.
  2425. # MSVC has own build files.
  2426. AM_CFLAGS="$AM_CFLAGS -maes -msse4 -mpclmul"
  2427. ;;
  2428. *)
  2429. # Intrinsics used in AES_set_decrypt_key (TODO: rework)
  2430. AM_CFLAGS="$AM_CFLAGS -maes"
  2431. ;;
  2432. esac
  2433. fi
  2434. AS_IF([test "x$ENABLED_AESGCM" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"])
  2435. AS_IF([test "x$ENABLED_SM3" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SM3"])
  2436. fi
  2437. if test "$ENABLED_INTELASM" = "yes"
  2438. then
  2439. AM_CFLAGS="$AM_CFLAGS -DUSE_INTEL_SPEEDUP"
  2440. ENABLED_AESNI=yes
  2441. fi
  2442. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"
  2443. then
  2444. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_X86_64_BUILD"
  2445. fi
  2446. if test "$host_cpu" = "x86"
  2447. then
  2448. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_X86_BUILD"
  2449. ENABLED_X86_ASM=yes
  2450. fi
  2451. fi
  2452. AC_ARG_ENABLE([aligndata],
  2453. [AS_HELP_STRING([--enable-aligndata],[align data for ciphers (default: enabled)])],
  2454. [ ENABLED_ALIGN_DATA=$enableval ],
  2455. [ ENABLED_ALIGN_DATA=yes ]
  2456. )
  2457. if test "$ENABLED_ALIGN_DATA" = "yes"
  2458. then
  2459. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_USE_ALIGN"
  2460. fi
  2461. # INTEL RDRAND
  2462. AC_ARG_ENABLE([intelrand],
  2463. [AS_HELP_STRING([--enable-intelrand],[Enable Intel rdrand as preferred RNG source (default: disabled)])],
  2464. [ ENABLED_INTELRDRAND=$enableval ],
  2465. [ ENABLED_INTELRDRAND=no ]
  2466. )
  2467. if test "$ENABLED_INTELRDRAND" = "yes"
  2468. then
  2469. AM_CFLAGS="$AM_CFLAGS -DHAVE_INTEL_RDRAND"
  2470. fi
  2471. # AMD RDSEED
  2472. AC_ARG_ENABLE([amdrand],
  2473. [AS_HELP_STRING([--enable-amdrand],[Enable AMD rdseed as preferred RNG seeding source (default: disabled)])],
  2474. [ ENABLED_AMDRDSEED=$enableval ],
  2475. [ ENABLED_AMDRDSEED=no ]
  2476. )
  2477. if test "$ENABLED_AMDRDSEED" = "yes"
  2478. then
  2479. AM_CFLAGS="$AM_CFLAGS -DHAVE_AMD_RDSEED"
  2480. fi
  2481. # Linux af_alg
  2482. AC_ARG_ENABLE([afalg],
  2483. [AS_HELP_STRING([--enable-afalg],[Enable Linux af_alg use for crypto (default: disabled)])],
  2484. [ ENABLED_AFALG=$enableval ],
  2485. [ ENABLED_AFALG=no ]
  2486. )
  2487. if test "$ENABLED_AFALG" = "yes"
  2488. then
  2489. if test "$ENABLED_AESCCM" = "yes"
  2490. then
  2491. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  2492. fi
  2493. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG"
  2494. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_HASH"
  2495. fi
  2496. if test "$ENABLED_AFALG" = "xilinx"
  2497. then
  2498. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX -DWOLFSSL_AFALG_XILINX_AES"
  2499. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_SHA3 -DWOLFSSL_AFALG_XILINX_RSA"
  2500. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA3_224 -DWOLFSSL_NOSHA3_256 -DWOLFSSL_NOSHA3_512"
  2501. ENABLED_AFALG="yes"
  2502. ENABLED_XILINX="yes"
  2503. fi
  2504. if test "$ENABLED_AFALG" = "xilinx-aes"
  2505. then
  2506. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX -DWOLFSSL_AFALG_XILINX_AES"
  2507. ENABLED_AFALG="yes"
  2508. ENABLED_XILINX="yes"
  2509. fi
  2510. if test "$ENABLED_AFALG" = "xilinx-sha3"
  2511. then
  2512. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX"
  2513. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_SHA3"
  2514. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA3_224 -DWOLFSSL_NOSHA3_256 -DWOLFSSL_NOSHA3_512"
  2515. ENABLED_AFALG="yes"
  2516. ENABLED_XILINX="yes"
  2517. fi
  2518. if test "$ENABLED_AFALG" = "xilinx-rsa"
  2519. then
  2520. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX"
  2521. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_RSA"
  2522. ENABLED_AFALG="yes"
  2523. ENABLED_XILINX="yes"
  2524. fi
  2525. # libkcapi
  2526. AC_ARG_ENABLE([kcapi-hash],
  2527. [AS_HELP_STRING([--enable-kcapi-hash],[Enable libkcapi use for hashing (default: disabled)])],
  2528. [ ENABLED_KCAPI_HASH=$enableval ],
  2529. [ ENABLED_KCAPI_HASH=no ]
  2530. )
  2531. AC_ARG_ENABLE([kcapi-hmac],
  2532. [AS_HELP_STRING([--enable-kcapi-hmac],[Enable libkcapi use for HMAC (default: disabled)])],
  2533. [ ENABLED_KCAPI_HMAC=$enableval ],
  2534. [ ENABLED_KCAPI_HMAC=no ]
  2535. )
  2536. AC_ARG_ENABLE([kcapi-aes],
  2537. [AS_HELP_STRING([--enable-kcapi-aes],[Enable libkcapi use for AES (default: disabled)])],
  2538. [ ENABLED_KCAPI_AES=$enableval ],
  2539. [ ENABLED_KCAPI_AES=no ]
  2540. )
  2541. AC_ARG_ENABLE([kcapi-rsa],
  2542. [AS_HELP_STRING([--enable-kcapi-rsa],[Enable libkcapi use for RSA (default: disabled)])],
  2543. [ ENABLED_KCAPI_RSA=$enableval ],
  2544. [ ENABLED_KCAPI_RSA=no ]
  2545. )
  2546. AC_ARG_ENABLE([kcapi-dh],
  2547. [AS_HELP_STRING([--enable-kcapi-dh],[Enable libkcapi use for DH (default: disabled)])],
  2548. [ ENABLED_KCAPI_DH=$enableval ],
  2549. [ ENABLED_KCAPI_DH=no ]
  2550. )
  2551. AC_ARG_ENABLE([kcapi-ecc],
  2552. [AS_HELP_STRING([--enable-kcapi-ecc],[Enable libkcapi use for ECC (default: disabled)])],
  2553. [ ENABLED_KCAPI_ECC=$enableval ],
  2554. [ ENABLED_KCAPI_ECC=no ]
  2555. )
  2556. AC_ARG_ENABLE([kcapi],
  2557. [AS_HELP_STRING([--enable-kcapi],[Enable libkcapi use for crypto (default: disabled)])],
  2558. [ ENABLED_KCAPI=$enableval ],
  2559. [ ENABLED_KCAPI=no ]
  2560. )
  2561. if test "$ENABLED_KCAPI" = "yes"
  2562. then
  2563. AS_IF([test "$enable_kcapi_hash" != "no"], [ENABLED_KCAPI_HASH=yes])
  2564. AS_IF([test "$enable_kcapi_hmac" != "no"], [ENABLED_KCAPI_HMAC=yes])
  2565. AS_IF([test "$enable_kcapi_aes" != "no"], [ENABLED_KCAPI_AES=yes])
  2566. AS_IF([test "$enable_kcapi_rsa" != "no"], [ENABLED_KCAPI_RSA=yes])
  2567. AS_IF([test "$enable_kcapi_dh" != "no"], [ENABLED_KCAPI_DH=yes])
  2568. AS_IF([test "$enable_kcapi_ecc" != "no"], [ENABLED_KCAPI_ECC=yes])
  2569. fi
  2570. if test "$ENABLED_KCAPI_HASH" != "no" ||
  2571. test "$ENABLED_KCAPI_HMAC" != "no" ||
  2572. test "$ENABLED_KCAPI_AES" != "no" ||
  2573. test "$ENABLED_KCAPI_RSA" != "no" ||
  2574. test "$ENABLED_KCAPI_DH" != "no" ||
  2575. test "$ENABLED_KCAPI_ECC" != "no"
  2576. then
  2577. LIBS="$LIBS -lkcapi"
  2578. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI"
  2579. fi
  2580. if test "$ENABLED_KCAPI_HASH" = "yes"
  2581. then
  2582. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_HASH -DWOLFSSL_KCAPI_HASH_KEEP"
  2583. # Linux Kernel doesn't support truncated SHA512 algorithms
  2584. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  2585. fi
  2586. if test "$ENABLED_KCAPI_HMAC" = "yes"
  2587. then
  2588. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_HMAC"
  2589. fi
  2590. if test "$ENABLED_KCAPI_AES" = "yes"
  2591. then
  2592. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_AES"
  2593. HAVE_AESGCM_PORT=yes
  2594. if test "$ENABLED_AESCCM" = "yes"
  2595. then
  2596. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  2597. fi
  2598. if test "$ENABLED_AESGCM_STREAM" = "yes"
  2599. then
  2600. AC_MSG_ERROR([--enable-aesgcm-stream is incompatible with --enable-kcapi.])
  2601. fi
  2602. fi
  2603. if test "$ENABLED_KCAPI_RSA" = "yes"
  2604. then
  2605. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_RSA"
  2606. fi
  2607. if test "$ENABLED_KCAPI_DH" = "yes"
  2608. then
  2609. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_DH -DWOLFSSL_DH_EXTRA"
  2610. fi
  2611. if test "$ENABLED_KCAPI_ECC" = "yes"
  2612. then
  2613. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_ECC"
  2614. fi
  2615. # Support for Linux dev/crypto calls
  2616. AC_ARG_ENABLE([devcrypto],
  2617. [AS_HELP_STRING([--enable-devcrypto],[Enable Linux dev crypto calls: all | aes (all aes support) | hash (all hash algos) | cbc (aes-cbc only) (default: disabled)])],
  2618. [ ENABLED_DEVCRYPTO=$enableval ],
  2619. [ ENABLED_DEVCRYPTO=no ]
  2620. )
  2621. if test "$ENABLED_DEVCRYPTO" = "yes" || test "$ENABLED_DEVCRYPTO" = "all"
  2622. then
  2623. #enable all devcrypto supported algorithms
  2624. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2625. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  2626. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_AES"
  2627. if test "$ENABLED_AESCCM" = "yes"
  2628. then
  2629. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  2630. fi
  2631. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH"
  2632. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_HASH_RAW"
  2633. ENABLED_DEVCRYPTO=yes
  2634. fi
  2635. if test "$ENABLED_DEVCRYPTO" = "aes"
  2636. then
  2637. #enable only AES-CBC algorithm support
  2638. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2639. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_AES"
  2640. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  2641. if test "$ENABLED_AESCCM" = "yes"
  2642. then
  2643. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  2644. fi
  2645. ENABLED_DEVCRYPTO=yes
  2646. fi
  2647. if test "$ENABLED_DEVCRYPTO" = "cbc"
  2648. then
  2649. #enable only AES-CBC algorithm support
  2650. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2651. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  2652. ENABLED_DEVCRYPTO=yes
  2653. fi
  2654. if test "$ENABLED_DEVCRYPTO" = "hash"
  2655. then
  2656. #enable only hash algorithm support
  2657. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2658. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH"
  2659. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_HASH_RAW"
  2660. ENABLED_DEVCRYPTO=yes
  2661. fi
  2662. if test "$ENABLED_DEVCRYPTO" = "hmac"
  2663. then
  2664. #enable only hmac algorithm support
  2665. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2666. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HMAC"
  2667. ENABLED_DEVCRYPTO=yes
  2668. fi
  2669. if test "$ENABLED_DEVCRYPTO" = "rsa"
  2670. then
  2671. #enable only rsa algorithm support
  2672. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2673. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_RSA"
  2674. ENABLED_DEVCRYPTO=yes
  2675. fi
  2676. if test "$ENABLED_DEVCRYPTO" = "seco"
  2677. then
  2678. #enable support of devcrypto for algos not supported with seco
  2679. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  2680. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HMAC"
  2681. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_RSA"
  2682. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CURVE25519"
  2683. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_ECDSA"
  2684. ENABLED_DEVCRYPTO=yes
  2685. fi
  2686. # Camellia
  2687. AC_ARG_ENABLE([camellia],
  2688. [AS_HELP_STRING([--enable-camellia],[Enable wolfSSL Camellia support (default: disabled)])],
  2689. [ ENABLED_CAMELLIA=$enableval ],
  2690. [ ENABLED_CAMELLIA=no ]
  2691. )
  2692. if test "$ENABLED_CAMELLIA" = "yes"
  2693. then
  2694. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAMELLIA"
  2695. fi
  2696. # MD2
  2697. AC_ARG_ENABLE([md2],
  2698. [AS_HELP_STRING([--enable-md2],[Enable wolfSSL MD2 support (default: disabled)])],
  2699. [ ENABLED_MD2=$enableval ],
  2700. [ ENABLED_MD2=no ]
  2701. )
  2702. if test "$ENABLED_BUMP" = "yes"
  2703. then
  2704. ENABLED_MD2="yes"
  2705. fi
  2706. if test "$ENABLED_MD2" = "yes"
  2707. then
  2708. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MD2"
  2709. fi
  2710. # NULL CIPHER
  2711. AC_ARG_ENABLE([nullcipher],
  2712. [AS_HELP_STRING([--enable-nullcipher],[Enable wolfSSL NULL cipher support (default: disabled)])],
  2713. [ ENABLED_NULL_CIPHER=$enableval ],
  2714. [ ENABLED_NULL_CIPHER=no ]
  2715. )
  2716. if test "$ENABLED_OPENSSH" = "yes"
  2717. then
  2718. ENABLED_NULL_CIPHER="yes"
  2719. fi
  2720. if test "$ENABLED_NULL_CIPHER" = "yes"
  2721. then
  2722. AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  2723. fi
  2724. # RIPEMD
  2725. AC_ARG_ENABLE([ripemd],
  2726. [AS_HELP_STRING([--enable-ripemd],[Enable wolfSSL RIPEMD-160 support (default: disabled)])],
  2727. [ ENABLED_RIPEMD=$enableval ],
  2728. [ ENABLED_RIPEMD=no ]
  2729. )
  2730. if test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno"
  2731. then
  2732. ENABLED_RIPEMD="yes"
  2733. fi
  2734. if test "$ENABLED_RIPEMD" = "yes"
  2735. then
  2736. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RIPEMD"
  2737. fi
  2738. # BLAKE2
  2739. AC_ARG_ENABLE([blake2],
  2740. [AS_HELP_STRING([--enable-blake2],[Enable wolfSSL BLAKE2b support (default: disabled)])],
  2741. [ ENABLED_BLAKE2=$enableval ],
  2742. [ ENABLED_BLAKE2=no ]
  2743. )
  2744. if test "$ENABLED_BLAKE2" = "yes"
  2745. then
  2746. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2 -DHAVE_BLAKE2B"
  2747. fi
  2748. AC_ARG_ENABLE([blake2s],
  2749. [AS_HELP_STRING([--enable-blake2s],[Enable wolfSSL BLAKE2s support (default: disabled)])],
  2750. [ ENABLED_BLAKE2S=$enableval ],
  2751. [ ENABLED_BLAKE2S=no ]
  2752. )
  2753. if test "$ENABLED_BLAKE2S" = "yes"
  2754. then
  2755. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2S"
  2756. ENABLED_BLAKE2="yes"
  2757. fi
  2758. # set sha224 default
  2759. SHA224_DEFAULT=no
  2760. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"
  2761. then
  2762. if test "x$ENABLED_AFALG" = "xno" && test "x$ENABLED_DEVCRYPTO" = "xno" &&
  2763. ( test "x$ENABLED_FIPS" = "xno" ||
  2764. ( test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" != 1 ) )
  2765. then
  2766. SHA224_DEFAULT=yes
  2767. fi
  2768. fi
  2769. # SHA224
  2770. AC_ARG_ENABLE([sha224],
  2771. [AS_HELP_STRING([--enable-sha224],[Enable wolfSSL SHA-224 support (default: enabled on x86_64/amd64/aarch64)])],
  2772. [ ENABLED_SHA224=$enableval ],
  2773. [ ENABLED_SHA224=$SHA224_DEFAULT ]
  2774. )
  2775. if test "$ENABLED_SHA224" = "yes"
  2776. then
  2777. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"
  2778. fi
  2779. # set sha3 default
  2780. SHA3_DEFAULT=no
  2781. if (test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64") && test "$ENABLED_32BIT" = "no"
  2782. then
  2783. if test "x$ENABLED_FIPS" = "xno" || test "$HAVE_FIPS_VERSION" -ge 2
  2784. then
  2785. SHA3_DEFAULT=yes
  2786. fi
  2787. fi
  2788. # SHA3
  2789. AC_ARG_ENABLE([sha3],
  2790. [AS_HELP_STRING([--enable-sha3],[Enable wolfSSL SHA-3 support (default: enabled on x86_64/amd64/aarch64)])],
  2791. [ ENABLED_SHA3=$enableval ],
  2792. [ ENABLED_SHA3=$SHA3_DEFAULT ]
  2793. )
  2794. if test "$ENABLED_SHA3" = "small"
  2795. then
  2796. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3_SMALL"
  2797. fi
  2798. # SHAKE128
  2799. AC_ARG_ENABLE([shake128],
  2800. [AS_HELP_STRING([--enable-shake128],[Enable wolfSSL SHAKE128 support (default: disabled)])],
  2801. [ ENABLED_SHAKE128=$enableval ],
  2802. [ ENABLED_SHAKE128=no ]
  2803. )
  2804. # SHAKE256
  2805. AC_ARG_ENABLE([shake256],
  2806. [AS_HELP_STRING([--enable-shake256],[Enable wolfSSL SHAKE256 support (default: disabled)])],
  2807. [ ENABLED_SHAKE256=$enableval ],
  2808. [ ENABLED_SHAKE256=no ]
  2809. )
  2810. # SHA512
  2811. AC_ARG_ENABLE([sha512],
  2812. [AS_HELP_STRING([--enable-sha512],[Enable wolfSSL SHA-512 support (default: enabled)])],
  2813. [ ENABLED_SHA512=$enableval ],
  2814. [ ENABLED_SHA512=yes ]
  2815. )
  2816. # options that don't require sha512
  2817. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" || test "$ENABLED_32BIT" = "yes" || test "$ENABLED_16BIT" = "yes"
  2818. then
  2819. ENABLED_SHA512="no"
  2820. fi
  2821. # options that require sha512
  2822. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes"
  2823. then
  2824. ENABLED_SHA512="yes"
  2825. ENABLED_SHA384="yes"
  2826. fi
  2827. if test "$ENABLED_SHA512" = "yes"
  2828. then
  2829. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512"
  2830. fi
  2831. # SHA384
  2832. AC_ARG_ENABLE([sha384],
  2833. [AS_HELP_STRING([--enable-sha384],[Enable wolfSSL SHA-384 support (default: enabled)])],
  2834. [ ENABLED_SHA384=$enableval ],
  2835. [ ENABLED_SHA384=yes ]
  2836. )
  2837. # options that don't require sha384
  2838. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" || test "$ENABLED_32BIT" = "yes" || test "$ENABLED_16BIT" = "yes"
  2839. then
  2840. ENABLED_SHA384="no"
  2841. fi
  2842. # options that require sha384
  2843. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes"
  2844. then
  2845. ENABLED_SHA384="yes"
  2846. fi
  2847. if test "$ENABLED_SHA384" = "yes"
  2848. then
  2849. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA384"
  2850. fi
  2851. # SM3
  2852. AC_ARG_ENABLE([sm3],
  2853. [AS_HELP_STRING([--enable-sm3],[Enable wolfSSL SM3 support (default: disabled)])],
  2854. [ ENABLED_SM3=$enableval ],
  2855. [ ENABLED_SM3=no ]
  2856. )
  2857. if test "$ENABLED_SM3" = "small"
  2858. then
  2859. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM3_SMALL"
  2860. fi
  2861. if test "$ENABLED_SM3" != "no"
  2862. then
  2863. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM3"
  2864. fi
  2865. # SESSION CERTS
  2866. AC_ARG_ENABLE([sessioncerts],
  2867. [AS_HELP_STRING([--enable-sessioncerts],[Enable session cert storing (default: disabled)])],
  2868. [ ENABLED_SESSIONCERTS=$enableval ],
  2869. [ ENABLED_SESSIONCERTS=no ]
  2870. )
  2871. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_OPENVPN" = "xyes" || \
  2872. test "x$ENABLED_LIGHTY" = "xyes" || test "x$ENABLED_NETSNMP" = "xyes" || \
  2873. test "x$ENABLED_STRONGSWAN" = "xyes" || test "x$ENABLED_HITCH" = "xyes"
  2874. then
  2875. ENABLED_SESSIONCERTS=yes
  2876. fi
  2877. if test "$ENABLED_TLS13" = "yes" && test "$ENABLED_PSK" = "yes"
  2878. then
  2879. ENABLED_SESSIONCERTS=yes
  2880. fi
  2881. if test "$ENABLED_SESSIONCERTS" = "yes"
  2882. then
  2883. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  2884. fi
  2885. # KEY GENERATION
  2886. AC_ARG_ENABLE([keygen],
  2887. [AS_HELP_STRING([--enable-keygen],[Enable key generation (default: disabled)])],
  2888. [ ENABLED_KEYGEN=$enableval ],
  2889. [ ENABLED_KEYGEN=no ]
  2890. )
  2891. if test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || \
  2892. test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_OPENRESTY" = "yes" || \
  2893. test "$ENABLED_NGINX" = "yes" || test "$ENABLED_WOLFENGINE" = "yes" || \
  2894. test "$ENABLED_STRONGSWAN" = "yes" || test "$ENABLED_SE050" = "yes"
  2895. then
  2896. ENABLED_KEYGEN=yes
  2897. fi
  2898. # CERT GENERATION
  2899. AC_ARG_ENABLE([certgen],
  2900. [AS_HELP_STRING([--enable-certgen],[Enable cert generation (default: disabled)])],
  2901. [ ENABLED_CERTGEN=$enableval ],
  2902. [ ENABLED_CERTGEN=no ]
  2903. )
  2904. if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_OPENSSH" = "yes" || \
  2905. test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || \
  2906. test "$ENABLED_CHRONY" = "yes" || test "$ENABLED_STRONGSWAN" = "yes" || \
  2907. test "$ENABLED_OPENLDAP" = "yes" || test "$ENABLED_HITCH" = "yes"
  2908. then
  2909. ENABLED_CERTGEN=yes
  2910. fi
  2911. # CERT REQUEST GENERATION
  2912. AC_ARG_ENABLE([certreq],
  2913. [AS_HELP_STRING([--enable-certreq],[Enable cert request generation (default: disabled)])],
  2914. [ ENABLED_CERTREQ=$enableval ],
  2915. [ ENABLED_CERTREQ=no ]
  2916. )
  2917. if test "$ENABLED_WPAS_DPP" = "yes"
  2918. then
  2919. ENABLED_CERTREQ="yes"
  2920. fi
  2921. # CERT REQUEST EXTENSION
  2922. AC_ARG_ENABLE([certext],
  2923. [AS_HELP_STRING([--enable-certext],[Enable cert request extensions (default: disabled)])],
  2924. [ ENABLED_CERTEXT=$enableval ],
  2925. [ ENABLED_CERTEXT=no ]
  2926. )
  2927. if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_STRONGSWAN" = "yes"
  2928. then
  2929. ENABLED_CERTEXT=yes
  2930. fi
  2931. # DECODED CERT CACHE
  2932. AC_ARG_ENABLE([certgencache],
  2933. [AS_HELP_STRING([--enable-certgencache],[Enable decoded cert caching (default: disabled)])],
  2934. [ ENABLED_certgencache=$enableval ],
  2935. [ ENABLED_certgencache=no ]
  2936. )
  2937. if test "$ENABLED_certgencache" = "yes"
  2938. then
  2939. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN_CACHE"
  2940. fi
  2941. # SEP
  2942. AC_ARG_ENABLE([sep],
  2943. [AS_HELP_STRING([--enable-sep],[Enable sep extensions (default: disabled)])],
  2944. [ ENABLED_SEP=$enableval ],
  2945. [ ENABLED_SEP=no ]
  2946. )
  2947. if test "$ENABLED_SEP" = "yes"
  2948. then
  2949. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SEP -DKEEP_PEER_CERT"
  2950. fi
  2951. # HKDF
  2952. AC_ARG_ENABLE([hkdf],
  2953. [AS_HELP_STRING([--enable-hkdf],[Enable HKDF (HMAC-KDF) support (default: disabled)])],
  2954. [ ENABLED_HKDF=$enableval ],
  2955. [ ENABLED_HKDF=no ]
  2956. )
  2957. if test "$ENABLED_TLS13" = "yes"
  2958. then
  2959. ENABLED_HKDF="yes"
  2960. fi
  2961. if test "$ENABLED_HKDF" = "yes"
  2962. then
  2963. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"
  2964. fi
  2965. # HPKE
  2966. AC_ARG_ENABLE([hpke],
  2967. [AS_HELP_STRING([--enable-hpke],[Enable HKPE support (default: disabled)])],
  2968. [ ENABLED_HPKE=$enableval ],
  2969. [ ENABLED_HPKE=no ]
  2970. )
  2971. if test "$ENABLED_HPKE" = "yes"
  2972. then
  2973. AM_CFLAGS="$AM_CFLAGS -DHAVE_HPKE"
  2974. test "$enable_hkdf" = "" && enable_hkdf=yes
  2975. fi
  2976. # X9.63 KDF
  2977. AC_ARG_ENABLE([x963kdf],
  2978. [AS_HELP_STRING([--enable-x963kdf],[Enable X9.63 KDF support (default: disabled)])],
  2979. [ ENABLED_X963KDF=$enableval ],
  2980. [ ENABLED_X963KDF=no ]
  2981. )
  2982. if test "$ENABLED_X963KDF" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  2983. then
  2984. AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF"
  2985. fi
  2986. # DSA
  2987. AC_ARG_ENABLE([dsa],
  2988. [AS_HELP_STRING([--enable-dsa],[Enable DSA (default: disabled)])],
  2989. [ ENABLED_DSA=$enableval ],
  2990. [ ENABLED_DSA=no ]
  2991. )
  2992. if test "$enable_dsa" = ""
  2993. then
  2994. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_QT" = "yes" || test "$ENABLED_BIND" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_NTP" = "yes"
  2995. then
  2996. ENABLED_DSA="yes"
  2997. fi
  2998. fi
  2999. if test "$ENABLED_DSA" = "no"
  3000. then
  3001. AM_CFLAGS="$AM_CFLAGS -DNO_DSA"
  3002. else
  3003. ENABLED_CERTS=yes
  3004. fi
  3005. # ECC Shamir
  3006. AC_ARG_ENABLE([eccshamir],
  3007. [AS_HELP_STRING([--enable-eccshamir],[Enable ECC Shamir (default: enabled)])],
  3008. [ ENABLED_ECC_SHAMIR=$enableval ],
  3009. [ ENABLED_ECC_SHAMIR=yes ]
  3010. )
  3011. # ECC
  3012. AC_ARG_ENABLE([ecc],
  3013. [AS_HELP_STRING([--enable-ecc],[Enable ECC (default: enabled)])],
  3014. [ ENABLED_ECC=$enableval ],
  3015. [ ENABLED_ECC=yes ]
  3016. )
  3017. # lean psk doesn't need ecc
  3018. if test "$ENABLED_LEANPSK" = "yes"
  3019. then
  3020. ENABLED_ECC=no
  3021. fi
  3022. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_SIGNAL" = "yes"
  3023. then
  3024. ENABLED_ECC="yes"
  3025. fi
  3026. if test "$ENABLED_ECC" != "no"
  3027. then
  3028. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  3029. if test "$ENABLED_ECC_SHAMIR" = "yes" && test "$ENABLED_LOWRESOURCE" = "no"
  3030. then
  3031. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  3032. fi
  3033. if test "$ENABLED_ECC" = "nonblock"
  3034. then
  3035. AM_CFLAGS="$AM_CFLAGS -DWC_ECC_NONBLOCK"
  3036. fi
  3037. if test "$ENABLED_LOWRESOURCE" = "yes" && test "$ENABLED_FASTMATH" = "yes"
  3038. then
  3039. AM_CFLAGS="$AM_CFLAGS -DALT_ECC_SIZE"
  3040. fi
  3041. ENABLED_CERTS=yes
  3042. fi
  3043. # SM2
  3044. AC_ARG_ENABLE([sm2],
  3045. [AS_HELP_STRING([--enable-sm2],[Enable wolfSSL SM2 support (default: disabled)])],
  3046. [ ENABLED_SM2=$enableval ],
  3047. [ ENABLED_SM2=no ]
  3048. )
  3049. if test "$ENABLED_SP_MATH" = "yes"
  3050. then
  3051. ENABLED_SM2="no"
  3052. fi
  3053. if test "$ENABLED_SM2" = "yes"
  3054. then
  3055. if test "$ENABLED_ECC" = "no"
  3056. then
  3057. AC_MSG_ERROR([Cannot enable SM2 without enabling ecc.])
  3058. fi
  3059. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SM2 -DWOLFSSL_BASE16"
  3060. fi
  3061. # ECC Custom Curves
  3062. AC_ARG_ENABLE([ecccustcurves],
  3063. [AS_HELP_STRING([--enable-ecccustcurves],[Enable ECC custom curves (default: disabled)])],
  3064. [ ENABLED_ECCCUSTCURVES=$enableval ],
  3065. [ ENABLED_ECCCUSTCURVES=no ]
  3066. )
  3067. if test "$ENABLED_WPAS_DPP" = "yes"
  3068. then
  3069. ENABLED_ECCCUSTCURVES="all"
  3070. fi
  3071. if test "$ENABLED_ECCCUSTCURVES" != "no"
  3072. then
  3073. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CUSTOM_CURVES"
  3074. # For distro, all or ecccustcurves=all builds, enable all curve types
  3075. if test "$ENABLED_DISTRO" = "yes" || test "$ENABLED_ALL" = "yes" || test "$ENABLED_ECCCUSTCURVES" = "all"
  3076. then
  3077. # Enable ECC SECPR2, SECPR3, BRAINPOOL and KOBLITZ curves
  3078. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ"
  3079. # Enable ECC Cofactor support
  3080. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_CDH"
  3081. # If fastmath enabled and on x86 use speedups
  3082. if test "x$ENABLED_FASTMATH" = "xyes" && test "$host_cpu" = "x86_64" -o "$host_cpu" = "amd64"
  3083. then
  3084. AM_CFLAGS="$AM_CFLAGS -DTFM_ECC192 -DTFM_ECC224 -DTFM_ECC256 -DTFM_ECC384 -DTFM_ECC521"
  3085. fi
  3086. fi
  3087. fi
  3088. # ECC Minimum Key Size
  3089. ENABLED_ECCMINSZ=224
  3090. AC_ARG_WITH([eccminsz],
  3091. [AS_HELP_STRING([--with-eccminsz=BITS],[Sets the ECC minimum key size (default: 224 bits)])],
  3092. [
  3093. ENABLED_ECCMINSZ=$withval
  3094. AM_CFLAGS="$AM_CFLAGS -DECC_MIN_KEY_SZ=$withval"
  3095. ]
  3096. )
  3097. # Compressed Key
  3098. AC_ARG_ENABLE([compkey],
  3099. [AS_HELP_STRING([--enable-compkey],[Enable compressed keys support (default: disabled)])],
  3100. [ ENABLED_COMPKEY=$enableval ],
  3101. [ ENABLED_COMPKEY=no ]
  3102. )
  3103. if test "$ENABLED_WPAS" = "yes" || test "$ENABLED_OPENSSLALL" = "yes"
  3104. then
  3105. ENABLED_COMPKEY=yes
  3106. fi
  3107. # Brainpool (depends on _ECCCUSTCURVES)
  3108. if test "$ENABLED_ECCCUSTCURVES" != "no"
  3109. then
  3110. BRAINPOOL_DEFAULT=yes
  3111. else
  3112. BRAINPOOL_DEFAULT=no
  3113. fi
  3114. AC_ARG_ENABLE([brainpool],
  3115. [AS_HELP_STRING([--enable-brainpool],[Enable Brainpool ECC curves (default: enabled with ECC custom curves)])],
  3116. [ ENABLED_BRAINPOOL=$enableval ],
  3117. [ ENABLED_BRAINPOOL="$BRAINPOOL_DEFAULT" ]
  3118. )
  3119. if test "$ENABLED_BRAINPOOL" != "no"
  3120. then
  3121. if test "$ENABLED_ECCCUSTCURVES" = "no"
  3122. then
  3123. AC_MSG_ERROR([cannot enable Brainpool without enabling ecccustcurves.])
  3124. fi
  3125. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_BRAINPOOL"
  3126. fi
  3127. # for using memory optimization setting on both curve25519 and ed25519
  3128. ENABLED_CURVE25519_SMALL=no
  3129. ENABLED_ED25519_SMALL=no
  3130. # CURVE25519
  3131. AC_ARG_ENABLE([curve25519],
  3132. [AS_HELP_STRING([--enable-curve25519],[Enable Curve25519 (default: disabled)])],
  3133. [ ENABLED_CURVE25519=$enableval ],
  3134. [ ENABLED_CURVE25519=no ]
  3135. )
  3136. if test "$ENABLED_QUIC" = "yes" && test "$ENABLED_CURVE25519" = "no"
  3137. then
  3138. ENABLED_CURVE25519=yes
  3139. fi
  3140. if test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno"
  3141. then
  3142. ENABLED_CURVE25519="yes"
  3143. fi
  3144. if test "$ENABLED_CURVE25519" != "no"
  3145. then
  3146. if test "$ENABLED_CURVE25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  3147. then
  3148. AM_CFLAGS="$AM_CFLAGS -DCURVE25519_SMALL"
  3149. ENABLED_CURVE25519_SMALL=yes
  3150. ENABLED_CURVE25519=yes
  3151. fi
  3152. if test "$ENABLED_CURVE25519" = "no128bit" || test "$ENABLED_32BIT" = "yes"
  3153. then
  3154. AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_128BIT"
  3155. ENABLED_CURVE25519=yes
  3156. fi
  3157. AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519"
  3158. AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_CURVE25519"
  3159. ENABLED_FEMATH=yes
  3160. fi
  3161. # ED25519
  3162. AC_ARG_ENABLE([ed25519],
  3163. [AS_HELP_STRING([--enable-ed25519],[Enable ED25519 (default: disabled)])],
  3164. [ ENABLED_ED25519=$enableval ],
  3165. [ ENABLED_ED25519=no ]
  3166. )
  3167. AC_ARG_ENABLE([ed25519-stream],
  3168. [AS_HELP_STRING([--enable-ed25519-stream],[Enable wolfSSL ED25519 support with streaming verify APIs (default: disabled)])],
  3169. [ ENABLED_ED25519_STREAM=$enableval ],
  3170. [ ENABLED_ED25519_STREAM=no ]
  3171. )
  3172. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  3173. test "$ENABLED_CHRONY" = "yes"
  3174. then
  3175. ENABLED_ED25519="yes"
  3176. fi
  3177. # for using memory optimization setting on both curve448 and ed448
  3178. ENABLED_CURVE448_SMALL=no
  3179. ENABLED_ED448_SMALL=no
  3180. # CURVE448
  3181. AC_ARG_ENABLE([curve448],
  3182. [AS_HELP_STRING([--enable-curve448],[Enable Curve448 (default: disabled)])],
  3183. [ ENABLED_CURVE448=$enableval ],
  3184. [ ENABLED_CURVE448=no ]
  3185. )
  3186. if test "$ENABLED_CURVE448" != "no"
  3187. then
  3188. if test "$ENABLED_CURVE448" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  3189. then
  3190. AM_CFLAGS="$AM_CFLAGS -DCURVE448_SMALL"
  3191. ENABLED_CURVE448_SMALL=yes
  3192. ENABLED_CURVE448=yes
  3193. fi
  3194. if test "$ENABLED_CURVE448" = "no128bit" || test "$ENABLED_32BIT" = "yes"
  3195. then
  3196. AM_CFLAGS="$AM_CFLAGS -DNO_CURVED448_128BIT"
  3197. ENABLED_CURVE448=yes
  3198. fi
  3199. AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE448"
  3200. ENABLED_FE448=yes
  3201. fi
  3202. # ED448
  3203. AC_ARG_ENABLE([ed448],
  3204. [AS_HELP_STRING([--enable-ed448],[Enable ED448 (default: disabled)])],
  3205. [ ENABLED_ED448=$enableval ],
  3206. [ ENABLED_ED448=no ]
  3207. )
  3208. AC_ARG_ENABLE([ed448-stream],
  3209. [AS_HELP_STRING([--enable-ed448-stream],[Enable wolfSSL ED448 support with streaming verify APIs (default: disabled)])],
  3210. [ ENABLED_ED448_STREAM=$enableval ],
  3211. [ ENABLED_ED448_STREAM=no ]
  3212. )
  3213. if test "$ENABLED_ED448" != "no" && test "$ENABLED_32BIT" = "no"
  3214. then
  3215. if test "$ENABLED_ED448" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  3216. then
  3217. AM_CFLAGS="$AM_CFLAGS -DED448_SMALL"
  3218. ENABLED_ED448_SMALL=yes
  3219. ENABLED_CURVE448_SMALL=yes
  3220. ENABLED_ED448=yes
  3221. fi
  3222. if test "$ENABLED_SHA512" = "no"
  3223. then
  3224. AC_MSG_ERROR([cannot enable ed448 without enabling sha512.])
  3225. fi
  3226. if test "$HAVE_FIPS_VERSION" = 2
  3227. then
  3228. AC_MSG_ERROR([cannot enable ed448 w/ dependency shake256 in FIPSv2 mode])
  3229. fi
  3230. ENABLED_FE448=yes
  3231. ENABLED_GE448=yes
  3232. AM_CFLAGS="$AM_CFLAGS -DHAVE_ED448"
  3233. # EdDSA448 requires SHAKE256 which requires SHA-3
  3234. if test "$ENABLED_SHA3" = "no"
  3235. then
  3236. ENABLED_SHA3=yes
  3237. fi
  3238. ENABLED_SHAKE256=yes
  3239. ENABLED_CERTS=yes
  3240. fi
  3241. if test "$ENABLED_ED448_STREAM" != "no"
  3242. then
  3243. if test "$ENABLED_ED448" = "no"
  3244. then
  3245. AC_MSG_ERROR([ED448 verify streaming enabled but ED448 is disabled])
  3246. else
  3247. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
  3248. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
  3249. fi
  3250. fi
  3251. # FP ECC, Fixed Point cache ECC
  3252. AC_ARG_ENABLE([fpecc],
  3253. [AS_HELP_STRING([--enable-fpecc],[Enable Fixed Point cache ECC (default: disabled)])],
  3254. [ ENABLED_FPECC=$enableval ],
  3255. [ ENABLED_FPECC=no ]
  3256. )
  3257. if test "$ENABLED_FPECC" = "yes"
  3258. then
  3259. if test "$ENABLED_ECC" = "no"
  3260. then
  3261. AC_MSG_ERROR([cannot enable fpecc without enabling ecc.])
  3262. fi
  3263. AM_CFLAGS="$AM_CFLAGS -DFP_ECC"
  3264. fi
  3265. # ECC encrypt
  3266. AC_ARG_ENABLE([eccencrypt],
  3267. [AS_HELP_STRING([--enable-eccencrypt],[Enable ECC encrypt (default: disabled). yes = SEC1 standard, geniv = Generate IV, iso18033 = ISO 18033 standard, old = original wolfSSL algorithm])],
  3268. [ ENABLED_ECC_ENCRYPT=$enableval ],
  3269. [ ENABLED_ECC_ENCRYPT=no ]
  3270. )
  3271. if test "$ENABLED_ECC_ENCRYPT" != "no"
  3272. then
  3273. if test "$ENABLED_ECC" = "no"
  3274. then
  3275. AC_MSG_ERROR([cannot enable eccencrypt without enabling ecc.])
  3276. fi
  3277. if test "$ENABLED_HKDF" = "no"
  3278. then
  3279. AC_MSG_ERROR([cannot enable eccencrypt without enabling hkdf.])
  3280. fi
  3281. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_ENCRYPT"
  3282. if test "$ENABLED_ECC_ENCRYPT" = "old"
  3283. then
  3284. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECIES_OLD"
  3285. fi
  3286. if test "$ENABLED_ECC_ENCRYPT" = "iso18033"
  3287. then
  3288. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECIES_ISO18033"
  3289. fi
  3290. if test "$ENABLED_ECC_ENCRYPT" = "geniv"
  3291. then
  3292. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECIES_GEN_IV"
  3293. fi
  3294. fi
  3295. # Elliptic Curve-Based Certificateless Signatures for Identity-Based Encryption (ECCSI)
  3296. AC_ARG_ENABLE([eccsi],
  3297. [AS_HELP_STRING([--enable-eccsi],[Enable ECCSI (default: disabled)])],
  3298. [ ENABLED_ECCSI=$enableval ],
  3299. [ ENABLED_ECCSI=no ]
  3300. )
  3301. if test "x$ENABLED_ECCSI" = "xyes"
  3302. then
  3303. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_ECCSI -DWOLFSSL_PUBLIC_MP"
  3304. fi
  3305. # Sakai-Kasahara Key Encryption (SAKKE) - pairing based crypto
  3306. AC_ARG_ENABLE([sakke],
  3307. [AS_HELP_STRING([--enable-sakke],[Enable SAKKE - paring based crypto (default: disabled)])],
  3308. [ ENABLED_SAKKE=$enableval ],
  3309. [ ENABLED_SAKKE=no ]
  3310. )
  3311. if test "x$ENABLED_SAKKE" = "xsmall"
  3312. then
  3313. ENABLED_SAKKE="yes"
  3314. ENABLED_SAKKE_SMALL="yes"
  3315. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_SAKKE_SMALL"
  3316. fi
  3317. if test "x$ENABLED_SAKKE" = "xyes"
  3318. then
  3319. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SAKKE"
  3320. fi
  3321. # PSK
  3322. AC_ARG_ENABLE([psk],
  3323. [AS_HELP_STRING([--enable-psk],[Enable PSK (default: disabled)])],
  3324. [ ENABLED_PSK=$enableval ],
  3325. [ ENABLED_PSK=no ]
  3326. )
  3327. # Single PSK identity
  3328. AC_ARG_ENABLE([psk-one-id],
  3329. [AS_HELP_STRING([--enable-psk-one-id],[Enable PSK (default: disabled)])],
  3330. [ ENABLED_PSK_ONE_ID=$enableval ],
  3331. [ ENABLED_PSK_ONE_ID=no ]
  3332. )
  3333. if test "$ENABLED_PSK_ONE_ID" = "yes"
  3334. then
  3335. if test "$ENABLED_PSK" = "no"
  3336. then
  3337. ENABLED_PSK="yes"
  3338. fi
  3339. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSK_ONE_ID"
  3340. fi
  3341. # ERROR STRINGS
  3342. AC_ARG_ENABLE([errorstrings],
  3343. [AS_HELP_STRING([--enable-errorstrings],[Enable error strings table (default: enabled)])],
  3344. [ ENABLED_ERROR_STRINGS=$enableval ],
  3345. [ ENABLED_ERROR_STRINGS=yes ]
  3346. )
  3347. if test "$ENABLED_ERROR_STRINGS" = "no"
  3348. then
  3349. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  3350. else
  3351. # turn off error strings if leanpsk or leantls on
  3352. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3353. then
  3354. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  3355. ENABLED_ERROR_STRINGS=no
  3356. fi
  3357. fi
  3358. # ERROR QUEUE
  3359. AC_ARG_ENABLE([errorqueue],
  3360. [AS_HELP_STRING([--enable-errorqueue],[Disables adding nodes to error queue when compiled with OPENSSL_EXTRA (default: enabled)])],
  3361. [ ENABLED_ERROR_QUEUE=$enableval ],
  3362. [ ENABLED_ERROR_QUEUE=yes ]
  3363. )
  3364. # OLD TLS
  3365. AC_ARG_ENABLE([oldtls],
  3366. [AS_HELP_STRING([--enable-oldtls],[Enable old TLS versions < 1.2 (default: enabled)])],
  3367. [ ENABLED_OLD_TLS=$enableval ],
  3368. [ ENABLED_OLD_TLS=yes ]
  3369. )
  3370. if test "$ENABLED_CRYPTONLY" = "yes" || test "x$ENABLED_HARDEN_TLS" != "xno"
  3371. then
  3372. ENABLED_OLD_TLS=no
  3373. fi
  3374. if test "$ENABLED_OLD_TLS" = "no"
  3375. then
  3376. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  3377. else
  3378. # turn off old if leanpsk or leantls on
  3379. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3380. then
  3381. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  3382. ENABLED_OLD_TLS=no
  3383. fi
  3384. fi
  3385. # TLSv1.2
  3386. AC_ARG_ENABLE([tlsv12],
  3387. [AS_HELP_STRING([--enable-tlsv12],[Enable TLS versions 1.2 (default: enabled)])],
  3388. [ ENABLED_TLSV12=$enableval ],
  3389. [ ENABLED_TLSV12=yes ]
  3390. )
  3391. if test "$ENABLED_CRYPTONLY" = "yes"
  3392. then
  3393. ENABLED_TLSV12=no
  3394. fi
  3395. if test "$ENABLED_TLSV12" = "no"
  3396. then
  3397. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_TLS12 -DNO_OLD_TLS"
  3398. fi
  3399. # TLSv1.0
  3400. AC_ARG_ENABLE([tlsv10],
  3401. [AS_HELP_STRING([--enable-tlsv10],[Enable old TLS versions 1.0 (default: disabled)])],
  3402. [ ENABLED_TLSV10=$enableval ],
  3403. [ ENABLED_TLSV10=no ]
  3404. )
  3405. if test "$ENABLED_CRYPTONLY" = "yes"
  3406. then
  3407. ENABLED_TLSV12=no
  3408. fi
  3409. if test "$ENABLED_TLSV10" = "yes"
  3410. then
  3411. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_TLSV10"
  3412. fi
  3413. # SSLv3
  3414. AC_ARG_ENABLE([sslv3],
  3415. [AS_HELP_STRING([--enable-sslv3],[Enable SSL version 3.0 (default: disabled)])],
  3416. [ ENABLED_SSLV3=$enableval ],
  3417. [ ENABLED_SSLV3=no]
  3418. )
  3419. if test "x$ENABLED_HAPROXY" = "xyes" && test "x$ENABLED_ALL" = "xno"
  3420. then
  3421. ENABLED_SSLV3="yes"
  3422. fi
  3423. if test "$ENABLED_CRYPTONLY" = "yes"
  3424. then
  3425. ENABLED_SSLV3=no
  3426. fi
  3427. if test "$ENABLED_SSLV3" = "yes"
  3428. then
  3429. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_SSLV3"
  3430. fi
  3431. # STACK SIZE info for testwolfcrypt and examples
  3432. AC_ARG_ENABLE([stacksize],
  3433. [AS_HELP_STRING([--enable-stacksize],[Enable stack size info on examples (default: disabled)])],
  3434. [ ENABLED_STACKSIZE=$enableval ],
  3435. [ ENABLED_STACKSIZE=no ]
  3436. )
  3437. if test "$ENABLED_STACKSIZE" != "no"
  3438. then
  3439. AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  3440. AC_CHECK_DECL([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  3441. AC_CHECK_FUNC([pthread_attr_setstack], [], AC_CHECK_LIB([pthread],[pthread_attr_setstack]))
  3442. AC_CHECK_DECL([pthread_attr_setstack], [], [AC_MSG_ERROR(stacksize needs pthread_attr_setstack)], [[#include <pthread.h>]])
  3443. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE"
  3444. fi
  3445. if test "$ENABLED_STACKSIZE" = "verbose"
  3446. then
  3447. if test "$thread_ls_on" != "yes"
  3448. then
  3449. AC_MSG_ERROR(stacksize-verbose needs thread-local storage.)
  3450. fi
  3451. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE_VERBOSE"
  3452. fi
  3453. # MEMORY
  3454. AC_ARG_ENABLE([memory],
  3455. [AS_HELP_STRING([--enable-memory],[Enable memory callbacks (default: enabled)])],
  3456. [ ENABLED_MEMORY=$enableval ],
  3457. [ ENABLED_MEMORY=yes ]
  3458. )
  3459. if test "$ENABLED_MEMORY" = "no"
  3460. then
  3461. AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_MEMORY"
  3462. else
  3463. # turn off memory cb if leanpsk or leantls on
  3464. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3465. then
  3466. # but don't turn on NO_WOLFSSL_MEMORY because using own
  3467. ENABLED_MEMORY=no
  3468. fi
  3469. fi
  3470. # MEMORY SIZE info
  3471. AC_ARG_ENABLE([trackmemory],
  3472. [AS_HELP_STRING([--enable-trackmemory],[Enable memory use info on wolfCrypt and wolfSSL cleanup (default: disabled)])],
  3473. [ ENABLED_TRACKMEMORY=$enableval ],
  3474. [ ENABLED_TRACKMEMORY=no ]
  3475. )
  3476. if test "$ENABLED_TRACKMEMORY" != "no"
  3477. then
  3478. if test "$ENABLED_MEMORY" = "yes"
  3479. then
  3480. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY"
  3481. else
  3482. AC_MSG_ERROR([trackmemory requires using wolfSSL memory (--enable-memory).])
  3483. fi
  3484. if test "$ENABLED_TRACKMEMORY" = "verbose"
  3485. then
  3486. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY_VERBOSE"
  3487. fi
  3488. fi
  3489. # MEMORY usage logging
  3490. AC_ARG_ENABLE([memorylog],
  3491. [AS_HELP_STRING([--enable-memorylog],[Enable dynamic memory logging (default: disabled)])],
  3492. [ ENABLED_MEMORYLOG=$enableval ],
  3493. [ ENABLED_MEMORYLOG=no ]
  3494. )
  3495. if test "$ENABLED_MEMORYLOG" = "yes"
  3496. then
  3497. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MEMORY_LOG"
  3498. fi
  3499. # STACK usage logging
  3500. AC_ARG_ENABLE([stacklog],
  3501. [AS_HELP_STRING([--enable-stacklog],[Enable stack logging (default: disabled)])],
  3502. [ ENABLED_STACKLOG=$enableval ],
  3503. [ ENABLED_STACKLOG=no ]
  3504. )
  3505. if test "$ENABLED_STACKLOG" = "yes"
  3506. then
  3507. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STACK_LOG -finstrument-functions"
  3508. fi
  3509. ENABLED_WOLFSENTRY=no
  3510. AC_ARG_WITH([wolfsentry],
  3511. [AS_HELP_STRING([--with-wolfsentry=PATH],[PATH to directory with wolfSentry installation])],
  3512. [WOLFSENTRY_INSTALLDIR=$withval],
  3513. [WOLFSENTRY_INSTALLDIR=""])
  3514. AC_ARG_WITH([wolfsentry-lib],
  3515. [AS_HELP_STRING([--with-wolfsentry-lib=PATH],[PATH to directory with wolfSentry library])],
  3516. [WOLFSENTRY_LIB=$withval],
  3517. [WOLFSENTRY_LIB=""])
  3518. AC_ARG_WITH([wolfsentry-include],
  3519. [AS_HELP_STRING([--with-wolfsentry-include=PATH],[PATH to directory with wolfSentry header files])],
  3520. [WOLFSENTRY_INCLUDE=$withval],
  3521. [WOLFSENTRY_INCLUDE=""])
  3522. if test -n "$WOLFSENTRY_INSTALLDIR" || test -n "$WOLFSENTRY_LIB" || test -n "$WOLFSENTRY_INCLUDE"
  3523. then
  3524. ENABLED_WOLFSENTRY=yes
  3525. fi
  3526. AC_ARG_ENABLE([wolfsentry],
  3527. [AS_HELP_STRING([--enable-wolfsentry],[Enable wolfSentry hooks and plugins (default: disabled)])],
  3528. [ ENABLED_WOLFSENTRY=$enableval ],
  3529. [ ]
  3530. )
  3531. if test "$WOLFSENTRY_LIB" = "" && test -n "$WOLFSENTRY_INSTALLDIR"
  3532. then
  3533. WOLFSENTRY_LIB="${WOLFSENTRY_INSTALLDIR}/lib"
  3534. fi
  3535. if test "$WOLFSENTRY_INCLUDE" = "" && test -n "$WOLFSENTRY_INSTALLDIR"
  3536. then
  3537. WOLFSENTRY_INCLUDE="${WOLFSENTRY_INSTALLDIR}/include"
  3538. fi
  3539. if test -n "$WOLFSENTRY_LIB"
  3540. then
  3541. AC_MSG_CHECKING([for $WOLFSENTRY_LIB])
  3542. if ! test -d "$WOLFSENTRY_LIB"
  3543. then
  3544. AC_MSG_ERROR([wolfSentry lib dir $WOLFSENTRY_LIB not found.])
  3545. fi
  3546. AC_MSG_RESULT([yes])
  3547. WOLFSENTRY_LIB="-L$WOLFSENTRY_LIB"
  3548. fi
  3549. if test -n "$WOLFSENTRY_INCLUDE"
  3550. then
  3551. AC_MSG_CHECKING([for $WOLFSENTRY_INCLUDE])
  3552. if ! test -d "$WOLFSENTRY_INCLUDE"
  3553. then
  3554. AC_MSG_ERROR([wolfSentry include dir $WOLFSENTRY_INCLUDE not found.])
  3555. fi
  3556. AC_MSG_RESULT([yes])
  3557. WOLFSENTRY_INCLUDE="-I$WOLFSENTRY_INCLUDE"
  3558. fi
  3559. if test "$ENABLED_WOLFSENTRY" = "yes"
  3560. then
  3561. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WOLFSENTRY_HOOKS -DHAVE_EX_DATA -DHAVE_EX_DATA_CLEANUP_HOOKS"
  3562. WOLFSENTRY_LIB="$WOLFSENTRY_LIB -lwolfsentry"
  3563. fi
  3564. AC_SUBST([WOLFSENTRY_LIB])
  3565. AC_SUBST([WOLFSENTRY_INCLUDE])
  3566. if test "$ENABLED_QT" = "yes"
  3567. then
  3568. # Requires opensslextra and opensslall
  3569. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  3570. then
  3571. ENABLED_OPENSSLALL="yes"
  3572. ENABLED_OPENSSLEXTRA="yes"
  3573. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL -DHAVE_EX_DATA"
  3574. fi
  3575. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_QT -DSESSION_CERTS -DOPENSSL_NO_SSL2"
  3576. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN -DHAVE_EX_DATA"
  3577. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CUSTOM_CURVES -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ"
  3578. if test "x$ENABLED_ALL" = "xno"; then
  3579. # Don't enable old SSL/TLS for --enable-all, which is used by distro
  3580. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_SSLV3 -DWOLFSSL_ALLOW_TLSV10"
  3581. fi
  3582. # Requires OCSP make sure on
  3583. if test "x$ENABLED_OCSP" = "xno"
  3584. then
  3585. ENABLED_OCSP="yes"
  3586. fi
  3587. # Requires PSK make sure on
  3588. if test "x$ENABLED_PSK" = "xno"
  3589. then
  3590. ENABLED_PSK="yes"
  3591. fi
  3592. # Requires RC4 make sure on (if not forcefully disabled with --disable-arc4)
  3593. test "$enable_arc4" = "" && enable_arc4=yes
  3594. if test "x$ENABLED_CERTEXT" = "xno"
  3595. then
  3596. ENABLED_CERTEXT="yes"
  3597. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  3598. fi
  3599. if test "x$ENABLED_CERTGEN" = "xno"
  3600. then
  3601. ENABLED_CERTGEN="yes"
  3602. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  3603. fi
  3604. # requires oldnames disabled
  3605. enable_oldnames=no
  3606. fi
  3607. AC_ARG_ENABLE([qt-test],
  3608. [AS_HELP_STRING([--enable-qt-test],[Enable qt tests (default: disabled)])],
  3609. [ ENABLED_QT_TEST=$enableval ],
  3610. [ ENABLED_QT_TEST=no ]
  3611. )
  3612. if test "$ENABLED_QT_TEST" = "yes"
  3613. then
  3614. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL3 -DWOLFSSL_STATIC_RSA"
  3615. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_PSK"
  3616. fi
  3617. # RSA
  3618. AC_ARG_ENABLE([rsa],
  3619. [AS_HELP_STRING([--enable-rsa],[Enable RSA (default: enabled)])],
  3620. [ ENABLED_RSA=$enableval ],
  3621. [ ENABLED_RSA=yes ]
  3622. )
  3623. if test "$ENABLED_RSA" = "no"
  3624. then
  3625. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  3626. else
  3627. # turn off RSA if leanpsk or leantls on
  3628. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3629. then
  3630. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  3631. ENABLED_RSA=no
  3632. else
  3633. ENABLED_CERTS=yes
  3634. fi
  3635. fi
  3636. AC_ARG_ENABLE([oaep],
  3637. [AS_HELP_STRING([--enable-oaep],[Enable RSA OAEP (default: enabled)])],
  3638. [ ENABLED_OAEP=$enableval ],
  3639. [ ENABLED_OAEP=yes ]
  3640. )
  3641. if test "$ENABLED_OAEP" = "no"
  3642. then
  3643. AM_CFLAGS="$AM_CFLAGS -DWC_NO_RSA_OAEP"
  3644. fi
  3645. AC_ARG_ENABLE([rsapub],
  3646. [AS_HELP_STRING([--enable-rsapub],[Enable RSA Public Only (default: disabled)])],
  3647. [ ENABLED_RSAPUB=$enableval ],
  3648. [ ENABLED_RSAPUB=no ]
  3649. )
  3650. if test "$ENABLED_RSAPUB" = "yes"
  3651. then
  3652. if test "$ENABLED_RSA" = "no"
  3653. then
  3654. ENABLED_RSA="yes"
  3655. fi
  3656. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_PUBLIC_ONLY"
  3657. fi
  3658. AC_ARG_ENABLE([rsavfy],
  3659. [AS_HELP_STRING([--enable-rsavfy],[Enable RSA Verify Inline Only (default: disabled)])],
  3660. [ ENABLED_RSAVFY=$enableval ],
  3661. [ ENABLED_RSAVFY=no ]
  3662. )
  3663. if test "$ENABLED_RSAVFY" = "yes"
  3664. then
  3665. if test "$ENABLED_RSA" = "no"
  3666. then
  3667. ENABLED_RSA="yes"
  3668. fi
  3669. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_PUBLIC_ONLY -DWOLFSSL_RSA_VERIFY_ONLY"
  3670. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_VERIFY_INLINE -DNO_SIG_WRAPPER"
  3671. AM_CFLAGS="$AM_CFLAGS -DNO_CHECK_PRIVATE_KEY"
  3672. fi
  3673. # RSA-PSS
  3674. AC_ARG_ENABLE([rsapss],
  3675. [ --enable-rsapss Enable RSA-PSS (default: disabled)],
  3676. [ ENABLED_RSAPSS=$enableval ],
  3677. [ ENABLED_RSAPSS=no ]
  3678. )
  3679. if test "$ENABLED_RSA" = "no"
  3680. then
  3681. ENABLED_RSAPSS="no"
  3682. else
  3683. if test "$ENABLED_TLS13" = "yes"
  3684. then
  3685. ENABLED_RSAPSS="yes"
  3686. fi
  3687. fi
  3688. if test "$ENABLED_RSAPSS" = "yes"
  3689. then
  3690. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS -DWOLFSSL_PSS_LONG_SALT"
  3691. fi
  3692. # DH
  3693. AC_ARG_ENABLE([dh],
  3694. [AS_HELP_STRING([--enable-dh],[Enable DH (default: enabled)])],
  3695. [ ENABLED_DH=$enableval ],
  3696. [ ENABLED_DH=yes ]
  3697. )
  3698. if test "$ENABLED_OPENSSH" = "yes" && test "$ENABLED_DH" = "no"
  3699. then
  3700. ENABLED_DH="yes"
  3701. fi
  3702. if test "$ENABLED_DH" = "no"
  3703. then
  3704. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  3705. else
  3706. # turn off DH if leanpsk or leantls on
  3707. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3708. then
  3709. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  3710. ENABLED_DH=no
  3711. fi
  3712. fi
  3713. if test "$ENABLED_DH" = "const"
  3714. then
  3715. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_CONST"
  3716. fi
  3717. if test "$ENABLED_SNIFFER" = "yes" && test "$ENABLED_DH" != "no"
  3718. then
  3719. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA"
  3720. fi
  3721. # Anonymous
  3722. AC_ARG_ENABLE([anon],
  3723. [AS_HELP_STRING([--enable-anon],[Enable Anonymous (default: disabled)])],
  3724. [ ENABLED_ANON=$enableval ],
  3725. [ ENABLED_ANON=no ]
  3726. )
  3727. if test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_NGINX" = "xyes" || \
  3728. test "x$ENABLED_HAPROXY" = "xyes" || test "$ENABLED_RSYSLOG" = "yes"
  3729. then
  3730. ENABLED_ANON=yes
  3731. fi
  3732. if test "x$ENABLED_ANON" = "xyes"
  3733. then
  3734. if test "$ENABLED_DH" = "no"
  3735. then
  3736. AC_MSG_ERROR([Anonymous suite requires DH.])
  3737. fi
  3738. AM_CFLAGS="$AM_CFLAGS -DHAVE_ANON"
  3739. fi
  3740. # ASN
  3741. # turn off asn, which means no certs, no rsa, no dsa, no ecc,
  3742. # and no big int (unless dh is on)
  3743. AC_ARG_ENABLE([asn],
  3744. [AS_HELP_STRING([--enable-asn],[Enable ASN (default: enabled)])],
  3745. [ ENABLED_ASN=$enableval ],
  3746. [ ENABLED_ASN=yes ]
  3747. )
  3748. if test "$ENABLED_ASN" = "no"
  3749. then
  3750. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_ASN_CRYPT"
  3751. enable_pwdbased=no
  3752. else
  3753. if test "$ENABLED_ASN" = "template"; then
  3754. ENABLED_ASN="yes"
  3755. fi
  3756. if test "$ENABLED_ASN" = "yes"; then
  3757. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASN_TEMPLATE"
  3758. else
  3759. if test "$ENABLED_ASN" != "original"; then
  3760. AC_MSG_ERROR([Invalid asn option. Valid are: template or original. Seen: $ENABLED_ASN.])
  3761. fi
  3762. fi
  3763. # turn off ASN if leanpsk on
  3764. if test "$ENABLED_LEANPSK" = "yes"
  3765. then
  3766. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_BIG_INT"
  3767. ENABLED_ASN=no
  3768. else
  3769. if test "$ENABLED_ASN" = "nocrypt"
  3770. then
  3771. AM_CFLAGS="$AM_CFLAGS -DNO_ASN_CRYPT"
  3772. enable_pwdbased=no
  3773. fi
  3774. fi
  3775. fi
  3776. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_RSAVFY" = "no" && \
  3777. test "$ENABLED_ASN" = "no" && test "$ENABLED_LOWRESOURCE" = "no"
  3778. then
  3779. AC_MSG_ERROR([please disable rsa if disabling asn.])
  3780. fi
  3781. if test "$ENABLED_DSA" = "yes" && test "$ENABLED_ASN" = "no"
  3782. then
  3783. AC_MSG_ERROR([please disable dsa if disabling asn.])
  3784. fi
  3785. if test "x$ENABLED_ECC" != "xno" && test "x$ENABLED_ASN" = "xno"
  3786. then
  3787. AC_MSG_ERROR([please disable ecc if disabling asn.])
  3788. fi
  3789. # No Big Int (ASN, DSA, RSA, DH, ECC and compatibility layer need bigint)
  3790. if test "$ENABLED_ASN" = "no" && test "$ENABLED_DSA" = "no" && \
  3791. test "$ENABLED_DH" = "no" && test "$ENABLED_ECC" = "no" && \
  3792. test "$ENABLED_RSA" = "no" && test "$ENABLED_OPENSSLEXTRA" = "no" && \
  3793. test "$ENABLED_OPENSSLALL" = "yes"
  3794. then
  3795. ENABLED_SP_MATH_ALL="no"
  3796. ENABLED_FASTMATH="no"
  3797. ENABLED_HEAPMATH="no"
  3798. ENABLED_BIGNUM="no"
  3799. else
  3800. ENABLED_BIGNUM="yes"
  3801. fi
  3802. case $host_os in
  3803. *linux* | *darwin* | *freebsd*)
  3804. DEF_ASN_PRINT="yes"
  3805. ;;
  3806. *)
  3807. DEF_ASN_PRINT="no"
  3808. ;;
  3809. esac
  3810. AC_ARG_ENABLE([asn-print],
  3811. [AS_HELP_STRING([--enable-asn-print],[Enable ASN Print API (default: enabled)])],
  3812. [ ENABLED_ASN_PRINT=$enableval ],
  3813. [ ENABLED_ASN_PRINT=$DEF_ASN_PRINT ]
  3814. )
  3815. if test "$ENABLED_ASN_PRINT" = "yes"
  3816. then
  3817. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASN_PRINT"
  3818. fi
  3819. # AES
  3820. AC_ARG_ENABLE([aes],
  3821. [AS_HELP_STRING([--enable-aes],[Enable AES (default: enabled)])],
  3822. [ ENABLED_AES=$enableval ],
  3823. [ ENABLED_AES=yes ]
  3824. )
  3825. if test "$ENABLED_AES" = "no"
  3826. then
  3827. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  3828. if test "$ENABLED_FORTRESS" = "yes"
  3829. then
  3830. AC_MSG_ERROR([fortress requires aes])
  3831. fi
  3832. if test "$ENABLED_ECC_ENCRYPT" = "yes"
  3833. then
  3834. AC_MSG_ERROR([cannot enable eccencrypt and hkdf without aes.])
  3835. fi
  3836. if test "$ENABLED_AESGCM" != "no"
  3837. then
  3838. AC_MSG_ERROR([AESGCM requires AES.])
  3839. fi
  3840. if test "$ENABLED_AESCCM" = "yes"
  3841. then
  3842. AC_MSG_ERROR([AESCCM requires AES.])
  3843. fi
  3844. if test "$ENABLED_AESCTR" = "yes"
  3845. then
  3846. AC_MSG_ERROR([AESCTR requires AES.])
  3847. fi
  3848. else
  3849. # turn off AES if leanpsk on
  3850. if test "$ENABLED_LEANPSK" = "yes"
  3851. then
  3852. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  3853. ENABLED_AES=no
  3854. fi
  3855. fi
  3856. # DTLSv1.3
  3857. AC_ARG_ENABLE([dtls13],
  3858. [AS_HELP_STRING([--enable-dtls13],[Enable wolfSSL DTLS v1.3 (default: disabled)])],
  3859. [ ENABLED_DTLS13=$enableval ],
  3860. [ ENABLED_DTLS13=no ]
  3861. )
  3862. if test "x$ENABLED_DTLS13" = "xyes"
  3863. then
  3864. if test "x$ENABLED_DTLS" != "xyes" || test "x$ENABLED_TLS13" != "xyes"
  3865. then
  3866. AC_MSG_ERROR([You need to enable both DTLS and TLSv1.3 to use DTLSv1.3])
  3867. fi
  3868. if test "x$ENABLED_SEND_HRR_COOKIE" = "xundefined"
  3869. then
  3870. AC_MSG_NOTICE([DTLSv1.3 is enabled, enabling HRR cookie])
  3871. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SEND_HRR_COOKIE"
  3872. ENABLED_SEND_HRR_COOKIE="yes"
  3873. fi
  3874. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS13 -DWOLFSSL_W64_WRAPPER"
  3875. if test "x$ENABLED_AES" = "xyes"
  3876. then
  3877. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  3878. fi
  3879. fi
  3880. # DTLS CID support
  3881. AC_ARG_ENABLE([dtlscid],
  3882. [AS_HELP_STRING([--enable-dtlscid],[Enable wolfSSL DTLS ConnectionID (default: disabled)])],
  3883. [ ENABLED_DTLS_CID=$enableval ],
  3884. [ ENABLED_DTLS_CID=no ]
  3885. )
  3886. if test "x$ENABLED_DTLS_CID" = "xyes"
  3887. then
  3888. if test "x$ENABLED_DTLS13" != "xyes"
  3889. then
  3890. AC_MSG_ERROR([You need to enable DTLSv1.3 to use DTLS ConnectionID])
  3891. fi
  3892. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS_CID"
  3893. fi
  3894. # CODING
  3895. AC_ARG_ENABLE([coding],
  3896. [AS_HELP_STRING([--enable-coding],[Enable Coding base 16/64 (default: enabled)])],
  3897. [ ENABLED_CODING=$enableval ],
  3898. [ ENABLED_CODING=yes ]
  3899. )
  3900. if test "$ENABLED_CODING" = "no"
  3901. then
  3902. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  3903. else
  3904. # turn off CODING if leanpsk on
  3905. if test "$ENABLED_LEANPSK" = "yes"
  3906. then
  3907. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  3908. ENABLED_CODING=no
  3909. fi
  3910. fi
  3911. # Base64 Encode
  3912. BASE64ENCODE_DEFAULT=no
  3913. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "amd64"
  3914. then
  3915. BASE64ENCODE_DEFAULT=yes
  3916. fi
  3917. AC_ARG_ENABLE([base64encode],
  3918. [AS_HELP_STRING([--enable-base64encode],[Enable Base64 encoding (default: enabled on x86_64/amd64)])],
  3919. [ ENABLED_BASE64ENCODE=$enableval ],
  3920. [ ENABLED_BASE64ENCODE=$BASE64ENCODE_DEFAULT ]
  3921. )
  3922. if test "$ENABLED_BASE64ENCODE" = "yes"
  3923. then
  3924. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BASE64_ENCODE"
  3925. fi
  3926. # Base16
  3927. AC_ARG_ENABLE([base16],
  3928. [AS_HELP_STRING([--enable-base16],[Enable Base16 encoding/decoding (default: disabled)])],
  3929. [ ENABLED_BASE16=$enableval ],
  3930. [ ENABLED_BASE16=no ]
  3931. )
  3932. if test "$ENABLED_CAAM" = "qnx"
  3933. then
  3934. ENABLED_BASE16=yes
  3935. fi
  3936. if test "$ENABLED_BASE16" = "yes"
  3937. then
  3938. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BASE16"
  3939. fi
  3940. # MD4
  3941. AC_ARG_ENABLE([md4],
  3942. [AS_HELP_STRING([--enable-md4],[Enable MD4 (default: disabled)])],
  3943. [ ENABLED_MD4=$enableval ],
  3944. [ ENABLED_MD4=no ]
  3945. )
  3946. # DES3
  3947. AC_ARG_ENABLE([des3],
  3948. [AS_HELP_STRING([--enable-des3],[Enable DES3 (default: disabled)])],
  3949. [ ENABLED_DES3=$enableval ],
  3950. [ ENABLED_DES3=no ]
  3951. )
  3952. # Enable 3DES with OpenSSH and FIPS 140-2 but not 140-3
  3953. if (test "$ENABLED_OPENSSH" = "yes" && \
  3954. (test "x$ENABLED_FIPS" = "xno" || test "$HAVE_FIPS_VERSION" -le 2)) || \
  3955. test "$ENABLED_QT" = "yes" || test "$ENABLED_OPENVPN" = "yes" || \
  3956. test "x$ENABLED_WPAS" != "xno" || test "$ENABLED_NETSNMP" = "yes" || \
  3957. test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_KRB" = "yes" || \
  3958. test "$ENABLED_WOLFENGINE" = "yes" || test "$ENABLED_STRONGSWAN" = "yes"
  3959. then
  3960. ENABLED_DES3="yes"
  3961. fi
  3962. # ARC4
  3963. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  3964. test "$ENABLED_WPAS" = "yes" || test "$ENABLED_KRB" = "yes"
  3965. then
  3966. # Requires RC4 make sure on (if not forcefully disabled with --disable-arc4)
  3967. test "$enable_arc4" = "" && enable_arc4=yes
  3968. fi
  3969. AC_ARG_ENABLE([arc4],
  3970. [AS_HELP_STRING([--enable-arc4],[Enable ARC4 (default: disabled)])],
  3971. [ ENABLED_ARC4=$enableval ],
  3972. [ ENABLED_ARC4=no ]
  3973. )
  3974. # MD5
  3975. AC_ARG_ENABLE([md5],
  3976. [AS_HELP_STRING([--enable-md5],[Enable MD5 (default: enabled)])],
  3977. [ ENABLED_MD5=$enableval ],
  3978. [ ENABLED_MD5=yes ]
  3979. )
  3980. # SHA
  3981. AC_ARG_ENABLE([sha],
  3982. [AS_HELP_STRING([--enable-sha],[Enable SHA (default: enabled)])],
  3983. [ ENABLED_SHA=$enableval ],
  3984. [ ENABLED_SHA=yes ]
  3985. )
  3986. if test "$ENABLED_SHA" = "no"
  3987. then
  3988. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  3989. else
  3990. # turn off SHA if leanpsk or leantls on
  3991. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3992. then
  3993. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  3994. ENABLED_SHA=no
  3995. fi
  3996. fi
  3997. if test "$ENABLED_SHA" = "no" && test "$ENABLED_DSA" != "no"
  3998. then
  3999. AC_MSG_ERROR([please disable DSA if disabling SHA-1.])
  4000. fi
  4001. # SipHash
  4002. AC_ARG_ENABLE([siphash],
  4003. [AS_HELP_STRING([--enable-siphash],[Enable SipHash (default: disabled)])],
  4004. [ ENABLED_SIPHASH=$enableval ],
  4005. [ ENABLED_SIPHASH=no ]
  4006. )
  4007. AS_IF([test "x$ENABLED_SIPHASH" = "xyes"],
  4008. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIPHASH"])
  4009. # CMAC
  4010. AC_ARG_ENABLE([cmac],
  4011. [AS_HELP_STRING([--enable-cmac],[Enable CMAC (default: disabled)])],
  4012. [ ENABLED_CMAC=$enableval ],
  4013. [ ENABLED_CMAC=no ]
  4014. )
  4015. if test "$ENABLED_WPAS" != "no" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  4016. then
  4017. ENABLED_CMAC=yes
  4018. fi
  4019. AS_IF([test "x$ENABLED_CMAC" = "xyes"],
  4020. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC -DWOLFSSL_AES_DIRECT"])
  4021. # AES-XTS
  4022. AC_ARG_ENABLE([xts],
  4023. [AS_HELP_STRING([--enable-xts],[Enable XTS (default: disabled)])],
  4024. [ ENABLED_XTS=$enableval ],
  4025. [ ENABLED_XTS=no ]
  4026. )
  4027. AS_IF([test "x$ENABLED_XTS" = "xyes"],
  4028. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS -DWOLFSSL_AES_DIRECT"])
  4029. AS_IF([test "x$ENABLED_XTS" = "xyes" && test "x$ENABLED_INTELASM" = "xyes"],
  4030. [AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_XTS"])
  4031. AS_IF([test "x$ENABLED_XTS" = "xyes" && test "x$ENABLED_AESNI" = "xyes"],
  4032. [AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_XTS"])
  4033. # Web Server Build
  4034. AC_ARG_ENABLE([webserver],
  4035. [AS_HELP_STRING([--enable-webserver],[Enable Web Server (default: disabled)])],
  4036. [ ENABLED_WEBSERVER=$enableval ],
  4037. [ ENABLED_WEBSERVER=no ]
  4038. )
  4039. if test "$ENABLED_WEBSERVER" = "yes"
  4040. then
  4041. AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
  4042. fi
  4043. # Web Client Build (HTTP Client)
  4044. AC_ARG_ENABLE([webclient],
  4045. [AS_HELP_STRING([--enable-webclient],[Enable Web Client (HTTP) (default: disabled)])],
  4046. [ ENABLED_WEBCLIENT=$enableval ],
  4047. [ ENABLED_WEBCLIENT=no ]
  4048. )
  4049. if test "$ENABLED_WEBCLIENT" = "yes"
  4050. then
  4051. AM_CFLAGS="$AM_CFLAGS -DHAVE_HTTP_CLIENT"
  4052. fi
  4053. # RC2
  4054. AC_ARG_ENABLE([rc2],
  4055. [AS_HELP_STRING([--enable-rc2],[Enable RC2 encryption (default: disabled)])],
  4056. [ ENABLED_RC2=$enableval ],
  4057. [ ENABLED_RC2=no ]
  4058. )
  4059. if test "$ENABLED_RC2" = "yes"
  4060. then
  4061. AM_CFLAGS="$AM_CFLAGS -DWC_RC2"
  4062. fi
  4063. # FIPS feature and macro setup
  4064. AS_CASE([$FIPS_VERSION],
  4065. [v5*|ready|dev], [ # FIPS 140-3
  4066. AM_CFLAGS="$AM_CFLAGS \
  4067. -DHAVE_FIPS \
  4068. -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION \
  4069. -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR \
  4070. -DHAVE_ECC_CDH \
  4071. -DWC_RSA_NO_PADDING \
  4072. -DECC_USER_CURVES \
  4073. -DHAVE_ECC384 \
  4074. -DHAVE_ECC521 \
  4075. -DWOLFSSL_VALIDATE_FFC_IMPORT \
  4076. -DHAVE_FFDHE_Q \
  4077. -DHAVE_FFDHE_3072 \
  4078. -DHAVE_FFDHE_4096 \
  4079. -DHAVE_FFDHE_6144 \
  4080. -DHAVE_FFDHE_8192"
  4081. # KCAPI API does not support custom k for sign, don't force enable ECC key sizes and do not use seed callback
  4082. AS_IF([test "x$ENABLED_KCAPI_ECC" = "xno"],
  4083. [AM_CFLAGS="$AM_CFLAGS \
  4084. -DWC_RNG_SEED_CB \
  4085. -DWOLFSSL_ECDSA_SET_K \
  4086. -DWOLFSSL_VALIDATE_ECC_IMPORT \
  4087. -DWOLFSSL_VALIDATE_ECC_KEYGEN \
  4088. -DHAVE_ECC192 \
  4089. -DHAVE_ECC224 \
  4090. -DHAVE_ECC256"])
  4091. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=8192
  4092. # force various features to FIPS 140-3 defaults, unless overridden with dev:
  4093. AS_IF([test "$ENABLED_KEYGEN" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_keygen" != "no")],
  4094. [ENABLED_KEYGEN="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"])
  4095. AS_IF([test "$ENABLED_COMPKEY" = "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_compkey" != "yes")],
  4096. [ENABLED_COMPKEY="no"])
  4097. AS_IF([test "$ENABLED_SHA224" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_sha224" != "no")],
  4098. [ENABLED_SHA224="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"])
  4099. AS_IF([test "$ENABLED_WOLFSSH" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_ssh" != "no")],
  4100. [enable_ssh="yes"])
  4101. # Shake128 is a SHA-3 algorithm not in our FIPS algorithm list
  4102. AS_IF([test "$ENABLED_SHAKE128" != "no" && (test "$FIPS_VERSION" != "dev" || test "$enable_shake128" != "yes")],
  4103. [ENABLED_SHAKE128=no; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE128"])
  4104. # Shake256 is a SHA-3 algorithm not in our FIPS algorithm list
  4105. AS_IF([test "$ENABLED_SHAKE256" != "no" && (test "$FIPS_VERSION" != "dev" || test "$enable_shake256" != "yes")],
  4106. [ENABLED_SHAKE256=no; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE256"])
  4107. # SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list
  4108. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  4109. AS_IF([test "$ENABLED_AESCCM" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_aesccm" != "no")],
  4110. [ENABLED_AESCCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"])
  4111. AS_IF([test "$ENABLED_RSAPSS" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_rsapss" != "no")],
  4112. [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"])
  4113. AS_IF([test "$ENABLED_ECC" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_ecc" != "no")],
  4114. [ENABLED_ECC="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  4115. AS_IF([test "$ENABLED_ECC_SHAMIR" = "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_eccshamir" != "no")],
  4116. [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])])
  4117. AS_IF([test "$ENABLED_AESCTR" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_aesctr" != "no")],
  4118. [ENABLED_AESCTR="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"])
  4119. AS_IF([test "$ENABLED_CMAC" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_cmac" != "no")],
  4120. [ENABLED_CMAC="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"])
  4121. AS_IF([test "$ENABLED_HKDF" != "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_hkdf" != "no")],
  4122. [ENABLED_HKDF="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"])
  4123. AS_IF([test "$ENABLED_INTELASM" = "yes"],
  4124. [AM_CFLAGS="$AM_CFLAGS -DFORCE_FAILURE_RDSEED"])
  4125. AS_IF([test "$ENABLED_SHA512" = "no" && (test "$FIPS_VERSION" != "dev" || test "$enable_sha512" != "no")],
  4126. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  4127. AS_IF([test "$ENABLED_AESGCM" = "no" && (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm" != "no")],
  4128. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"; AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"])
  4129. # AES-GCM streaming isn't part of the current FIPS suite.
  4130. AS_IF([test "$ENABLED_AESGCM_STREAM" = "yes" && (test "$FIPS_VERSION" != "dev" || test "$enable_aesgcm_stream" != "yes")],
  4131. [ENABLED_AESGCM_STREAM="no"])
  4132. # Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3
  4133. AS_IF([test "$ENABLED_OLD_TLS" != "no"],
  4134. [ENABLED_OLD_TLS="no"; AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"])
  4135. AS_IF([test $HAVE_FIPS_VERSION_MINOR -ge 2],
  4136. [AS_IF([test "x$ENABLED_AESOFB" = "xno" && (test "$FIPS_VERSION" != "dev" || test "$enable_aesofb" != "no")],
  4137. [ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"])])
  4138. AS_IF([(test "$ENABLED_AESCCM" = "yes" && test "$HAVE_AESCCM_PORT" != "yes") ||
  4139. (test "$ENABLED_AESCTR" = "yes" && test "$HAVE_AESCTR_PORT" != "yes") ||
  4140. (test "$ENABLED_AESGCM" = "yes" && test "$HAVE_AESGCM_PORT" != "yes") ||
  4141. (test "$ENABLED_AESOFB" = "yes" && test "$HAVE_AESOFB_PORT" != "yes")],
  4142. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"])
  4143. ],
  4144. [v2],[ # FIPS 140-2, Cert 3389
  4145. AM_CFLAGS="$AM_CFLAGS \
  4146. -DHAVE_FIPS \
  4147. -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION \
  4148. -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR \
  4149. -DWOLFSSL_KEY_GEN \
  4150. -DWOLFSSL_SHA224 \
  4151. -DWOLFSSL_AES_DIRECT \
  4152. -DHAVE_AES_ECB \
  4153. -DHAVE_ECC_CDH \
  4154. -DWC_RSA_NO_PADDING \
  4155. -DWOLFSSL_VALIDATE_FFC_IMPORT \
  4156. -DHAVE_FFDHE_Q \
  4157. -DHAVE_PUBLIC_FFDHE"
  4158. ENABLED_KEYGEN="yes"
  4159. ENABLED_SHA224="yes"
  4160. ENABLED_DES3="yes"
  4161. # Shake256 is a SHA-3 algorithm not in our FIPS algorithm list
  4162. ENABLED_SHAKE256=no
  4163. # SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list
  4164. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  4165. AS_IF([test "x$ENABLED_AESCCM" != "xyes"],
  4166. [ENABLED_AESCCM="yes"
  4167. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"])
  4168. AS_IF([test "x$ENABLED_RSAPSS" != "xyes"],
  4169. [ENABLED_RSAPSS="yes"
  4170. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"])
  4171. AS_IF([test "x$ENABLED_ECC" != "xyes"],
  4172. [ENABLED_ECC="yes"
  4173. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DWOLFSSL_VALIDATE_ECC_IMPORT"
  4174. AS_IF([test "x$ENABLED_ECC_SHAMIR" = "xyes"],
  4175. [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])],
  4176. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VALIDATE_ECC_IMPORT"])
  4177. AS_IF([test "x$ENABLED_AESCTR" != "xyes"],
  4178. [ENABLED_AESCTR="yes"
  4179. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"])
  4180. AS_IF([test "x$ENABLED_AESCTR" != "xyes"],
  4181. [ENABLED_AESCTR="yes"
  4182. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AES_COUNTER"])
  4183. AS_IF([test "x$ENABLED_CMAC" != "xyes"],
  4184. [ENABLED_CMAC="yes"
  4185. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"])
  4186. AS_IF([test "x$ENABLED_HKDF" != "xyes"],
  4187. [ENABLED_HKDF="yes"
  4188. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"])
  4189. AS_IF([test "x$ENABLED_INTELASM" = "xyes"],
  4190. [AM_CFLAGS="$AM_CFLAGS -DFORCE_FAILURE_RDSEED"])
  4191. AS_IF([test "x$ENABLED_SHA512" = "xno"],
  4192. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  4193. AS_IF([test "x$ENABLED_AESGCM" = "xno"],
  4194. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"])
  4195. ],
  4196. ["rand"],[
  4197. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_FIPS_RAND -DHAVE_FIPS -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR"
  4198. ],
  4199. ["v1"],[ # FIPS 140-2, Cert 2425
  4200. AM_CFLAGS="$AM_CFLAGS -DHAVE_FIPS"
  4201. AS_IF([test "x$ENABLED_SHA512" = "xno"],
  4202. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  4203. AS_IF([test "x$ENABLED_AESGCM" = "xno"],
  4204. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"])
  4205. AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"])
  4206. ])
  4207. AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$thread_ls_on" = "xno" && test "$ENABLE_LINUXKM" = "no"],
  4208. [AC_MSG_ERROR([FIPS requires Thread Local Storage])])
  4209. AS_IF([(test "$ENABLED_NULL_CIPHER" = "yes" || test "$ENABLED_LEANPSK" = "yes") && test "$ENABLED_FIPS" != "no" && test "$FIPS_VERSION" != "dev"],
  4210. [AC_MSG_ERROR([FIPS is incompatible with nullcipher])])
  4211. # SELFTEST
  4212. AC_ARG_ENABLE([selftest],
  4213. [AS_HELP_STRING([--enable-selftest],[Enable selftest, Will NOT work w/o CAVP selftest license (default: disabled)])],
  4214. [ ENABLED_SELFTEST=$enableval ],
  4215. [ ENABLED_SELFTEST="no" ]
  4216. )
  4217. AS_CASE([$ENABLED_SELFTEST],
  4218. ["v2"],[
  4219. # selftest v2 (wolfCrypt 4.1.0)
  4220. ENABLED_SELFTEST="yes"
  4221. SELFTEST_VERSION="v2"
  4222. ],
  4223. ["no"],[SELFTEST_VERSION="none"],
  4224. [
  4225. # selftest v1 (wolfCrypt 3.14.2)
  4226. ENABLED_SELFTEST="yes"
  4227. SELFTEST_VERSION="v1"
  4228. ])
  4229. AS_CASE([$SELFTEST_VERSION],
  4230. ["v2"],[
  4231. AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_SELFTEST_VERSION=2 -DHAVE_PUBLIC_FFDHE"
  4232. ],
  4233. ["v1"],[
  4234. AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_PUBLIC_FFDHE"
  4235. ])
  4236. # Set SHA-3 flags
  4237. if test "$ENABLED_SHA3" != "no" && test "$ENABLED_32BIT" = "no"
  4238. then
  4239. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3"
  4240. fi
  4241. # Set SHAKE128 flags
  4242. # FIPS does not support SHAKE 128
  4243. AS_IF([test "x$ENABLED_FIPS" = "xyes"],[ENABLED_SHAKE128="no"])
  4244. if test "$ENABLED_SHAKE128" != "no" && test "$ENABLED_32BIT" = "no"
  4245. then
  4246. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHAKE128"
  4247. if test "$ENABLED_SHA3" = "no"
  4248. then
  4249. AC_MSG_ERROR([Must have SHA-3 enabled: --enable-sha3])
  4250. fi
  4251. else
  4252. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE128"
  4253. fi
  4254. # Set SHAKE256 flags
  4255. # FIPS does not support SHAKE 256
  4256. AS_IF([test "x$ENABLED_FIPS" = "xyes"],[ENABLED_SHAKE256="no"])
  4257. if test "$ENABLED_SHAKE256" != "no" && test "$ENABLED_32BIT" = "no"
  4258. then
  4259. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHAKE256"
  4260. if test "$ENABLED_SHA3" = "no"
  4261. then
  4262. AC_MSG_ERROR([Must have SHA-3 enabled: --enable-sha3])
  4263. fi
  4264. else
  4265. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE256"
  4266. fi
  4267. # set POLY1305 default
  4268. POLY1305_DEFAULT=yes
  4269. if test "x$ENABLED_FIPS" = "xyes"
  4270. then
  4271. POLY1305_DEFAULT=no
  4272. fi
  4273. # POLY1305
  4274. AC_ARG_ENABLE([poly1305],
  4275. [AS_HELP_STRING([--enable-poly1305],[Enable wolfSSL POLY1305 support (default: enabled)])],
  4276. [ ENABLED_POLY1305=$enableval ],
  4277. [ ENABLED_POLY1305=$POLY1305_DEFAULT]
  4278. )
  4279. # leanpsk and leantls don't need poly1305
  4280. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  4281. then
  4282. ENABLED_POLY1305=no
  4283. fi
  4284. if test "$ENABLED_POLY1305" = "yes"
  4285. then
  4286. AM_CFLAGS="$AM_CFLAGS -DHAVE_POLY1305"
  4287. fi
  4288. # set CHACHA default
  4289. CHACHA_DEFAULT=yes
  4290. if test "x$ENABLED_FIPS" = "xyes"
  4291. then
  4292. CHACHA_DEFAULT=no
  4293. fi
  4294. # CHACHA
  4295. AC_ARG_ENABLE([chacha],
  4296. [AS_HELP_STRING([--enable-chacha],[Enable CHACHA (default: enabled). Use `=noasm` to disable ASM AVX/AVX2 speedups])],
  4297. [ ENABLED_CHACHA=$enableval ],
  4298. [ ENABLED_CHACHA=$CHACHA_DEFAULT]
  4299. )
  4300. # leanpsk and leantls don't need chacha
  4301. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  4302. then
  4303. ENABLED_CHACHA=no
  4304. fi
  4305. if test "$ENABLED_CHACHA" = "noasm" || test "$ENABLED_ASM" = "no"
  4306. then
  4307. AM_CFLAGS="$AM_CFLAGS -DNO_CHACHA_ASM"
  4308. fi
  4309. if test "$ENABLED_CHACHA" != "no"
  4310. then
  4311. AM_CFLAGS="$AM_CFLAGS -DHAVE_CHACHA"
  4312. fi
  4313. # XCHACHA
  4314. AC_ARG_ENABLE([xchacha],
  4315. [AS_HELP_STRING([--enable-xchacha],[Enable XCHACHA (default: disabled).])],
  4316. [ ENABLED_XCHACHA=$enableval ],
  4317. [ ENABLED_XCHACHA=no]
  4318. )
  4319. if test "$ENABLED_XCHACHA" = "yes"
  4320. then
  4321. if test "$ENABLED_CHACHA" = "no"
  4322. then
  4323. AC_MSG_ERROR([XChaCha (--enable-xchacha) depends on ChaCha (--enable-chacha)])
  4324. fi
  4325. AM_CFLAGS="$AM_CFLAGS -DHAVE_XCHACHA"
  4326. fi
  4327. # Hash DRBG
  4328. AC_ARG_ENABLE([hashdrbg],
  4329. [AS_HELP_STRING([--enable-hashdrbg],[Enable Hash DRBG support (default: enabled)])],
  4330. [ ENABLED_HASHDRBG=$enableval ],
  4331. [ ENABLED_HASHDRBG=yes ]
  4332. )
  4333. if test "x$ENABLED_HASHDRBG" = "xyes"
  4334. then
  4335. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  4336. else
  4337. # turn on Hash DRBG if FIPS is on (don't force on for KCAPI)
  4338. if test "x$ENABLED_FIPS" = "xyes" && test "x$ENABLED_KCAPI" = "xno"
  4339. then
  4340. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  4341. ENABLED_HASHDRBG=yes
  4342. else
  4343. AM_CFLAGS="$AM_CFLAGS -DWC_NO_HASHDRBG"
  4344. fi
  4345. fi
  4346. # MemUse Entropy
  4347. AC_ARG_ENABLE([entropy-memuse],
  4348. [AS_HELP_STRING([--enable-entropy-memuse],[Enable memuse entropy support (default: disabled)])],
  4349. [ ENABLED_ENTROPY_MEMUSE=$enableval ],
  4350. [ ENABLED_ENTROPY_MEMUSE=no ]
  4351. )
  4352. if test "x$ENABLED_ENTROPY_MEMUSE" != "xno"
  4353. then
  4354. AM_CFLAGS="$AM_CFLAGS -DHAVE_ENTROPY_MEMUSE"
  4355. enable_sha3=yes
  4356. for v in `echo $ENABLED_ENTROPY_MEMUSE | tr "," " "`
  4357. do
  4358. case $v in
  4359. yes)
  4360. ;;
  4361. thread)
  4362. AM_CFLAGS="$AM_CFLAGS -DENTROPY_MEMUSE_THREAD"
  4363. ;;
  4364. nofallback)
  4365. AM_CFLAGS="$AM_CFLAGS -DENTROPY_MEMUSE_FORCE_FAILURE"
  4366. ;;
  4367. *)
  4368. AC_MSG_ERROR([Invalid MemUse Entropy option. Valid are: thread, nofallback. Seen: $ENABLED_ENTROPY_MEMUSE.])
  4369. break;;
  4370. esac
  4371. done
  4372. fi
  4373. # Filesystem Build
  4374. if test "$ENABLED_LINUXKM" = "yes"
  4375. then
  4376. ENABLED_FILESYSTEM_DEFAULT=no
  4377. else
  4378. ENABLED_FILESYSTEM_DEFAULT=yes
  4379. fi
  4380. AC_ARG_ENABLE([filesystem],
  4381. [AS_HELP_STRING([--enable-filesystem],[Enable Filesystem support (default: enabled)])],
  4382. [ ENABLED_FILESYSTEM=$enableval ],
  4383. [ ENABLED_FILESYSTEM=$ENABLED_FILESYSTEM_DEFAULT ]
  4384. )
  4385. if test "$ENABLED_FILESYSTEM" = "no"
  4386. then
  4387. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  4388. else
  4389. # turn off filesystem if leanpsk on
  4390. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LINUXKM" = "yes"
  4391. then
  4392. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  4393. ENABLED_FILESYSTEM=no
  4394. fi
  4395. fi
  4396. # inline Build
  4397. AC_ARG_ENABLE([inline],
  4398. [AS_HELP_STRING([--enable-inline],[Enable inline functions (default: enabled)])],
  4399. [ ENABLED_INLINE=$enableval ],
  4400. [ ENABLED_INLINE=yes ]
  4401. )
  4402. if test "$ENABLED_INLINE" = "no"
  4403. then
  4404. AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
  4405. fi
  4406. # OCSP
  4407. if test "x$ENABLED_OPENSSLALL" = "xyes" || test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  4408. then
  4409. test "$enable_ocsp" = "" && enable_ocsp=yes
  4410. fi
  4411. AC_ARG_ENABLE([ocsp],
  4412. [AS_HELP_STRING([--enable-ocsp],[Enable OCSP (default: disabled)])],
  4413. [ ENABLED_OCSP=$enableval ],
  4414. [ ENABLED_OCSP=no ]
  4415. )
  4416. if test "$ENABLED_OCSP" = "yes"
  4417. then
  4418. # check openssl command tool for testing ocsp
  4419. AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no])
  4420. if test "$HAVE_OPENSSL_CMD" = "yes"
  4421. then
  4422. AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD"
  4423. else
  4424. AC_MSG_WARN([openssl command line tool not available for testing ocsp])
  4425. fi
  4426. fi
  4427. # Certificate Status Request : a.k.a. OCSP Stapling
  4428. AC_ARG_ENABLE([ocspstapling],
  4429. [AS_HELP_STRING([--enable-ocspstapling],[Enable OCSP Stapling (default: disabled)])],
  4430. [ ENABLED_CERTIFICATE_STATUS_REQUEST=$enableval ],
  4431. [ ENABLED_CERTIFICATE_STATUS_REQUEST=no ]
  4432. )
  4433. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  4434. then
  4435. ENABLED_CERTIFICATE_STATUS_REQUEST="yes"
  4436. fi
  4437. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"
  4438. then
  4439. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST"
  4440. # Requires OCSP make sure on
  4441. if test "x$ENABLED_OCSP" = "xno"
  4442. then
  4443. ENABLED_OCSP="yes"
  4444. fi
  4445. fi
  4446. # Certificate Status Request v2 : a.k.a. OCSP stapling v2
  4447. AC_ARG_ENABLE([ocspstapling2],
  4448. [AS_HELP_STRING([--enable-ocspstapling2],[Enable OCSP Stapling v2 (default: disabled)])],
  4449. [ ENABLED_CERTIFICATE_STATUS_REQUEST_V2=$enableval ],
  4450. [ ENABLED_CERTIFICATE_STATUS_REQUEST_V2=no ]
  4451. )
  4452. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  4453. then
  4454. ENABLED_CERTIFICATE_STATUS_REQUEST_V2=yes
  4455. fi
  4456. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"
  4457. then
  4458. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2"
  4459. # Requires OCSP make sure on
  4460. if test "x$ENABLED_OCSP" = "xno"
  4461. then
  4462. ENABLED_OCSP="yes"
  4463. fi
  4464. fi
  4465. # CRL
  4466. AC_ARG_ENABLE([crl],
  4467. [AS_HELP_STRING([--enable-crl],[Enable CRL (Use =io for inline CRL HTTP GET) (default: disabled)])],
  4468. [ ENABLED_CRL=$enableval ],
  4469. [ ENABLED_CRL=no ]
  4470. )
  4471. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_OPENVPN" = "xyes" || \
  4472. test "x$ENABLED_WPAS" != "xno" || test "x$ENABLED_LIGHTY" = "xyes" || test "x$ENABLED_NETSNMP" = "xyes" || \
  4473. test "x$ENABLED_KRB" = "xyes" || test "x$ENABLED_STRONGSWAN" = "xyes"
  4474. then
  4475. ENABLED_CRL=yes
  4476. fi
  4477. if test "$ENABLED_CRL" != "no"
  4478. then
  4479. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4480. fi
  4481. if test "$ENABLED_CRL" = "io"
  4482. then
  4483. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_IO"
  4484. fi
  4485. # CRL Monitor
  4486. AC_ARG_ENABLE([crl-monitor],
  4487. [AS_HELP_STRING([--enable-crl-monitor],[Enable CRL Monitor (default: disabled)])],
  4488. [ ENABLED_CRL_MONITOR=$enableval ],
  4489. [ ENABLED_CRL_MONITOR=no ]
  4490. )
  4491. if test "$ENABLED_CRL_MONITOR" = "yes"
  4492. then
  4493. case $host_os in
  4494. *linux* | *darwin* | *freebsd*)
  4495. if test "x$ENABLED_SINGLETHREADED" = "xno"; then
  4496. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
  4497. else
  4498. ENABLED_CRL_MONITOR="no"
  4499. AC_MSG_ERROR([crl monitor requires threading / pthread])
  4500. fi
  4501. ;;
  4502. *)
  4503. if test "x$ENABLED_DISTRO" = "xyes" ; then
  4504. ENABLED_CRL_MONITOR="no"
  4505. else
  4506. AC_MSG_ERROR( [crl monitor only allowed on linux, OS X, or freebsd])
  4507. fi
  4508. break;;
  4509. esac
  4510. fi
  4511. # USER CRYPTO
  4512. ENABLED_USER_CRYPTO="no"
  4513. ENABLED_USER_RSA="no"
  4514. AC_DEFINE([BUILD_USER_RSA], [], [User RSA is being defined])
  4515. trycryptodir=""
  4516. AC_ARG_WITH([user-crypto],
  4517. [AS_HELP_STRING([--with-user-crypto=PATH],[Path to USER_CRYPTO install (default /usr/local)])],
  4518. [
  4519. CPPFLAGS="$CPPFLAGS -DHAVE_USER_CRYPTO"
  4520. LIBS="$LIBS -lusercrypto"
  4521. if test "x$withval" != "xno" ; then
  4522. trycryptodir=$withval
  4523. fi
  4524. if test "x$withval" = "xyes" ; then
  4525. trycryptodir="/usr/local"
  4526. fi
  4527. LDFLAGS="$LDFLAGS -L$trycryptodir/lib"
  4528. CPPFLAGS="$CPPFLAGS -I$trycryptodir/include"
  4529. #Look for RSA Init function in usercrypto lib
  4530. AC_CHECK_LIB([usercrypto], [wc_InitRsaKey], [user_rsa_linked=yes], [user_rsa_linked=no])
  4531. if test "x$user_rsa_linked" = "xyes" ; then
  4532. AC_MSG_NOTICE([User user_rsa.h being used])
  4533. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_RSA"
  4534. ENABLED_USER_RSA=yes
  4535. ENABLED_USER_CRYPTO=yes
  4536. fi
  4537. #Display check and find result of link attempts
  4538. AC_MSG_CHECKING([for USER_CRYPTO])
  4539. if test "x$ENABLED_USER_CRYPTO" = "xno" ; then
  4540. AC_MSG_RESULT([no])
  4541. AC_MSG_ERROR([USER_CRYPTO not found. Either move to /usr/include and /usr/lib or
  4542. Specify its path using --with-user-crypto=/dir/])
  4543. else
  4544. AC_MSG_RESULT([yes])
  4545. # Check if .la is available if not then rely on exported path
  4546. if test -e $trycryptodir/lib/libusercrypto.la
  4547. then
  4548. LIB_ADD="$trycryptodir/lib/libusercrypto.la $LIB_ADD"
  4549. else
  4550. LIB_ADD="-lusercrypto $LIB_ADD"
  4551. fi
  4552. AM_LDFLAGS="$AM_LDFLAGS -L$trycryptodir/lib"
  4553. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_CRYPTO"
  4554. fi
  4555. ]
  4556. )
  4557. if test "$ENABLED_USER_CRYPTO" = "yes" && test "$ENABLED_FIPS" = "yes"
  4558. then
  4559. AC_MSG_ERROR([cannot enable user crypto and fips, user crypto possibility of using code in fips boundary.])
  4560. fi
  4561. # Whitewood netRandom client library
  4562. ENABLED_WNR="no"
  4563. trywnrdir=""
  4564. AC_ARG_WITH([wnr],
  4565. [AS_HELP_STRING([--with-wnr=PATH],[Path to Whitewood netRandom install (default /usr/local)])],
  4566. [
  4567. AC_MSG_CHECKING([for Whitewood netRandom])
  4568. LIBS="$LIBS -lwnr"
  4569. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wnr.h>]], [[ wnr_setup(0, 0); ]])], [ wnr_linked=yes ],[ wnr_linked=no ])
  4570. if test "x$wnr_linked" = "xno" ; then
  4571. if test "x$withval" != "xno" ; then
  4572. trywnrdir=$withval
  4573. fi
  4574. if test "x$withval" = "xyes" ; then
  4575. trywnrdir="/usr/local"
  4576. fi
  4577. CPPFLAGS="$AM_CPPFLAGS -DHAVE_WNR -I$trywnrdir/include"
  4578. LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$trywnrdir/lib"
  4579. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wnr.h>]], [[ wnr_setup(0, 0); ]])], [ wnr_linked=yes ],[ wnr_linked=no ])
  4580. if test "x$wnr_linked" = "xno" ; then
  4581. AC_MSG_ERROR([Whitewood netRandom isn't found.
  4582. If it's already installed, specify its path using --with-wnr=/dir/])
  4583. fi
  4584. AC_MSG_RESULT([yes])
  4585. AM_CPPFLAGS="$CPPFLAGS"
  4586. AM_LDFLAGS="$AM_LDFLAGS -L$trywnrdir/lib"
  4587. else
  4588. AC_MSG_RESULT([yes])
  4589. fi
  4590. AM_CFLAGS="$AM_CFLAGS -DHAVE_WNR"
  4591. ENABLED_WNR="yes"
  4592. ]
  4593. )
  4594. # SNI
  4595. # enable SNI automatically for x86_64/x86/aarch64/amd64
  4596. SNI_DEFAULT=no
  4597. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "x86" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"
  4598. then
  4599. SNI_DEFAULT=yes
  4600. fi
  4601. AC_ARG_ENABLE([sni],
  4602. [AS_HELP_STRING([--enable-sni],[Enable SNI (default: enabled on x86_64/x86/aarch64/amd64)])],
  4603. [ ENABLED_SNI=$enableval ],
  4604. [ ENABLED_SNI=$SNI_DEFAULT ]
  4605. )
  4606. if test "x$ENABLED_QT" = "xyes" || test "$ENABLED_QUIC" = "yes"
  4607. then
  4608. ENABLED_SNI="yes"
  4609. fi
  4610. if test "x$ENABLED_SNI" = "xyes"
  4611. then
  4612. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  4613. fi
  4614. # Maximum Fragment Length
  4615. AC_ARG_ENABLE([maxfragment],
  4616. [AS_HELP_STRING([--enable-maxfragment],[Enable Maximum Fragment Length (default: disabled)])],
  4617. [ ENABLED_MAX_FRAGMENT=$enableval ],
  4618. [ ENABLED_MAX_FRAGMENT=no ]
  4619. )
  4620. # ALPN
  4621. AC_ARG_ENABLE([alpn],
  4622. [AS_HELP_STRING([--enable-alpn],[Enable ALPN (default: disabled)])],
  4623. [ ENABLED_ALPN=$enableval ],
  4624. [ ENABLED_ALPN=no ]
  4625. )
  4626. if test "$ENABLED_BIND" = "yes"
  4627. then
  4628. ENABLED_ALPN=yes
  4629. fi
  4630. if test "$ENABLED_QUIC" = "yes"
  4631. then
  4632. ENABLED_ALPN=yes
  4633. fi
  4634. if test "x$ENABLED_ALPN" = "xyes"
  4635. then
  4636. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  4637. fi
  4638. # Maximum Fragment Length
  4639. if test "x$ENABLED_MAX_FRAGMENT" = "xyes"
  4640. then
  4641. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_MAX_FRAGMENT"
  4642. fi
  4643. # Trusted CA Indication Extension
  4644. AC_ARG_ENABLE([trustedca],
  4645. [AS_HELP_STRING([--enable-trustedca],[Enable Trusted CA Indication (default: disabled)])],
  4646. [ ENABLED_TRUSTED_CA=$enableval ],[ ENABLED_TRUSTED_CA=no ])
  4647. AS_IF([test "x$ENABLED_TRUSTED_CA" = "xyes"],
  4648. [AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUSTED_CA"])
  4649. # Truncated HMAC
  4650. AC_ARG_ENABLE([truncatedhmac],
  4651. [AS_HELP_STRING([--enable-truncatedhmac],[Enable Truncated HMAC (default: disabled)])],
  4652. [ ENABLED_TRUNCATED_HMAC=$enableval ],
  4653. [ ENABLED_TRUNCATED_HMAC=no ]
  4654. )
  4655. if test "x$ENABLED_TRUNCATED_HMAC" = "xyes"
  4656. then
  4657. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUNCATED_HMAC"
  4658. fi
  4659. # Renegotiation Indication - (FAKE Secure Renegotiation)
  4660. # Client will send TLS_EMPTY_RENEGOTIATION_INFO_SCSV, not supported
  4661. # with enabling secure renegotiation
  4662. AC_ARG_ENABLE([renegotiation-indication],
  4663. [AS_HELP_STRING([--enable-renegotiation-indication],[Enable Renegotiation Indication for client via empty cipher (default: disabled)])],
  4664. [ ENABLED_RENEGOTIATION_INDICATION=$enableval ],
  4665. [ ENABLED_RENEGOTIATION_INDICATION=no ]
  4666. )
  4667. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  4668. then
  4669. AM_CFLAGS="$AM_CFLAGS -DHAVE_RENEGOTIATION_INDICATION"
  4670. fi
  4671. # Secure Renegotiation
  4672. AC_ARG_ENABLE([secure-renegotiation],
  4673. [AS_HELP_STRING([--enable-secure-renegotiation],[Enable Secure Renegotiation (default: disabled)])],
  4674. [ ENABLED_SECURE_RENEGOTIATION=$enableval ],
  4675. [ ENABLED_SECURE_RENEGOTIATION=no ]
  4676. )
  4677. if test "x$ENABLED_HAPROXY" = "xyes"
  4678. then
  4679. ENABLED_SECURE_RENEGOTIATION=yes
  4680. fi
  4681. if test "x$ENABLED_SECURE_RENEGOTIATION" = "xyes"
  4682. then
  4683. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  4684. then
  4685. AC_MSG_ERROR([cannot enable renegotiation-indication and secure-renegotiation.])
  4686. fi
  4687. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SECURE_RENEGOTIATION -DHAVE_SERVER_RENEGOTIATION_INFO"
  4688. fi
  4689. # Secure Renegotiation Info
  4690. AC_ARG_ENABLE([secure-renegotiation-info],
  4691. [AS_HELP_STRING([--enable-secure-renegotiation-info],[Enable Secure Renegotiation info extension (default: enabled)])],
  4692. [ ENABLED_SECURE_RENEGOTIATION_INFO=$enableval ],
  4693. [ ENABLED_SECURE_RENEGOTIATION_INFO=yes ]
  4694. )
  4695. # Fallback SCSV
  4696. AC_ARG_ENABLE([fallback-scsv],
  4697. [AS_HELP_STRING([--enable-fallback-scsv],[Enable Fallback SCSV (default: disabled)])],
  4698. [ ENABLED_FALLBACK_SCSV=$enableval ],
  4699. [ ENABLED_FALLBACK_SCSV=no ]
  4700. )
  4701. if test "x$ENABLED_FALLBACK_SCSV" = "xyes"
  4702. then
  4703. AM_CFLAGS="$AM_CFLAGS -DHAVE_FALLBACK_SCSV"
  4704. fi
  4705. # Exporting Keying Material
  4706. AC_ARG_ENABLE([keying-material],
  4707. [AS_HELP_STRING([--enable-keying-material],[Enable Keying Material Exporters (default: disabled)])],
  4708. [ ENABLED_KEYING_MATERIAL=$enableval ],
  4709. [ ENABLED_KEYING_MATERIAL=no ]
  4710. )
  4711. if test "$ENABLED_CHRONY" = "yes" || test "$ENABLED_SRTP" = "yes"
  4712. then
  4713. ENABLED_KEYING_MATERIAL=yes
  4714. fi
  4715. if test "x$ENABLED_KEYING_MATERIAL" = "xyes"
  4716. then
  4717. AM_CFLAGS="$AM_CFLAGS -DHAVE_KEYING_MATERIAL"
  4718. fi
  4719. # Supported Elliptic Curves Extensions
  4720. AC_ARG_ENABLE([supportedcurves],
  4721. [AS_HELP_STRING([--enable-supportedcurves],[Enable Supported Elliptic Curves (default: enabled)])],
  4722. [ENABLED_SUPPORTED_CURVES=$enableval],
  4723. [ENABLED_SUPPORTED_CURVES=yes])
  4724. if test "x$ENABLED_SUPPORTED_CURVES" = "xyes"
  4725. then
  4726. AS_IF([test "x$ENABLED_ECC" = "xno" && test "x$ENABLED_CURVE25519" = "xno" && test "x$ENABLED_CURVE448" = "xno"],
  4727. [ENABLED_SUPPORTED_CURVES=no],
  4728. [AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES"])
  4729. fi
  4730. # Diffie-Hellman
  4731. if test "$ENABLED_DH" != "no"
  4732. then
  4733. if test "$ENABLED_TLS13" = "yes" || test "$ENABLED_SUPPORTED_CURVES" = "yes"
  4734. then
  4735. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048"
  4736. fi
  4737. fi
  4738. # FFDHE parameters only
  4739. AC_ARG_ENABLE([ffdhe-only],
  4740. [AS_HELP_STRING([--enable-ffdhe-only],[Enable using only FFDHE in client (default: disabled)])],
  4741. [ ENABLED_FFDHE_ONLY=$enableval ],
  4742. [ ENABLED_FFDHE_ONLY=no ]
  4743. )
  4744. if test "x$ENABLED_FFDHE_ONLY" = "xyes"
  4745. then
  4746. if test "$ENABLED_DH" = "no"
  4747. then
  4748. AC_MSG_ERROR([FFDHE only support requires DH support])
  4749. fi
  4750. if test "$ENABLED_SUPPORTED_CURVES" = "no"
  4751. then
  4752. AC_MSG_ERROR([FFDHE only support requires Supported Curves extension])
  4753. fi
  4754. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_REQUIRE_FFDHE"
  4755. fi
  4756. # TLS 1.3 Requires either ECC or (RSA/DH), or CURVE25519/ED25519 or CURVE448/ED448 or libOQS
  4757. if test "x$ENABLED_PSK" = "xno" && test "x$ENABLED_ECC" = "xno" && \
  4758. (test "x$ENABLED_RSA" = "xno" || test "x$ENABLED_DH" = "xno") && \
  4759. (test "x$ENABLED_CURVE25519" = "xno" || test "x$ENABLED_ED25519" = "xno") && \
  4760. (test "x$ENABLED_CURVE448" = "xno" || test "x$ENABLED_ED448" = "xno") && \
  4761. test "x$ENABLED_LIBOQS" = "xno"
  4762. then
  4763. # disable TLS 1.3
  4764. ENABLED_TLS13=no
  4765. fi
  4766. if test "$ENABLED_TLS13" = "yes" && (test "x$ENABLED_ECC" = "xyes" || \
  4767. test "$ENABLED_DH" != "no")
  4768. then
  4769. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"
  4770. fi
  4771. if test "$ENABLED_TLS13" = "yes"
  4772. then
  4773. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TLS13 -DHAVE_TLS_EXTENSIONS"
  4774. fi
  4775. # Session Ticket Extension
  4776. AC_ARG_ENABLE([session-ticket],
  4777. [AS_HELP_STRING([--enable-session-ticket],[Enable Session Ticket (default: disabled)])],
  4778. [ ENABLED_SESSION_TICKET=$enableval ],
  4779. [ ENABLED_SESSION_TICKET=no ]
  4780. )
  4781. if test "x$ENABLED_NGINX" = "xyes" || test "$ENABLED_WPAS" = "yes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  4782. then
  4783. ENABLED_SESSION_TICKET=yes
  4784. fi
  4785. if test "x$ENABLED_SESSION_TICKET" = "xyes"
  4786. then
  4787. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SESSION_TICKET"
  4788. fi
  4789. AC_ARG_ENABLE([ticket-nonce-malloc],
  4790. [AS_HELP_STRING([--enable-ticket-nonce-malloc], [Enable dynamic allocation of ticket nonces (default: disabled)])],
  4791. [ ENABLED_TICKET_NONCE_MALLOC=$enableval ],
  4792. [ ENABLED_TICKET_NONCE_MALLOC=no ]
  4793. )
  4794. if test "$ENABLED_TICKET_NONCE_MALLOC" = "yes"
  4795. then
  4796. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TICKET_NONCE_MALLOC"
  4797. fi
  4798. # Extended Master Secret Extension
  4799. AC_ARG_ENABLE([extended-master],
  4800. [AS_HELP_STRING([--enable-extended-master],[Enable Extended Master Secret (default: enabled)])],
  4801. [ ENABLED_EXTENDED_MASTER=$enableval ],
  4802. [ ENABLED_EXTENDED_MASTER=yes ]
  4803. )
  4804. if test "$ENABLED_CRYPTONLY" = "yes"
  4805. then
  4806. ENABLED_EXTENDED_MASTER=no
  4807. fi
  4808. if test "x$ENABLED_EXTENDED_MASTER" = "xyes"
  4809. then
  4810. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXTENDED_MASTER"
  4811. fi
  4812. # TLS Extensions
  4813. AC_ARG_ENABLE([tlsx],
  4814. [AS_HELP_STRING([--enable-tlsx],[Enable all TLS Extensions (default: disabled)])],
  4815. [ ENABLED_TLSX=$enableval ],
  4816. [ ENABLED_TLSX=no ]
  4817. )
  4818. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_SIGNAL" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes" || test "$ENABLED_CHRONY" = "yes"
  4819. then
  4820. ENABLED_TLSX=yes
  4821. fi
  4822. if test "x$ENABLED_TLSX" = "xyes"
  4823. then
  4824. ENABLED_SNI=yes
  4825. ENABLED_MAX_FRAGMENT=yes
  4826. ENABLED_TRUNCATED_HMAC=yes
  4827. ENABLED_ALPN=yes
  4828. ENABLED_TRUSTED_CA=yes
  4829. ENABLED_ENCRYPT_THEN_MAC=yes
  4830. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_ALPN -DHAVE_TRUSTED_CA"
  4831. # Check the ECC supported curves prereq
  4832. AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_TLS13" = "xyes"],
  4833. [ENABLED_SUPPORTED_CURVES=yes
  4834. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
  4835. fi
  4836. # Early Data handshake in TLS v1.3 and above
  4837. AC_ARG_ENABLE([earlydata],
  4838. [AS_HELP_STRING([--enable-earlydata],[Enable Early Data handshake with wolfSSL TLS v1.3 (default: disabled)])],
  4839. [ ENABLED_TLS13_EARLY_DATA=$enableval ],
  4840. [ ENABLED_TLS13_EARLY_DATA=no ]
  4841. )
  4842. if test "$ENABLED_TLS13_EARLY_DATA" = "group"
  4843. then
  4844. ENABLED_TLS13_EARLY_DATA="yes"
  4845. # Group EarlyData with ClientHello
  4846. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EARLY_DATA_GROUP"
  4847. fi
  4848. if test "$ENABLED_TLS13_EARLY_DATA" = "yes"
  4849. then
  4850. if test "x$ENABLED_TLS13" = "xno" && test "x$ENABLED_ALL" = "xno"
  4851. then
  4852. AC_MSG_ERROR([cannot enable earlydata without enabling tls13.])
  4853. fi
  4854. if test "x$ENABLED_SESSION_TICKET" = "xno" && test "x$ENABLED_PSK" = "xno"
  4855. then
  4856. AC_MSG_ERROR([cannot enable earlydata without enabling session tickets and/or PSK.])
  4857. fi
  4858. if test "x$ENABLED_TLS13" = "xyes"
  4859. then
  4860. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EARLY_DATA"
  4861. fi
  4862. fi
  4863. if test "$ENABLED_TLSV12" = "no" && test "$ENABLED_TLS13" = "yes" && test "x$ENABLED_SESSION_TICKET" = "xno"
  4864. then
  4865. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE"
  4866. fi
  4867. # PKCS7
  4868. AC_ARG_ENABLE([pkcs7],
  4869. [AS_HELP_STRING([--enable-pkcs7],[Enable PKCS7 (default: disabled)])],
  4870. [ ENABLED_PKCS7=$enableval ],
  4871. [ ENABLED_PKCS7=no ]
  4872. )
  4873. if test "x$ENABLED_WPAS_DPP" = "xyes"
  4874. then
  4875. ENABLED_PKCS7=yes
  4876. fi
  4877. # wolfSSH Options
  4878. AC_ARG_ENABLE([wolfssh],
  4879. [AS_HELP_STRING([--enable-wolfssh],[Enable wolfSSH options (default: disabled)])],
  4880. [ ENABLED_WOLFSSH=$enableval ],
  4881. [ ENABLED_WOLFSSH=no ]
  4882. )
  4883. AC_ARG_ENABLE([ssh],
  4884. [AS_HELP_STRING([--enable-ssh],[Enable wolfSSH options (default: disabled)])],
  4885. [ ENABLED_SSH=$enableval ],
  4886. [ ENABLED_SSH=no ]
  4887. )
  4888. if test "x$ENABLED_SSH" = "xyes"
  4889. then
  4890. ENABLED_WOLFSSH="yes"
  4891. fi
  4892. # wolfTPM Options
  4893. AC_ARG_ENABLE([wolftpm],
  4894. [AS_HELP_STRING([--enable-wolftpm],[Enable wolfTPM options (default: disabled)])],
  4895. [ ENABLED_WOLFTPM=$enableval ],
  4896. [ ENABLED_WOLFTPM=no ]
  4897. )
  4898. # wolfCLU Options
  4899. AC_ARG_ENABLE([wolfclu],
  4900. [AS_HELP_STRING([--enable-wolfclu],[Enable wolfCLU options (default: disabled)])],
  4901. [ ENABLED_WOLFCLU=$enableval ],
  4902. [ ENABLED_WOLFCLU=no ]
  4903. )
  4904. if test "x$ENABLED_WOLFTPM" = "xyes"
  4905. then
  4906. # Requires cryptocb (set in its enable section)
  4907. # Requires certgen, certreq, certext
  4908. if test "x$ENABLED_CERTGEN" = "xno"
  4909. then
  4910. ENABLED_CERTGEN="yes"
  4911. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4912. fi
  4913. if test "x$ENABLED_CERTREQ" = "xno"
  4914. then
  4915. ENABLED_CERTREQ="yes"
  4916. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  4917. fi
  4918. if test "x$ENABLED_CERTEXT" = "xno"
  4919. then
  4920. ENABLED_CERTEXT="yes"
  4921. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  4922. fi
  4923. # Requires PKCS7
  4924. if test "x$ENABLED_PKCS7" = "xno"
  4925. then
  4926. ENABLED_PKCS7="yes"
  4927. fi
  4928. # Requires aescfb
  4929. if test "x$ENABLED_AESCFB" = "xno"
  4930. then
  4931. ENABLED_AESCFB="yes"
  4932. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  4933. fi
  4934. # Requires public mp_
  4935. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
  4936. fi
  4937. if test "x$ENABLED_SMIME" = "xyes"
  4938. then
  4939. AM_CFLAGS="$AM_CFLAGS -DHAVE_SMIME"
  4940. # Requires PKCS7
  4941. if test "x$ENABLED_PKCS7" = "xno"
  4942. then
  4943. ENABLED_PKCS7="yes"
  4944. fi
  4945. fi
  4946. # Simple Certificate Enrollment Protocol (SCEP)
  4947. AC_ARG_ENABLE([scep],
  4948. [AS_HELP_STRING([--enable-scep],[Enable wolfSCEP (default: disabled)])],
  4949. [ ENABLED_WOLFSCEP=$enableval ],
  4950. [ ENABLED_WOLFSCEP=no ]
  4951. )
  4952. # Secure Remote Password
  4953. AC_ARG_ENABLE([srp],
  4954. [AS_HELP_STRING([--enable-srp],[Enable Secure Remote Password (default: disabled)])],
  4955. [ ENABLED_SRP=$enableval ],
  4956. [ ENABLED_SRP=no ]
  4957. )
  4958. if test "x$ENABLED_SRP" = "xyes"
  4959. then
  4960. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SRP"
  4961. fi
  4962. # Indefinite length encoded BER message support
  4963. AC_ARG_ENABLE([indef],
  4964. [AS_HELP_STRING([--enable-indef],[Enable parsing of indefinite length encoded msgs (default: disabled)])],
  4965. [ ENABLED_BER_INDEF=$enableval ],
  4966. [ ENABLED_BER_INDEF=no ]
  4967. )
  4968. if test "x$ENABLED_BER_INDEF" = "xyes"
  4969. then
  4970. AM_CFLAGS="$AM_CFLAGS -DASN_BER_TO_DER"
  4971. fi
  4972. # Alternate certification chains, as opposed to requiring full chain validation.
  4973. # Certificate validation behavior is relaxed, similar to openssl and
  4974. # browsers. Only the peer certificate must validate to a trusted
  4975. # certificate. Without this, all certificates sent by a peer must be
  4976. # used in the trust chain or the connection will be rejected.
  4977. AC_ARG_ENABLE([altcertchains],
  4978. [AS_HELP_STRING([--enable-altcertchains],[Enable using alternative certificate chains, only require leaf certificate to validate to trust root (default: disabled)])],
  4979. [ ENABLED_ALT_CERT_CHAINS=$enableval ],
  4980. [ ENABLED_ALT_CERT_CHAINS=no ]
  4981. )
  4982. if test "x$ENABLED_ALT_CERT_CHAINS" = "xyes"
  4983. then
  4984. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  4985. fi
  4986. # Small Stack - Cache on object
  4987. AC_ARG_ENABLE([smallstackcache],
  4988. [AS_HELP_STRING([--enable-smallstackcache],[Enable Small Stack Usage Caching (default: disabled)])],
  4989. [ ENABLED_SMALL_STACK_CACHE=$enableval ],
  4990. [ ENABLED_SMALL_STACK_CACHE=no ]
  4991. )
  4992. if test "x$ENABLED_SMALL_STACK_CACHE" = "xyes"
  4993. then
  4994. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK_CACHE"
  4995. fi
  4996. # Small Stack
  4997. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  4998. then
  4999. ENABLED_SMALL_STACK_DEFAULT=yes
  5000. else
  5001. ENABLED_SMALL_STACK_DEFAULT=no
  5002. fi
  5003. AC_ARG_ENABLE([smallstack],
  5004. [AS_HELP_STRING([--enable-smallstack],[Enable Small Stack Usage (default: disabled)])],
  5005. [ ENABLED_SMALL_STACK=$enableval ],
  5006. [ ENABLED_SMALL_STACK=$ENABLED_SMALL_STACK_DEFAULT ]
  5007. )
  5008. if test "x$ENABLED_SMALL_STACK_CACHE" = "xyes"
  5009. then
  5010. ENABLED_SMALL_STACK=yes
  5011. fi
  5012. if test "x$ENABLED_SMALL_STACK" = "xyes"
  5013. then
  5014. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK"
  5015. fi
  5016. #valgrind
  5017. AC_ARG_ENABLE([valgrind],
  5018. [AS_HELP_STRING([--enable-valgrind],[Enable valgrind for unit tests (default: disabled)])],
  5019. [ ENABLED_VALGRIND=$enableval ],
  5020. [ ENABLED_VALGRIND=no ]
  5021. )
  5022. if test "$ENABLED_VALGRIND" = "yes"
  5023. then
  5024. AC_CHECK_PROG([HAVE_VALGRIND],[valgrind],[yes],[no])
  5025. if test "$HAVE_VALGRIND" = "no"
  5026. then
  5027. AC_MSG_ERROR([Valgrind not found.])
  5028. fi
  5029. enable_shared=no
  5030. enable_static=yes
  5031. AM_CFLAGS="$AM_CFLAGS -DHAVE_VALGRIND"
  5032. fi
  5033. # Test certs, use internal cert functions for extra testing
  5034. AC_ARG_ENABLE([testcert],
  5035. [AS_HELP_STRING([--enable-testcert],[Enable Test Cert (default: disabled)])],
  5036. [ ENABLED_TESTCERT=$enableval ],
  5037. [ ENABLED_TESTCERT=no ]
  5038. )
  5039. if test "$ENABLED_TESTCERT" = "yes"
  5040. then
  5041. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TEST_CERT"
  5042. fi
  5043. # I/O Pool, an example to show user how to override memory handler and use
  5044. # a pool for the input/output buffer requests
  5045. AC_ARG_ENABLE([iopool],
  5046. [AS_HELP_STRING([--enable-iopool],[Enable I/O Pool example (default: disabled)])],
  5047. [ ENABLED_IOPOOL=$enableval ],
  5048. [ ENABLED_IOPOOL=no ]
  5049. )
  5050. if test "$ENABLED_IOPOOL" = "yes"
  5051. then
  5052. if test "$thread_ls_on" = "no"
  5053. then
  5054. AC_MSG_ERROR([I/O Pool example requires Thread Local Storage])
  5055. fi
  5056. AM_CFLAGS="$AM_CFLAGS -DHAVE_IO_POOL -DXMALLOC_USER"
  5057. fi
  5058. # Certificate Service Support
  5059. AC_ARG_ENABLE([certservice],
  5060. [AS_HELP_STRING([--enable-certservice],[Enable cert service (default: disabled)])],
  5061. [ ENABLED_CERT_SERVICE=$enableval ],
  5062. [ ENABLED_CERT_SERVICE=no ]
  5063. )
  5064. if test "$ENABLED_CERT_SERVICE" = "yes"
  5065. then
  5066. # Requires ecc,certgen, and opensslextra make sure on
  5067. if test "x$ENABLED_CERTGEN" = "xno"
  5068. then
  5069. ENABLED_CERTGEN="yes"
  5070. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5071. fi
  5072. if test "x$ENABLED_ECC" = "xno"
  5073. then
  5074. ENABLED_ECC="yes"
  5075. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  5076. if test "$ENABLED_ECC_SHAMIR" = "yes"
  5077. then
  5078. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  5079. fi
  5080. fi
  5081. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5082. then
  5083. ENABLED_OPENSSLEXTRA="yes"
  5084. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5085. fi
  5086. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_CERT_SERVICE"
  5087. fi
  5088. # wolfSSL JNI
  5089. AC_ARG_ENABLE([jni],
  5090. [AS_HELP_STRING([--enable-jni],[Enable wolfSSL JNI (default: disabled)])],
  5091. [ ENABLED_JNI=$enableval ],
  5092. [ ENABLED_JNI=no ]
  5093. )
  5094. if test "$ENABLED_JNI" = "yes"
  5095. then
  5096. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_JNI -DHAVE_EX_DATA"
  5097. # Enable prereqs if not already enabled
  5098. if test "x$ENABLED_DTLS" = "xno"
  5099. then
  5100. ENABLED_DTLS="yes"
  5101. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  5102. fi
  5103. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  5104. then
  5105. ENABLED_OPENSSLEXTRA="yes"
  5106. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5107. fi
  5108. if test "x$ENABLED_OPENSSLALL" = "xno"
  5109. then
  5110. ENABLED_OPENSSLALL="yes"
  5111. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL"
  5112. fi
  5113. if test "x$ENABLED_CRL" = "xno"
  5114. then
  5115. ENABLED_CRL="yes"
  5116. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  5117. fi
  5118. if test "x$ENABLED_OCSP" = "xno"
  5119. then
  5120. ENABLED_OCSP="yes"
  5121. fi
  5122. if test "x$ENABLED_CRL_MONITOR" = "xno" && test "x$ENABLED_DISTRO" = "xno"
  5123. then
  5124. ENABLED_CRL_MONITOR="yes"
  5125. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
  5126. fi
  5127. if test "x$ENABLED_SAVESESSION" = "xno"
  5128. then
  5129. ENABLED_SAVESESSION="yes"
  5130. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  5131. fi
  5132. if test "x$ENABLED_SAVECERT" = "xno"
  5133. then
  5134. ENABLED_SAVECERT="yes"
  5135. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  5136. fi
  5137. if test "x$ENABLED_ATOMICUSER" = "xno"
  5138. then
  5139. ENABLED_ATOMICUSER="yes"
  5140. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  5141. fi
  5142. if test "x$ENABLED_ECC" = "xno"
  5143. then
  5144. ENABLED_ECC="yes"
  5145. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  5146. if test "$ENABLED_ECC_SHAMIR" = "yes"
  5147. then
  5148. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  5149. fi
  5150. fi
  5151. # Do not enable PK Callbacks in FIPS mode with JNI
  5152. if test "x$ENABLED_PKCALLBACKS" = "xno" && test "$ENABLED_FIPS" = "no"
  5153. then
  5154. ENABLED_PKCALLBACKS="yes"
  5155. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  5156. fi
  5157. if test "x$ENABLED_DH" = "xno"
  5158. then
  5159. ENABLED_DH="yes"
  5160. AM_CFLAGS="$AM_CFLAGS -DHAVE_DH"
  5161. fi
  5162. if test "x$ENABLED_PSK" = "xno"
  5163. then
  5164. ENABLED_PSK="yes"
  5165. fi
  5166. if test "x$ENABLED_CERTEXT" = "xno"
  5167. then
  5168. ENABLED_CERTEXT="yes"
  5169. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  5170. fi
  5171. if test "x$ENABLED_CERTGEN" = "xno"
  5172. then
  5173. ENABLED_CERTGEN="yes"
  5174. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5175. fi
  5176. if test "x$ENABLED_CERTREQ" = "xno"
  5177. then
  5178. ENABLED_CERTREQ="yes"
  5179. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  5180. fi
  5181. if test "x$ENABLED_SNI" = "xno"
  5182. then
  5183. ENABLED_SNI="yes"
  5184. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  5185. fi
  5186. if test "x$ENABLED_ALPN" = "xno"
  5187. then
  5188. ENABLED_ALPN="yes"
  5189. AM_CFLAGS="$AM_CFLAGS -DHAVE_ALPN"
  5190. fi
  5191. # cert gen requires alt names
  5192. ENABLED_ALTNAMES="yes"
  5193. fi
  5194. if test "$ENABLED_LIGHTY" = "yes"
  5195. then
  5196. # Requires opensslextra make sure on
  5197. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5198. then
  5199. ENABLED_OPENSSLEXTRA="yes"
  5200. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5201. fi
  5202. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIGHTY -DHAVE_WOLFSSL_SSL_H=1"
  5203. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  5204. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL"
  5205. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  5206. # recommended if building wolfSSL specifically for use by lighttpd
  5207. if test "x$ENABLED_ALL" = "xno"; then
  5208. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP"
  5209. if test "x$ENABLED_SSLV3" = "xno"; then
  5210. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL3"
  5211. if test "x$ENABLED_TLSV10" = "xno"; then
  5212. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  5213. ENABLED_OLD_TLS=no
  5214. fi
  5215. fi
  5216. if test "x$ENABLED_CRL_MONITOR" = "xno"; then
  5217. AM_CFLAGS="$AM_CFLAGS -DSINGLE_THREADED"
  5218. ENABLED_SINGLETHREADED="yes"
  5219. fi
  5220. # w/ lighttpd 1.4.56 once wolfSSL updated to expose non-filesystem funcs
  5221. #AM_CFLAGS="$AM_CFLAGS -DNO_BIO"
  5222. #AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  5223. #ENABLED_FILESYSTEM=no
  5224. fi
  5225. fi
  5226. if test "$ENABLED_NGINX" = "yes"
  5227. then
  5228. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NGINX -DWOLFSSL_SIGNER_DER_CERT"
  5229. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS"
  5230. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ERROR_CODE_OPENSSL"
  5231. fi
  5232. if test "$ENABLED_HAPROXY" = "yes"
  5233. then
  5234. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAPROXY -DOPENSSL_COMPATIBLE_DEFAULTS"
  5235. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNER_DER_CERT"
  5236. # --enable-all defines its own DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS
  5237. if test -z "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS"
  5238. then
  5239. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=8192
  5240. fi
  5241. # Requires opensslextra and opensslall
  5242. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5243. then
  5244. ENABLED_OPENSSLALL="yes"
  5245. ENABLED_OPENSSLEXTRA="yes"
  5246. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  5247. fi
  5248. if test "x$ENABLED_CERTGEN" = "xno"
  5249. then
  5250. ENABLED_CERTGEN="yes"
  5251. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5252. fi
  5253. if test "x$ENABLED_CERTREQ" = "xno"
  5254. then
  5255. ENABLED_CERTREQ="yes"
  5256. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  5257. fi
  5258. # Requires sessioncerts make sure on
  5259. if test "x$ENABLED_SESSIONCERTS" = "xno"
  5260. then
  5261. ENABLED_SESSIONCERTS="yes"
  5262. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  5263. fi
  5264. # Requires key gen make sure on
  5265. if test "x$ENABLED_KEYGEN" = "xno"
  5266. then
  5267. ENABLED_KEYGEN="yes"
  5268. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  5269. fi
  5270. fi
  5271. if test "$ENABLED_NETSNMP" = "yes"
  5272. then
  5273. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  5274. if test "x$ENABLED_AESCFB" = "xno"
  5275. then
  5276. ENABLED_AESCFB="yes"
  5277. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  5278. fi
  5279. if test "x$ENABLED_DTLS" = "xno"
  5280. then
  5281. ENABLED_DTLS="yes"
  5282. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  5283. fi
  5284. fi
  5285. if test "$ENABLED_KRB" = "yes"
  5286. then
  5287. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KRB -DWOLFSSL_AES_DIRECT -DWOLFSSL_DES_ECB"
  5288. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  5289. # Requires PKCS7
  5290. if test "x$ENABLED_PKCS7" = "xno"
  5291. then
  5292. ENABLED_PKCS7="yes"
  5293. fi
  5294. fi
  5295. if test "$ENABLED_FFMPEG" = "yes"
  5296. then
  5297. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FFMPEG -DOPENSSL_COMPATIBLE_DEFAULTS"
  5298. fi
  5299. if test "$ENABLED_SIGNAL" = "yes"
  5300. then
  5301. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNAL -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"
  5302. # Requires opensslextra make sure on
  5303. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5304. then
  5305. ENABLED_OPENSSLEXTRA="yes"
  5306. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5307. fi
  5308. fi
  5309. if test "$ENABLED_BIND" = "yes"
  5310. then
  5311. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BIND -DWOLFSSL_DSA_768_MODULUS"
  5312. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB -DWOLFSSL_DES_ECB"
  5313. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224 -DWOLFSSL_SHA384 -DWOLFSSL_SHA512"
  5314. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS"
  5315. ENABLED_SHA224="yes"
  5316. ENABLED_SHA384="yes"
  5317. ENABLED_SHA512="yes"
  5318. fi
  5319. if test "$ENABLED_RSYSLOG" = "yes"
  5320. then
  5321. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSYSLOG -DWOLFSSL_ERROR_CODE_OPENSSL"
  5322. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DOPENSSL_COMPATIBLE_DEFAULTS"
  5323. fi
  5324. if test "$ENABLED_OPENVPN" = "yes"
  5325. then
  5326. ENABLED_SUPPORTED_CURVES="yes"
  5327. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OPENVPN -DHAVE_KEYING_MATERIAL"
  5328. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB -DHAVE_EX_DATA -DWOLFSSL_KEY_GEN"
  5329. fi
  5330. if test "$ENABLED_HITCH" = "yes"
  5331. then
  5332. # Requires opensslextra make sure on
  5333. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5334. then
  5335. ENABLED_OPENSSLEXTRA="yes"
  5336. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5337. fi
  5338. # Requires OCSP make sure on
  5339. if test "x$ENABLED_OCSP" = "xno"
  5340. then
  5341. ENABLED_OCSP="yes"
  5342. fi
  5343. # Requires ALPN
  5344. if test "x$ENABLED_ALPN" = "xno"
  5345. then
  5346. ENABLED_ALPN="yes"
  5347. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  5348. fi
  5349. if test "x$ENABLED_KEYGEN" = "xno"
  5350. then
  5351. ENABLED_KEYGEN="yes"
  5352. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  5353. fi
  5354. # Requires sessioncerts make sure on
  5355. if test "x$ENABLED_SESSIONCERTS" = "xno"
  5356. then
  5357. ENABLED_SESSIONCERTS="yes"
  5358. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  5359. fi
  5360. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HITCH -DHAVE_EX_DATA -DWOLFSSL_SIGNER_DER_CERT"
  5361. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS -DWOLFSSL_CIPHER_INTERNALNAME"
  5362. fi
  5363. if test "$ENABLED_NGINX" = "yes"|| test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  5364. then
  5365. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_VERIFY_CB"
  5366. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  5367. AM_CFLAGS="$AM_CFLAGS -DKEEP_OUR_CERT -DKEEP_PEER_CERT"
  5368. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DHAVE_EX_DATA"
  5369. ENABLED_CERTGEN="yes"
  5370. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5371. fi
  5372. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  5373. test "$ENABLED_WPAS" = "yes" || test "$ENABLED_QT" = "yes"
  5374. then
  5375. test "$enable_arc4" = "" && enable_arc4=yes
  5376. fi
  5377. if test "$ENABLED_ARC4" = "no"
  5378. then
  5379. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  5380. else
  5381. # turn off ARC4 if leanpsk or leantls on
  5382. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  5383. then
  5384. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  5385. ENABLED_ARC4=no
  5386. fi
  5387. fi
  5388. # Asio Support
  5389. AC_ARG_ENABLE([asio],
  5390. [AS_HELP_STRING([--enable-asio],[Enable asio (default: disabled)])],
  5391. [ ENABLED_ASIO=$enableval ],
  5392. [ ENABLED_ASIO=no ]
  5393. )
  5394. if test "$ENABLED_ASIO" = "yes"
  5395. then
  5396. # Requires opensslextra and opensslall
  5397. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5398. then
  5399. ENABLED_OPENSSLALL="yes"
  5400. ENABLED_OPENSSLEXTRA="yes"
  5401. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  5402. fi
  5403. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASIO -DASIO_USE_WOLFSSL -DWOLFSSL_KEY_GEN"
  5404. AM_CFLAGS="$AM_CFLAGS -DBOOST_ASIO_USE_WOLFSSL -DHAVE_EX_DATA"
  5405. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1_2"
  5406. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3"
  5407. if test "$ENABLED_TLSV10" = "yes"
  5408. then
  5409. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1"
  5410. fi
  5411. if test "$ENABLED_OLD_TLS" = "yes"
  5412. then
  5413. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1_1"
  5414. fi
  5415. # Requires OCSP make sure on
  5416. if test "x$ENABLED_OCSP" = "xno"
  5417. then
  5418. ENABLED_OCSP="yes"
  5419. fi
  5420. fi
  5421. # Apache HTTPD
  5422. AC_ARG_ENABLE([apachehttpd],
  5423. [AS_HELP_STRING([--enable-apachehttpd],[Enable Apache httpd (default: disabled)])],
  5424. [ ENABLED_APACHE_HTTPD=$enableval ],
  5425. [ ENABLED_APACHE_HTTPD=no ]
  5426. )
  5427. if test "$ENABLED_APACHE_HTTPD" = "yes"
  5428. then
  5429. # Requires opensslextra and opensslall
  5430. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5431. then
  5432. ENABLED_OPENSSLALL="yes"
  5433. ENABLED_OPENSSLEXTRA="yes"
  5434. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  5435. fi
  5436. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_APACHE_HTTPD"
  5437. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3 -DOPENSSL_NO_COMP"
  5438. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DWOLFSSL_SIGNER_DER_CERT"
  5439. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT -DWOLFSSL_CERT_GEN"
  5440. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  5441. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS"
  5442. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OCSP_ISSUER_CHECK"
  5443. # Requires OCSP make sure on
  5444. if test "x$ENABLED_OCSP" = "xno"
  5445. then
  5446. ENABLED_OCSP="yes"
  5447. fi
  5448. # Requires sessioncerts make sure on
  5449. if test "x$ENABLED_SESSIONCERTS" = "xno"
  5450. then
  5451. ENABLED_SESSIONCERTS="yes"
  5452. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  5453. fi
  5454. # Requires ALPN
  5455. if test "x$ENABLED_ALPN" = "xno"
  5456. then
  5457. ENABLED_ALPN="yes"
  5458. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  5459. fi
  5460. # Requires CRL
  5461. if test "x$ENABLED_CRL" = "xno"
  5462. then
  5463. ENABLED_CRL="yes"
  5464. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  5465. fi
  5466. # Requires Certificate Generation, Request and Extensions
  5467. if test "x$ENABLED_CERTGEN" = "xno"
  5468. then
  5469. ENABLED_CERTGEN="yes"
  5470. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5471. fi
  5472. if test "x$ENABLED_CERTREQ" = "xno"
  5473. then
  5474. ENABLED_CERTREQ="yes"
  5475. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  5476. fi
  5477. if test "x$ENABLED_CERTEXT" = "xno"
  5478. then
  5479. ENABLED_CERTEXT="yes"
  5480. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  5481. fi
  5482. # Requires Secure Renegotiation
  5483. if test "x$ENABLED_SECURE_RENEGOTIATION" = "xno"
  5484. then
  5485. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SECURE_RENEGOTIATION -DHAVE_SERVER_RENEGOTIATION_INFO"
  5486. fi
  5487. fi
  5488. # Encrypt-Then-Mac
  5489. AC_ARG_ENABLE([enc-then-mac],
  5490. [AS_HELP_STRING([--enable-enc-then-mac],[Enable Encrypt-Then-Mac extension (default: enabled)])],
  5491. [ ENABLED_ENCRYPT_THEN_MAC=$enableval ],
  5492. [ ENABLED_ENCRYPT_THEN_MAC=yes ]
  5493. )
  5494. if test "x$ENABLED_TLSX" = "xyes"
  5495. then
  5496. ENABLED_ENCRYPT_THEN_MAC=yes
  5497. fi
  5498. if test "x$ENABLED_ENCRYPT_THEN_MAC" = "xyes"
  5499. then
  5500. AM_CFLAGS="$AM_CFLAGS -DHAVE_ENCRYPT_THEN_MAC"
  5501. fi
  5502. # stunnel Support
  5503. AC_ARG_ENABLE([stunnel],
  5504. [AS_HELP_STRING([--enable-stunnel],[Enable stunnel (default: disabled)])],
  5505. [ ENABLED_STUNNEL=$enableval ],
  5506. [ ENABLED_STUNNEL=no ]
  5507. )
  5508. if test "$ENABLED_WPAS" = "yes"
  5509. then
  5510. ENABLED_STUNNEL="yes"
  5511. fi
  5512. # stunnel support requires all the features enabled within this conditional.
  5513. if test "$ENABLED_STUNNEL" = "yes"
  5514. then
  5515. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5516. then
  5517. ENABLED_OPENSSLEXTRA="yes"
  5518. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5519. fi
  5520. if test "x$ENABLED_SESSION_TICKET" = "xno"
  5521. then
  5522. ENABLED_SESSION_TICKET="yes"
  5523. AM_CFLAGS="$AM_CFLAGS -DHAVE_SESSION_TICKET"
  5524. fi
  5525. if test "x$ENABLED_OCSP" = "xno"
  5526. then
  5527. ENABLED_OCSP="yes"
  5528. fi
  5529. if test "x$ENABLED_CODING" = "xno"
  5530. then
  5531. ENABLED_CODING="yes"
  5532. fi
  5533. if test "x$ENABLED_SESSIONCERTS" = "xno"
  5534. then
  5535. ENABLED_SESSIONCERTS="yes"
  5536. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  5537. fi
  5538. if test "x$ENABLED_CRL" = "xno"
  5539. then
  5540. ENABLED_CRL="yes"
  5541. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  5542. fi
  5543. if test "x$ENABLED_DES3" = "xno"
  5544. then
  5545. ENABLED_DES3="yes"
  5546. fi
  5547. if test "x$ENABLED_TLSX" = "xno"
  5548. then
  5549. ENABLED_TLSX="yes"
  5550. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC"
  5551. # Check the ECC supported curves prereq
  5552. AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes"],
  5553. [ENABLED_SUPPORTED_CURVES=yes
  5554. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
  5555. fi
  5556. if test "x$ENABLED_ECC" = "xno"
  5557. then
  5558. ENABLED_OPENSSLEXTRA="yes"
  5559. ENABLED_ECC="yes"
  5560. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  5561. if test "$ENABLED_ECC_SHAMIR" = "yes"
  5562. then
  5563. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  5564. fi
  5565. fi
  5566. if test "x$ENABLED_CERTEXT" = "xno"
  5567. then
  5568. ENABLED_CERTEXT="yes"
  5569. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  5570. fi
  5571. if test "x$ENABLED_CERTGEN" = "xno"
  5572. then
  5573. ENABLED_CERTGEN="yes"
  5574. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5575. fi
  5576. if test "x$ENABLED_KEYGEN" = "xno"
  5577. then
  5578. ENABLED_KEYGEN="yes"
  5579. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  5580. fi
  5581. AM_CFLAGS="$AM_CFLAGS -DHAVE_STUNNEL -DWOLFSSL_ALWAYS_VERIFY_CB"
  5582. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI -DHAVE_EX_DATA"
  5583. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB -DWOLFSSL_SIGNER_DER_CERT"
  5584. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS -DWOLFSSL_TICKET_HAVE_ID"
  5585. fi
  5586. # curl Support
  5587. AC_ARG_ENABLE([curl],
  5588. [AS_HELP_STRING([--enable-curl],[Enable curl (default: disabled)])],
  5589. [ ENABLED_CURL=$enableval ],
  5590. [ ENABLED_CURL=no ]
  5591. )
  5592. # curl support requires all the features enabled within this conditional.
  5593. if test "$ENABLED_CURL" = "yes"
  5594. then
  5595. if test "$ENABLED_MD4" = "no"
  5596. then
  5597. ENABLED_MD4="yes"
  5598. fi
  5599. if test "x$ENABLED_DES3" = "xno"
  5600. then
  5601. ENABLED_DES3="yes"
  5602. fi
  5603. if test "x$ENABLED_ALPN" = "xno"
  5604. then
  5605. ENABLED_ALPN="yes"
  5606. fi
  5607. if test "x$ENABLED_WOLFSSH" = "xno"
  5608. then
  5609. ENABLED_WOLFSSH="yes"
  5610. fi
  5611. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5612. then
  5613. ENABLED_OPENSSLEXTRA="yes"
  5614. fi
  5615. if test "x$ENABLED_CRL" = "xno"
  5616. then
  5617. ENABLED_CRL="yes"
  5618. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  5619. fi
  5620. if test "x$ENABLED_OCSP" = "xno"
  5621. then
  5622. ENABLED_OCSP="yes"
  5623. fi
  5624. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xno"
  5625. then
  5626. ENABLED_CERTIFICATE_STATUS_REQUEST="yes"
  5627. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST"
  5628. fi
  5629. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xno"
  5630. then
  5631. ENABLED_CERTIFICATE_STATUS_REQUEST_V2="yes"
  5632. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2"
  5633. fi
  5634. if test "x$ENABLED_SNI" = "xno"
  5635. then
  5636. ENABLED_SNI="yes"
  5637. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  5638. fi
  5639. if test "x$ENABLED_ALT_CERT_CHAINS" = "xno"
  5640. then
  5641. ENABLED_ALT_CERT_CHAINS="yes"
  5642. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  5643. fi
  5644. if test "x$ENABLE_IP_ALT_NAME" = "xno"
  5645. then
  5646. ENABLE_IP_ALT_NAME="yes"
  5647. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IP_ALT_NAME"
  5648. fi
  5649. if test "x$ENABLED_SESSION_TICKET" = "xno"
  5650. then
  5651. ENABLED_SESSION_TICKET="yes"
  5652. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SESSION_TICKET"
  5653. fi
  5654. # FTPS server requires pointer to session cache
  5655. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE_REF"
  5656. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB"
  5657. fi
  5658. if test "$ENABLED_PSK" = "no" && test "$ENABLED_LEANPSK" = "no" \
  5659. && test "x$ENABLED_STUNNEL" = "xno"
  5660. then
  5661. AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
  5662. fi
  5663. if test "$ENABLED_PSK" = "no" && \
  5664. (test "$ENABLED_LEANPSK" = "yes" || test "x$ENABLED_STUNNEL" = "xyes")
  5665. then
  5666. ENABLED_PSK=yes
  5667. fi
  5668. # tcpdump support
  5669. AC_ARG_ENABLE([tcpdump],
  5670. [AS_HELP_STRING([--enable-tcpdump],[Enable tcpdump (default: disabled)])],
  5671. [ ENABLED_TCPDUMP=$enableval ],
  5672. [ ENABLED_TCPDUMP=no ]
  5673. )
  5674. # tcpdump support requires all the features enabled within this conditional.
  5675. if test "$ENABLED_TCPDUMP" = "yes"
  5676. then
  5677. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5678. then
  5679. ENABLED_OPENSSLEXTRA="yes"
  5680. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5681. fi
  5682. if test "x$ENABLED_DES3" = "xno"
  5683. then
  5684. ENABLED_DES3="yes"
  5685. fi
  5686. fi
  5687. # sblim-sfcb support
  5688. AC_ARG_ENABLE([sblim-sfcb],
  5689. [AS_HELP_STRING([--enable-sblim-sfcb],[Enable sblim-sfcb support (default: disabled)])],
  5690. [ ENABLED_SBLIM_SFCB=$enableval ],
  5691. [ ENABLED_SBLIM_SFCB=no ]
  5692. )
  5693. # sblim-sfcb support requires all the features enabled within this conditional.
  5694. if test "$ENABLED_SBLIM_SFCB" = "yes"
  5695. then
  5696. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5697. then
  5698. ENABLED_OPENSSLEXTRA="yes"
  5699. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  5700. fi
  5701. if test "x$ENABLED_CERTGEN" = "xno"
  5702. then
  5703. ENABLED_CERTGEN="yes"
  5704. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5705. fi
  5706. AM_CFLAGS="$AM_CFLAGS -DHAVE_SBLIM_SFCB -DWOLFSSL_SIGNER_DER_CERT"
  5707. fi
  5708. # libest Support
  5709. AC_ARG_ENABLE([libest],
  5710. [AS_HELP_STRING([--enable-libest],[Enable libest (default: disabled)])],
  5711. [ ENABLED_LIBEST=$enableval ],
  5712. [ ENABLED_LIBEST=no ]
  5713. )
  5714. if test "$ENABLED_LIBEST" = "yes"
  5715. then
  5716. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DHAVE_LIBEST -DWOLFSSL_ALT_NAMES"
  5717. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_SALT_LEN_DISCOVER"
  5718. # Requires opensslextra and opensslall
  5719. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5720. then
  5721. ENABLED_OPENSSLALL="yes"
  5722. ENABLED_OPENSSLEXTRA="yes"
  5723. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  5724. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE -DWC_RSA_NO_PADDING"
  5725. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS -DWOLFSSL_PSS_LONG_SALT"
  5726. fi
  5727. # Requires OCSP
  5728. if test "x$ENABLED_OCSP" = "xno"
  5729. then
  5730. ENABLED_OCSP="yes"
  5731. fi
  5732. # Requires PKCS7
  5733. if test "x$ENABLED_PKCS7" = "xno"
  5734. then
  5735. ENABLED_PKCS7="yes"
  5736. fi
  5737. # Requires Certificate Generation and Request
  5738. if test "x$ENABLED_CERTGEN" = "xno"
  5739. then
  5740. ENABLED_CERTGEN="yes"
  5741. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  5742. fi
  5743. if test "x$ENABLED_CERTREQ" = "xno"
  5744. then
  5745. ENABLED_CERTREQ="yes"
  5746. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  5747. fi
  5748. if test "x$ENABLED_CERTEXT" = "xno"
  5749. then
  5750. ENABLED_CERTEXT="yes"
  5751. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  5752. fi
  5753. # Requires CRL
  5754. if test "x$ENABLED_CRL" = "xno"
  5755. then
  5756. ENABLED_CRL="yes"
  5757. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  5758. fi
  5759. if test "x$ENABLED_SRP" = "xno"
  5760. then
  5761. ENABLED_SRP="yes"
  5762. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SRP"
  5763. fi
  5764. # Enable prereqs if not already enabled
  5765. if test "x$ENABLED_KEYGEN" = "xno"
  5766. then
  5767. ENABLED_KEYGEN="yes"
  5768. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  5769. fi
  5770. # Requires sessioncerts make sure on
  5771. if test "x$ENABLED_SESSIONCERTS" = "xno"
  5772. then
  5773. ENABLED_SESSIONCERTS="yes"
  5774. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  5775. fi
  5776. if test "x$ENABLED_DSA" = "xno"
  5777. then
  5778. AC_MSG_WARN([Enabling DSA with --enable-dsa is recommended for libest])
  5779. fi
  5780. fi
  5781. if test "$ENABLED_MD4" = "no"
  5782. then
  5783. #turn on MD4 if using stunnel
  5784. if test "x$ENABLED_STUNNEL" = "xyes" || test "x$ENABLED_WPAS" != "xno" || test "x$ENABLED_KRB" = "xyes"
  5785. then
  5786. ENABLED_MD4="yes"
  5787. else
  5788. AM_CFLAGS="$AM_CFLAGS -DNO_MD4"
  5789. fi
  5790. fi
  5791. # Encrypted keys
  5792. AC_ARG_ENABLE([enckeys],
  5793. [AS_HELP_STRING([--enable-enckeys],[Enable PEM encrypted private key support (default: disabled)])],
  5794. [ ENABLED_ENCKEYS=$enableval ],
  5795. [ ENABLED_ENCKEYS=no ]
  5796. )
  5797. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes" || test "$ENABLED_WPAS" != "no"
  5798. then
  5799. ENABLED_ENCKEYS=yes
  5800. fi
  5801. if test "$ENABLED_ENCKEYS" = "yes"
  5802. then
  5803. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ENCRYPTED_KEYS"
  5804. fi
  5805. # PKCS#12
  5806. # set PKCS#12 default
  5807. PKCS12_DEFAULT=yes
  5808. if test "$ENABLED_ASN" = "no" || test "$FIPS_VERSION" = "rand"
  5809. then
  5810. PKCS12_DEFAULT=no
  5811. fi
  5812. AC_ARG_ENABLE([pkcs12],
  5813. [AS_HELP_STRING([--enable-pkcs12],[Enable pkcs12 (default: enabled)])],
  5814. [ ENABLED_PKCS12=$enableval ],
  5815. [ ENABLED_PKCS12=$PKCS12_DEFAULT ]
  5816. )
  5817. if test "x$ENABLED_PKCS12" = "xno"
  5818. then
  5819. AM_CFLAGS="$AM_CFLAGS -DNO_PKCS12"
  5820. fi
  5821. # PWDBASED has to come after certservice since we want it on w/o explicit on
  5822. # PWDBASED
  5823. AC_ARG_ENABLE([pwdbased],
  5824. [AS_HELP_STRING([--enable-pwdbased],[Enable PWDBASED (default: disabled)])],
  5825. [ ENABLED_PWDBASED=$enableval ],
  5826. [ ENABLED_PWDBASED=no ]
  5827. )
  5828. if test "$ENABLED_PWDBASED" = "no"
  5829. then
  5830. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_OPENSSLALL" = "yes" || \
  5831. test "$ENABLED_WEBSERVER" = "yes" || test "$ENABLED_ENCKEYS" = "yes" || \
  5832. test "$ENABLED_PKCS12" = "yes"
  5833. then
  5834. # opensslextra, opensslall, webserver, enckeys and pkcs12 need pwdbased
  5835. ENABLED_PWDBASED=yes
  5836. else
  5837. AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
  5838. fi
  5839. fi
  5840. AC_ARG_ENABLE([scrypt],
  5841. [AS_HELP_STRING([--enable-scrypt],[Enable SCRYPT (default: disabled)])],
  5842. [ ENABLED_SCRYPT=$enableval ],
  5843. [ ENABLED_SCRYPT=no ]
  5844. )
  5845. if test "$ENABLED_SCRYPT" = "yes"
  5846. then
  5847. if test "$ENABLED_PWDBASED" = "no"
  5848. then
  5849. AC_MSG_ERROR([cannot enable scrypt without enabling pwdbased.])
  5850. fi
  5851. AM_CFLAGS="$AM_CFLAGS -DHAVE_SCRYPT"
  5852. fi
  5853. # wolfCrypt Only Build
  5854. if test "$ENABLED_CRYPTONLY" = "yes"
  5855. then
  5856. if test "$ENABLED_OPENSSLALL" = "yes"
  5857. then
  5858. AC_MSG_ERROR([cryptonly and opensslall are mutually incompatible.])
  5859. fi
  5860. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_ONLY"
  5861. fi
  5862. if test "x$ENABLED_CRYPTONLY" = "xno"
  5863. then
  5864. if test "x$ENABLED_PSK" = "xno" && test "x$ENABLED_ASN" = "xno"
  5865. then
  5866. AC_MSG_ERROR([please enable psk if disabling asn.])
  5867. fi
  5868. if test "$ENABLED_AFALG" = "yes"
  5869. then
  5870. # for TLS connections the intermediate hash needs to store buffer
  5871. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_HASH_KEEP"
  5872. fi
  5873. if test "$ENABLED_DEVCRYPTO" = "yes"
  5874. then
  5875. # for TLS connections the intermediate hash needs to store buffer
  5876. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH_KEEP"
  5877. fi
  5878. fi
  5879. # Enable Examples, used to disable examples
  5880. if test "$ENABLED_LINUXKM" = "yes"
  5881. then
  5882. ENABLED_EXAMPLES_DEFAULT=no
  5883. else
  5884. ENABLED_EXAMPLES_DEFAULT=yes
  5885. fi
  5886. AC_ARG_ENABLE([examples],
  5887. [AS_HELP_STRING([--enable-examples],[Enable Examples (default: enabled)])],
  5888. [ ENABLED_EXAMPLES=$enableval ],
  5889. [ ENABLED_EXAMPLES=$ENABLED_EXAMPLES_DEFAULT ]
  5890. )
  5891. AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"])
  5892. AS_IF([test "x$ENABLED_CRYPTONLY" = "xyes"], [ENABLED_EXAMPLES="no"])
  5893. # Enable wolfCrypt test and benchmark
  5894. if test "$ENABLED_LINUXKM" = "yes"
  5895. then
  5896. ENABLED_CRYPT_TESTS_DEFAULT=no
  5897. else
  5898. ENABLED_CRYPT_TESTS_DEFAULT=yes
  5899. fi
  5900. AC_ARG_ENABLE([crypttests],
  5901. [AS_HELP_STRING([--enable-crypttests],[Enable Crypt Bench/Test (default: enabled)])],
  5902. [ ENABLED_CRYPT_TESTS=$enableval ],
  5903. [ ENABLED_CRYPT_TESTS=$ENABLED_CRYPT_TESTS_DEFAULT ]
  5904. )
  5905. AC_SUBST([ENABLED_CRYPT_TESTS])
  5906. # Build wolfCrypt test and benchmark as libraries. This will compile test.c and
  5907. # benchmark.c and make their functions available via libraries, libwolfcrypttest
  5908. # and libwolfcryptbench, respectively. Note that this feature is not enabled by
  5909. # default, and the API of these libraries should NOT be treated as stable.
  5910. AC_ARG_ENABLE([crypttests-libs],
  5911. [AS_HELP_STRING([--enable-crypttests-libs],[Enable wolfcrypt test and benchmark libraries (default: disabled)])],
  5912. [ ENABLED_CRYPT_TESTS_LIBS=$enableval ],
  5913. [ ENABLED_CRYPT_TESTS_LIBS=no ]
  5914. )
  5915. # LIBZ
  5916. ENABLED_LIBZ="no"
  5917. trylibzdir=""
  5918. AC_ARG_WITH([libz],
  5919. [ --with-libz=PATH PATH to libz install (default /usr/) ],
  5920. [
  5921. AC_MSG_CHECKING([for libz])
  5922. CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
  5923. LIBS="$LIBS -lz"
  5924. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  5925. if test "x$libz_linked" = "xno" ; then
  5926. if test "x$withval" != "xno" ; then
  5927. trylibzdir=$withval
  5928. fi
  5929. if test "x$withval" = "xyes" ; then
  5930. trylibzdir="/usr"
  5931. fi
  5932. LDFLAGS="$LDFLAGS -L$trylibzdir/lib"
  5933. CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
  5934. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  5935. if test "x$libz_linked" = "xno" ; then
  5936. AC_MSG_ERROR([libz isn't found.
  5937. If it's already installed, specify its path using --with-libz=/dir/])
  5938. fi
  5939. AC_MSG_RESULT([yes])
  5940. else
  5941. AC_MSG_RESULT([yes])
  5942. fi
  5943. ENABLED_LIBZ="yes"
  5944. ]
  5945. )
  5946. # PKCS#11
  5947. AC_ARG_ENABLE([pkcs11],
  5948. [AS_HELP_STRING([--enable-pkcs11],[Enable pkcs11 access (default: disabled)])],
  5949. [ ENABLED_PKCS11=$enableval ],
  5950. [ ENABLED_PKCS11=no ]
  5951. )
  5952. if test "x$ENABLED_PKCS11" != "xno"
  5953. then
  5954. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS11 -DHAVE_WOLF_BIGINT"
  5955. if test "x$ENABLED_PKCS11" != "xstatic"
  5956. then
  5957. LIBS="$LIBS -ldl"
  5958. else
  5959. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS11_STATIC"
  5960. ENABLED_PKCS11="yes"
  5961. fi
  5962. fi
  5963. # PKCS#8
  5964. AC_ARG_ENABLE([pkcs8],
  5965. [AS_HELP_STRING([--enable-pkcs8],[Enable PKCS #8 key packages (default: enabled)])],
  5966. [ ENABLED_PKCS8=$enableval ],
  5967. [ ENABLED_PKCS8=yes ]
  5968. )
  5969. if test "x$ENABLED_PKCS8" = "xno"
  5970. then
  5971. AM_CFLAGS="$AM_CFLAGS -DNO_PKCS8"
  5972. fi
  5973. # cavium
  5974. trycaviumdir=""
  5975. AC_ARG_WITH([cavium],
  5976. [ --with-cavium=PATH PATH to cavium/software dir ],
  5977. [
  5978. AC_MSG_CHECKING([for cavium])
  5979. LIB_ADD="-lrt $LIB_ADD"
  5980. if test "x$withval" = "xyes" ; then
  5981. AC_MSG_ERROR([need a PATH for --with-cavium])
  5982. fi
  5983. if test "x$withval" != "xno" ; then
  5984. trycaviumdir=$withval
  5985. fi
  5986. CPPFLAGS="$AM_CPPFLAGS -DHAVE_CAVIUM -I$trycaviumdir/include"
  5987. LDFLAGS="$AM_LDFLAGS $trycaviumdir/api/cavium_common.o"
  5988. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cavium_common.h"]], [[ CspShutdown(CAVIUM_DEV_ID); ]])],[ cavium_linked=yes ],[ cavium_linked=no ])
  5989. if test "x$cavium_linked" = "xno" ; then
  5990. AC_MSG_ERROR([cavium isn't found.
  5991. If it's already installed, specify its path using --with-cavium=/dir/])
  5992. else
  5993. AM_CPPFLAGS="$CPPFLAGS"
  5994. AM_LDFLAGS="$LDFLAGS"
  5995. fi
  5996. AC_MSG_RESULT([yes])
  5997. enable_shared=no
  5998. enable_static=yes
  5999. ENABLED_CAVIUM=yes
  6000. ],
  6001. [ ENABLED_CAVIUM=no ]
  6002. )
  6003. # cavium V
  6004. trycaviumdir=""
  6005. AC_ARG_WITH([cavium-v],
  6006. [ --with-cavium-v=PATH PATH to Cavium V/software dir ],
  6007. [
  6008. AC_MSG_CHECKING([for cavium])
  6009. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM -DHAVE_CAVIUM_V"
  6010. LIB_ADD="-lrt -lcrypto $LIB_ADD"
  6011. if test "x$withval" = "xyes" ; then
  6012. AC_MSG_ERROR([need a PATH for --with-cavium])
  6013. fi
  6014. if test "x$withval" != "xno" ; then
  6015. trycaviumdir=$withval
  6016. fi
  6017. if test -e $trycaviumdir/lib/libnitrox.a
  6018. then
  6019. AM_CPPFLAGS="-I$trycaviumdir/include $AM_CPPFLAGS"
  6020. else
  6021. ENABLED_CAVIUM_V=no
  6022. fi
  6023. LIB_STATIC_ADD="$trycaviumdir/lib/libnitrox.a $LIB_STATIC_ADD"
  6024. if test "$ENABLED_CAVIUM_V" = "no"; then
  6025. AC_MSG_ERROR([Could not find Nitrox library])
  6026. fi
  6027. enable_shared=no
  6028. enable_static=yes
  6029. enable_opensslextra=yes
  6030. ENABLED_CAVIUM=yes
  6031. ENABLED_CAVIUM_V=yes
  6032. ],
  6033. [
  6034. ENABLED_CAVIUM=no
  6035. ENABLED_CAVIUM_V=no
  6036. ]
  6037. )
  6038. # Cavium Octeon
  6039. OCTEON_ROOT=""
  6040. : ${OCTEON_OBJ="obj-octeon2"}
  6041. : ${OCTEON_HOST="standalone"}
  6042. AC_ARG_WITH([octeon-sync],
  6043. [AS_HELP_STRING([--with-octeon-sync=PATH],[PATH to Cavium Octeon SDK dir (sync)])],
  6044. [
  6045. AC_MSG_CHECKING([for octeon])
  6046. if test "x$withval" = "xyes" ; then
  6047. AC_MSG_ERROR([need a PATH for --with-octeon])
  6048. fi
  6049. if test "x$withval" != "xno" ; then
  6050. OCTEON_ROOT=$withval
  6051. fi
  6052. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM_OCTEON_SYNC"
  6053. AM_CFLAGS="$AM_CFLAGS -DOCTEON_MODEL=$OCTEON_MODEL"
  6054. AM_CFLAGS="$AM_CFLAGS -I$OCTEON_ROOT/executive"
  6055. AS_CASE([$OCTEON_HOST],['linux'],[AM_CFLAGS="$AM_CFLAGS -DCVMX_BUILD_FOR_LINUX_HOST"])
  6056. #-I$OCTEON_ROOT/target/include
  6057. AM_LDFLAGS="$AM_LDFLAGS -lrt -Xlinker -T -Xlinker $OCTEON_ROOT/executive/cvmx-shared-linux.ld"
  6058. AM_LDFLAGS="$AM_LDFLAGS -L$OCTEON_ROOT/executive/$OCTEON_OBJ -lcvmx -lfdt"
  6059. enable_shared=no
  6060. enable_static=yes
  6061. ENABLED_OCTEON_SYNC=yes
  6062. AC_MSG_RESULT([yes])
  6063. ],
  6064. [ENABLED_OCTEON_SYNC=no]
  6065. )
  6066. # Intel QuickAssist
  6067. QAT_DIR=""
  6068. BUILD_INTEL_QAT_VERSION=2
  6069. AC_ARG_WITH([intelqa],
  6070. [AS_HELP_STRING([--with-intelqa=PATH],[PATH to Intel QuickAssist (QAT) driver dir])],
  6071. [ENABLED_INTEL_QA=yes; QAT_DIR=$withval],
  6072. [ENABLED_INTEL_QA=no])
  6073. AC_ARG_WITH([intelqa-sync],
  6074. [AS_HELP_STRING([--with-intelqa-sync=PATH],[PATH to Intel QuickAssist (QAT) driver dir (sync)])],
  6075. [ENABLED_INTEL_QA_SYNC=yes; QAT_DIR=$withval],
  6076. [ENABLED_INTEL_QA_SYNC=no])
  6077. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes" && test "x$ENABLED_INTEL_QA_SYNC" = "xyes"],
  6078. [AC_MSG_ERROR([Both Intel QA Async and Sync are selected, only select one.])])
  6079. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes" || test "x$ENABLED_INTEL_QA_SYNC" = "xyes"],
  6080. [AC_MSG_CHECKING([for intelqa])
  6081. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes"],
  6082. [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_INTEL_QA -DDO_CRYPTO -DUSER_SPACE"; intelqa_opt=""],
  6083. [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_INTEL_QA_SYNC -DQAT_USE_POLLING_THREAD -DO_CRYPTO -DUSER_SPACE"; intelqa_opt="-sync"])
  6084. OLD_LIBS="$LIBS"
  6085. OLD_CPPFLAGS="$CPPFLAGS"
  6086. AS_IF([test "x$QAT_DIR" = "xyes"],[AC_MSG_ERROR([need a PATH for --with-intelqa$intelqa_opt])])
  6087. QAT_FLAGS="-I$QAT_DIR/quickassist/include -I$QAT_DIR/quickassist/include/lac -I$QAT_DIR/quickassist/utilities/osal/include \
  6088. -I$QAT_DIR/quickassist/utilities/osal/src/linux/user_space/include -I$QAT_DIR/quickassist/lookaside/access_layer/include \
  6089. -I$QAT_DIR/quickassist/lookaside/access_layer/src/common/include -I$srcdir/wolfssl -I$srcdir/wolfssl/wolfcrypt/port/intel \
  6090. -I$QAT_DIR/quickassist/utilities/libusdm_drv"
  6091. AM_CPPFLAGS="$AM_CPPFLAGS $QAT_FLAGS"
  6092. CPPFLAGS="$AM_CPPFLAGS"
  6093. LDFLAGS="$LDFLAGS -L$QAT_DIR/build"
  6094. LIBS="$LIBS -lqat_s -lusdm_drv_s"
  6095. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cpa_cy_common.h"]],[[Cpa16U count = 0; cpaCyGetNumInstances(&count);]])],[intelqa_linked=yes],[intelqa_linked=no])
  6096. AS_IF([test "x$intelqa_linked" = "xno"],
  6097. [# Try old QAT driver libraries
  6098. LIBS="$OLD_LIBS -licp_qa_al_s"
  6099. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cpa_cy_common.h"]],[[Cpa16U count = 0; cpaCyGetNumInstances(&count);]])],[intelqa_linked=yes],[intelqa_linked=no])
  6100. AS_IF([test "x$intelqa_linked" = "xno"],
  6101. [AC_MSG_ERROR([Intel QuickAssist not found. If it's already installed, specify its path using --with-intelqa$intelqa_opt=/dir/])],
  6102. [BUILD_INTEL_QAT_VERSION=1])
  6103. ])
  6104. AC_MSG_RESULT([yes])
  6105. AS_IF([test "x$BUILD_INTEL_QAT_VERSION" = "x1"],
  6106. [LIB_ADD="-ladf_proxy -losal -lrt $LIB_ADD"],
  6107. [LIB_ADD="-losal -lrt $LIB_ADD"])
  6108. CPPFLAGS="$OLD_CPPFLAGS"
  6109. ])
  6110. ################################################################################
  6111. # Single Precision option handling #
  6112. ################################################################################
  6113. ENABLED_SP_RSA=no
  6114. ENABLED_SP_DH=no
  6115. ENABLED_SP_FF_2048=no
  6116. ENABLED_SP_FF_3072=no
  6117. ENABLED_SP_FF_4096=no
  6118. ENABLED_SP_ECC=no
  6119. ENABLED_SP_EC_256=no
  6120. ENABLED_SP_EC_384=no
  6121. ENABLED_SP_EC_521=no
  6122. ENABLED_SP_SAKKE_1024=$ENABLED_SAKKE
  6123. ENABLED_SP_NO_MALLOC=no
  6124. ENABLED_SP_NONBLOCK=no
  6125. ENABLED_SP_SMALL=no
  6126. for v in `echo $ENABLED_SP | tr "," " "`
  6127. do
  6128. case $v in
  6129. small)
  6130. ENABLED_SP_SMALL=yes
  6131. ENABLED_SP_RSA=yes
  6132. ENABLED_SP_DH=yes
  6133. ENABLED_SP_FF_2048=yes
  6134. ENABLED_SP_FF_3072=yes
  6135. ENABLED_SP_ECC=yes
  6136. ENABLED_SP_EC_256=yes
  6137. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"; then
  6138. ENABLED_SP_FF_4096=yes
  6139. ENABLED_SP_EC_384=yes
  6140. ENABLED_SP_EC_521=yes
  6141. fi
  6142. ;;
  6143. smallfast)
  6144. ENABLED_SP_SMALL=yes
  6145. ENABLED_SP_RSA=yes
  6146. ENABLED_SP_DH=yes
  6147. ENABLED_SP_FF_2048=yes
  6148. ENABLED_SP_FF_3072=yes
  6149. ENABLED_SP_ECC=yes
  6150. ENABLED_SP_EC_256=yes
  6151. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"; then
  6152. ENABLED_SP_FF_4096=yes
  6153. ENABLED_SP_EC_384=yes
  6154. ENABLED_SP_EC_521=yes
  6155. fi
  6156. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_FAST_MODEXP"
  6157. ;;
  6158. yes)
  6159. ENABLED_SP_RSA=yes
  6160. ENABLED_SP_DH=yes
  6161. ENABLED_SP_FF_2048=yes
  6162. ENABLED_SP_FF_3072=yes
  6163. ENABLED_SP_ECC=yes
  6164. ENABLED_SP_EC_256=yes
  6165. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64" || test "$host_cpu" = "amd64"; then
  6166. ENABLED_SP_FF_4096=yes
  6167. ENABLED_SP_EC_384=yes
  6168. ENABLED_SP_EC_521=yes
  6169. fi
  6170. ;;
  6171. no)
  6172. ;;
  6173. smallec256 | smallp256 | small256)
  6174. ENABLED_SP_SMALL=yes
  6175. ENABLED_SP_ECC=yes
  6176. ENABLED_SP_EC_256=yes
  6177. ;;
  6178. ec256 | p256 | 256)
  6179. ENABLED_SP_ECC=yes
  6180. ENABLED_SP_EC_256=yes
  6181. ;;
  6182. smallec384 | smallp384 | small384)
  6183. ENABLED_SP_SMALL=yes
  6184. ENABLED_SP_ECC=yes
  6185. ENABLED_SP_EC_384=yes
  6186. ;;
  6187. ec384 | p384 | 384)
  6188. ENABLED_SP_ECC=yes
  6189. ENABLED_SP_EC_384=yes
  6190. ;;
  6191. smallec521 | smallp521 | small521)
  6192. ENABLED_SP_SMALL=yes
  6193. ENABLED_SP_ECC=yes
  6194. ENABLED_SP_EC_521=yes
  6195. ;;
  6196. ec521 | p521 | 521)
  6197. ENABLED_SP_ECC=yes
  6198. ENABLED_SP_EC_521=yes
  6199. ;;
  6200. smallec1024 | smallp1024 | small1024)
  6201. ENABLED_SP_ECC=yes
  6202. ENABLED_SP_SMALL=yes
  6203. ENABLED_SP_SAKKE_1024=yes
  6204. ;;
  6205. ec1024 | p1024 | 1024)
  6206. ENABLED_SP_ECC=yes
  6207. ENABLED_SP_SAKKE_1024=yes
  6208. ;;
  6209. small2048)
  6210. ENABLED_SP_SMALL=yes
  6211. ENABLED_SP_RSA=yes
  6212. ENABLED_SP_DH=yes
  6213. ENABLED_SP_FF_2048=yes
  6214. ;;
  6215. 2048)
  6216. ENABLED_SP_RSA=yes
  6217. ENABLED_SP_DH=yes
  6218. ENABLED_SP_FF_2048=yes
  6219. ;;
  6220. smallrsa2048)
  6221. ENABLED_SP_SMALL=yes
  6222. ENABLED_SP_RSA=yes
  6223. ENABLED_SP_FF_2048=yes
  6224. ;;
  6225. rsa2048)
  6226. ENABLED_SP_RSA=yes
  6227. ENABLED_SP_FF_2048=yes
  6228. ;;
  6229. small3072)
  6230. ENABLED_SP_SMALL=yes
  6231. ENABLED_SP_RSA=yes
  6232. ENABLED_SP_DH=yes
  6233. ENABLED_SP_FF_3072=yes
  6234. ;;
  6235. 3072)
  6236. ENABLED_SP_RSA=yes
  6237. ENABLED_SP_DH=yes
  6238. ENABLED_SP_FF_3072=yes
  6239. ;;
  6240. smallrsa3072)
  6241. ENABLED_SP_SMALL=yes
  6242. ENABLED_SP_RSA=yes
  6243. ENABLED_SP_FF_3072=yes
  6244. ;;
  6245. rsa3072)
  6246. ENABLED_SP_RSA=yes
  6247. ENABLED_SP_FF_3072=yes
  6248. ;;
  6249. small4096)
  6250. ENABLED_SP_SMALL=yes
  6251. ENABLED_SP_RSA=yes
  6252. ENABLED_SP_DH=yes
  6253. ENABLED_SP_FF_4096=yes
  6254. ;;
  6255. 4096 | +4096)
  6256. ENABLED_SP_RSA=yes
  6257. ENABLED_SP_DH=yes
  6258. ENABLED_SP_FF_4096=yes
  6259. ;;
  6260. smallrsa4096)
  6261. ENABLED_SP_SMALL=yes
  6262. ENABLED_SP_RSA=yes
  6263. ENABLED_SP_FF_4096=yes
  6264. ;;
  6265. rsa4096)
  6266. ENABLED_SP_RSA=yes
  6267. ENABLED_SP_FF_4096=yes
  6268. ;;
  6269. smallstack)
  6270. ENABLED_SP_SMALL_STACK=yes
  6271. ;;
  6272. nomalloc)
  6273. ENABLED_SP_NO_MALLOC=yes
  6274. ;;
  6275. nonblock)
  6276. # Requires small and no malloc
  6277. ENABLED_SP_NONBLOCK=yes
  6278. ENABLED_SP_NO_MALLOC=yes
  6279. ENABLED_SP_SMALL=yes
  6280. ;;
  6281. asm)
  6282. ENABLED_SP_ASM=yes
  6283. ;;
  6284. noasm)
  6285. ENABLED_SP_ASM=no
  6286. ;;
  6287. *)
  6288. AC_MSG_ERROR([Invalid choice of Single Precision length in bits [256, 384, 521, 1024, 2048, 3072, 4096]: $ENABLED_SP.])
  6289. break;;
  6290. esac
  6291. done
  6292. ENABLED_SP_LINE="$ENABLE_SP"
  6293. ENABLED_SP=no
  6294. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_SP_RSA" = "yes"; then
  6295. ENABLED_SP=yes
  6296. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_RSA"
  6297. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_RSA"
  6298. fi
  6299. if test "$ENABLED_DH" != "no" && test "$ENABLED_SP_DH" = "yes"; then
  6300. ENABLED_SP=yes
  6301. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_DH"
  6302. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_DH"
  6303. fi
  6304. if test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes"; then
  6305. if test "$ENABLED_SP_FF_2048" = "no"; then
  6306. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_2048"
  6307. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_2048"
  6308. fi
  6309. if test "$ENABLED_SP_FF_3072" = "no"; then
  6310. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_3072"
  6311. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_3072"
  6312. fi
  6313. if test "$ENABLED_SP_FF_4096" = "yes"; then
  6314. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_4096"
  6315. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_4096"
  6316. fi
  6317. case $host_cpu in
  6318. *x86_64* | *aarch64* | *amd64*)
  6319. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_LARGE_CODE"
  6320. ;;
  6321. *)
  6322. ;;
  6323. esac
  6324. fi
  6325. if test "$ENABLED_ECC" != "no" && test "$ENABLED_SP_ECC" = "yes"; then
  6326. ENABLED_SP=yes
  6327. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_ECC"
  6328. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_ECC"
  6329. if test "$ENABLED_SP_EC_256" = "no"; then
  6330. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_256"
  6331. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_256"
  6332. fi
  6333. if test "$ENABLED_SP_EC_384" = "yes"; then
  6334. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC384 -DWOLFSSL_SP_384"
  6335. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_384"
  6336. fi
  6337. if test "$ENABLED_SP_EC_521" = "yes"; then
  6338. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC521 -DWOLFSSL_SP_521"
  6339. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_521"
  6340. fi
  6341. if test "$ENABLED_SP_SAKKE_1024" = "yes"; then
  6342. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_1024"
  6343. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_1024"
  6344. fi
  6345. fi
  6346. if test "$ENABLED_SP_SMALL" = "yes"; then
  6347. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_SMALL"
  6348. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_SMALL"
  6349. fi
  6350. if test "$ENABLED_SP_SMALL_STACK" = "yes"; then
  6351. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_SMALL_STACK"
  6352. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_SMALL_STACK"
  6353. fi
  6354. if test "$ENABLED_SP_NO_MALLOC" = "yes"; then
  6355. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_MALLOC"
  6356. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_MALLOC"
  6357. fi
  6358. if test "$ENABLED_SP_NONBLOCK" = "yes"; then
  6359. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NONBLOCK"
  6360. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NONBLOCK"
  6361. fi
  6362. if test "$ENABLED_SP_MATH" = "yes"; then
  6363. if test "$ENABLED_SP" = "no"; then
  6364. if test "$ENABLED_RSA" != "no"; then
  6365. AC_MSG_ERROR([Must have SP enabled with SP math for RSA: --enable-sp])
  6366. fi
  6367. if test "$ENABLED_DH" != "no"; then
  6368. AC_MSG_ERROR([Must have SP enabled with SP math for DH: --enable-sp])
  6369. fi
  6370. if test "$ENABLED_ECC" != "no"; then
  6371. AC_MSG_ERROR([Must have SP enabled with SP math for ECC: --enable-sp])
  6372. fi
  6373. fi
  6374. if test "$ENABLED_ECCCUSTCURVES" != "no"; then
  6375. AC_MSG_ERROR([Cannot use single precision math and custom curves])
  6376. fi
  6377. if test "$ENABLED_DSA" = "yes"; then
  6378. AC_MSG_ERROR([Cannot use single precision math and DSA])
  6379. fi
  6380. if test "$ENABLED_SRP" = "yes"; then
  6381. AC_MSG_ERROR([Cannot use single precision math and SRP])
  6382. fi
  6383. if test "$ENABLED_SP_RSA" = "no" && test "$ENABLED_RSA" = "yes"; then
  6384. AC_MSG_ERROR([Cannot use RSA single precision only math and RSA])
  6385. fi
  6386. if test "$ENABLED_SP_DH" = "no" && test "$ENABLED_DH" != "no"; then
  6387. AC_MSG_ERROR([Cannot use DH single precision only math and DH])
  6388. fi
  6389. fi
  6390. for v in `echo $ENABLED_SP_MATH_ALL | tr "," " "`
  6391. do
  6392. case $v in
  6393. yes | no)
  6394. ;;
  6395. small)
  6396. ENABLED_SP_MATH_ALL="yes"
  6397. ENABLED_SP_SMALL="yes"
  6398. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_SMALL"
  6399. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_SMALL"
  6400. ;;
  6401. huge)
  6402. ENABLED_SP_MATH_ALL="yes"
  6403. ENABLED_FASTHUGEMATH="yes"
  6404. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  6405. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_LARGE_COMBA"
  6406. ;;
  6407. 256 | 384 | 521 | 1024 | 2048 | 3072 | 4096)
  6408. if test -z "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS" -o "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS" -lt "$v"
  6409. then
  6410. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS="$v"
  6411. fi
  6412. ENABLED_SP_MATH_ALL="yes"
  6413. ;;
  6414. nomalloc)
  6415. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_MALLOC"
  6416. ENABLED_SP_MATH_ALL="yes"
  6417. ;;
  6418. neg)
  6419. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_NEGATIVE"
  6420. ENABLED_SP_MATH_ALL="yes"
  6421. ;;
  6422. *)
  6423. AC_MSG_ERROR([Support SP int bit sizes: 256, 384, 521, 1024, 2048, 3072, 4096. $ENABLED_SP_MATH_ALL not supported])
  6424. ;;
  6425. esac
  6426. done
  6427. AC_ARG_WITH([arm-target],
  6428. [AS_HELP_STRING([--with-arm-target=x],[x can be "thumb" or "cortex"])],
  6429. [ARM_TARGET="$withval"],
  6430. [ARM_TARGET=''])
  6431. if test "$ENABLED_SP_MATH_ALL" = "yes" && test "$ENABLED_ASM" != "no"; then
  6432. ENABLED_FASTMATH="no"
  6433. ENABLED_SLOWMATH="no"
  6434. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MATH_ALL"
  6435. case $host_cpu in
  6436. *x86_64* | *amd64*)
  6437. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64"
  6438. ;;
  6439. *x86*)
  6440. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86"
  6441. ;;
  6442. *aarch64*)
  6443. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM64 -DWOLFSSL_AARCH64_BUILD"
  6444. ;;
  6445. *arm*)
  6446. if test "$host_alias" = "thumb" || test "$ARM_TARGET" = "thumb"; then
  6447. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_THUMB"
  6448. else
  6449. if test "$host_alias" = "cortex" || test "$ARM_TARGET" = "cortex"; then
  6450. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_CORTEX_M"
  6451. else
  6452. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32"
  6453. fi
  6454. fi
  6455. ;;
  6456. *ppc64* | *powerpc64*)
  6457. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_PPC64"
  6458. ;;
  6459. *ppc* | *powerpc*)
  6460. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_PPC"
  6461. ;;
  6462. *mips64*)
  6463. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MIPS64"
  6464. ;;
  6465. *mips*)
  6466. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MIPS"
  6467. ;;
  6468. *riscv32*)
  6469. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_RISCV32"
  6470. ;;
  6471. *riscv64*)
  6472. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_RISCV64"
  6473. ;;
  6474. *s390x*)
  6475. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_S390X"
  6476. ;;
  6477. esac
  6478. if test "$ENABLED_FIPS" != "no" || test "$SELFTEST_VERSION" != "none"; then
  6479. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_NEGATIVE"
  6480. fi
  6481. fi
  6482. if test "$ENABLED_SP_ASM" = "yes" && test "$ENABLED_SP" = "yes"; then
  6483. if test "$ENABLED_SP_NONBLOCK" = "yes"; then
  6484. AC_MSG_ERROR([SP non-blocking not supported with sp-asm])
  6485. fi
  6486. if test "$ENABLED_ASM" = "no"; then
  6487. AC_MSG_ERROR([Assembly code turned off])
  6488. fi
  6489. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ASM"
  6490. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ASM"
  6491. case $host_cpu in
  6492. *aarch64*)
  6493. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM64_ASM"
  6494. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM64_ASM"
  6495. ENABLED_SP_ARM64_ASM=yes
  6496. ;;
  6497. *armv7a*)
  6498. if test "$ENABLED_ARMASM" = "no"; then
  6499. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-a -mfpu=neon -DWOLFSSL_ARM_ARCH=7 -marm"
  6500. fi
  6501. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6502. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6503. ENABLED_SP_ARM32_ASM=yes
  6504. ;;
  6505. *cortex* | *armv7m*)
  6506. if test "$ENABLED_ARMASM" = "no"; then
  6507. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv7-r -D__thumb__ -DWOLFSSL_ARM_ARCH=7"
  6508. fi
  6509. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM"
  6510. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM"
  6511. ENABLED_SP_ARM_CORTEX_ASM=yes
  6512. ;;
  6513. *armv6*)
  6514. if test "$ENABLED_ARMASM" = "no"; then
  6515. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv6 -DWOLFSSL_ARM_ARCH=6"
  6516. fi
  6517. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6518. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6519. ENABLED_SP_ARM32_ASM=yes
  6520. ;;
  6521. *armv4*)
  6522. if test "$ENABLED_ARMASM" = "no"; then
  6523. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv4 -DWOLFSSL_ARM_ARCH=4"
  6524. fi
  6525. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6526. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6527. ENABLED_SP_ARM32_ASM=yes
  6528. ;;
  6529. *arm*)
  6530. if test "$host_alias" = "thumb" || test "$ARM_TARGET" = "thumb"; then
  6531. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_THUMB_ASM"
  6532. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM_THUMB_ASM"
  6533. ENABLED_SP_ARM_THUMB_ASM=yes
  6534. else
  6535. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6536. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM32_ASM"
  6537. ENABLED_SP_ARM32_ASM=yes
  6538. fi
  6539. ;;
  6540. *x86_64* | *amd64*)
  6541. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64_ASM"
  6542. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_X86_64_ASM"
  6543. ENABLED_SP_X86_64_ASM=yes
  6544. ;;
  6545. *)
  6546. AC_MSG_ERROR([ASM not available for CPU. Supported CPUs: x86_64, aarch64, arm])
  6547. ;;
  6548. esac
  6549. fi
  6550. if test "$ENABLED_SP_MATH" = "yes"; then
  6551. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MATH"
  6552. fi
  6553. ################################################################################
  6554. # End - Single Precision option handling #
  6555. ################################################################################
  6556. # Fast RSA using Intel IPP
  6557. ippdir="${srcdir}/IPP"
  6558. ipplib="lib" # if autoconf guesses 32bit system changes lib directory
  6559. fastRSA_found=no
  6560. abs_path=`pwd`
  6561. # set up variables used
  6562. IPPLIBS=
  6563. IPPHEADERS=
  6564. IPPLINK=
  6565. AC_ARG_ENABLE([fast-rsa],
  6566. [AS_HELP_STRING([--enable-fast-rsa],[Enable RSA using Intel IPP (default: disabled)])],
  6567. [ ENABLED_FAST_RSA=$enableval ],
  6568. [ ENABLED_FAST_RSA=no ],
  6569. )
  6570. # Fast RSA does not support RSA-PSS
  6571. if test "$ENABLED_RSAPSS" = "yes"; then
  6572. ENABLED_FAST_RSA=no
  6573. fi
  6574. if test "$ENABLED_USER_RSA" = "no" && test "$ENABLED_FIPS" = "no"; then
  6575. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  6576. ipplib="lib_32" # 32 bit OS detected
  6577. fi
  6578. # Use static IPP Libraries
  6579. if test "$enable_shared" = "no" && test "$ENABLED_FAST_RSA" = "yes"; then
  6580. case $host_os in
  6581. *darwin*)
  6582. ipplib="$ipplib/mac_static"
  6583. AC_MSG_ERROR([Issue with static linking to libippcp.a on Mac.
  6584. Dynamic IPP libraries supported on Mac])
  6585. break;;
  6586. *linux*)
  6587. ipplib="$ipplib/linux_static"
  6588. break;;
  6589. *)
  6590. ENABLED_FAST_RSA=no
  6591. esac
  6592. if test -e $srcdir/IPP/$ipplib/libippcore.a && test -e $srcdir/IPP/$ipplib/libippcp.a
  6593. then
  6594. :
  6595. else
  6596. ENABLED_FAST_RSA=no
  6597. fi
  6598. AC_CHECK_HEADERS([IPP/include/ipp.h IPP/include/ippcp.h], [AM_CPPFLAGS="-I$srcdir/IPP/include $AM_CPPFLAGS"], [ENABLED_FAST_RSA=no])
  6599. LIB_STATIC_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a $LIB_STATIC_ADD"
  6600. if test "$ENABLED_FAST_RSA" = "no"; then
  6601. AC_MSG_ERROR([Could not find fast rsa libraries])
  6602. fi
  6603. else
  6604. # Check for and use bundled IPP libraries
  6605. if test "$ENABLED_FAST_RSA" = "yes"; then
  6606. AC_MSG_NOTICE([Using local IPP crypto library])
  6607. AC_CHECK_HEADER([$abs_path/IPP/include/ippcp.h],
  6608. [
  6609. # build and default locations on linux and mac
  6610. STORE_LDFLAGS=${LDFLAGS}
  6611. STORE_CPPFLAGS=${CPPFLAGS}
  6612. # using LDFLAGS instead of AM_ temporarily to test link to library
  6613. LDFLAGS="-L$ippdir/$ipplib -lippcp -lippcore"
  6614. CPPFLAGS="-I$ippdir/include"
  6615. AC_CHECK_HEADERS([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15], [fastRSA_found=yes], [fastRSA_found=no])], [fastRSA_found=no])
  6616. name="$ippdir/$ipplib/libippcp"
  6617. case $host_os in
  6618. *darwin*)
  6619. # check file existence and conditionally set variables
  6620. if test -e $abs_path/IPP/$ipplib/libippcp.dylib
  6621. then
  6622. IPPLIBS="${name}.dylib ${name}-9.0.dylib ${name}e9-9.0.dylib ${name}g9-9.0.dylib ${name}h9-9.0.dylib ${name}k0-9.0.dylib ${name}l9-9.0.dylib ${name}n8-9.0.dylib ${name}p8-9.0.dylib ${name}s8-9.0.dylib ${name}y8-9.0.dylib IPP/lib/libippcore.dylib IPP/lib/libippcore-9.0.dylib"
  6623. IPPLINK="mkdir -p src/.libs && ln -f ${name}.dylib src/.libs/libippcp.dylib && ln -f ${srcdir}/${name}-9.0.dylib src/.libs/libippcp-9.0.dylib && ln -f ${srcdir}/${name}e9-9.0.dylib src/.libs/libippcpe9-9.0.dylib && ln -f ${srcdir}/${name}g9-9.0.dylib src/.libs/libippcpg9-9.0.dylib && ln -f ${srcdir}/${name}h9-9.0.dylib src/.libs/libippcph9-9.0.dylib && ln -f ${srcdir}/${name}k0-9.0.dylib src/.libs/libippcpk0-9.0.dylib && ln -f ${srcdir}/${name}l9-9.0.dylib src/.libs/libippcpl9-9.0.dylib && ln -f ${srcdir}/${name}n8-9.0.dylib src/.libs/libippcpn8-9.0.dylib && ln -f ${srcdir}/${name}p8-9.0.dylib src/.libs/libippcpp8-9.0.dylib && ln -f ${srcdir}/${name}s8-9.0.dylib src/.libs/libippcps8-9.0.dylib && ln -f ${srcdir}/${name}y8-9.0.dylib src/.libs/libippcpy8-9.0.dylib && ln -f ${srcdir}/IPP/lib/libippcore.dylib src/.libs/libippcore.dylib && ln -f ${srcdir}/IPP/lib/libippcore-9.0.dylib src/.libs/libippcore-9.0.dylib"
  6624. else
  6625. fastRSA_found=no
  6626. fi
  6627. break;;
  6628. *linux*)
  6629. # check file existence and conditionally set variables
  6630. if test -e $abs_path/IPP/$ipplib/libippcp.so.9.0
  6631. then
  6632. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  6633. IPPLIBS="${name}.so.9.0 ${name}g9.so.9.0 ${name}h9.so.9.0 ${name}p8.so.9.0 ${name}px.so.9.0 ${name}s8.so.9.0 ${name}.so ${name}w7.so.9.0 IPP/$ipplib/libippcore.so IPP/$ipplib/libippcore.so.9.0"
  6634. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}g9.so.9.0 src/.libs/libippcpg9.so.9.0 && ln -f ${name}h9.so.9.0 src/.libs/libippcph9.so.9.0 && ln -f ${name}p8.so.9.0 src/.libs/libippcpp8.so.9.0 && ln -f ${name}px.so.9.0 src/.libs/libippcppx.so.9.0 && ln -f ${name}s8.so.9.0 src/.libs/libippcps8.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}w7.so.9.0 src/.libs/libippcpw7.so.9.0 && ln -f IPP/$ipplib/libippcore.so src/.libs/libippcore.so && ln -f IPP/$ipplib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  6635. else
  6636. IPPLIBS="${name}.so.9.0 ${name}e9.so.9.0 ${name}k0.so.9.0 ${name}l9.so.9.0 ${name}m7.so.9.0 ${name}mx.so.9.0 ${name}.so ${name}n8.so.9.0 ${name}y8.so.9.0 IPP/lib/libippcore.so IPP/lib/libippcore.so.9.0"
  6637. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}e9.so.9.0 src/.libs/libippcpe9.so.9.0 && ln -f ${name}k0.so.9.0 src/.libs/libippcpk0.so.9.0 && ln -f ${name}l9.so.9.0 src/.libs/libippcpl9.so.9.0 && ln -f ${name}m7.so.9.0 src/.libs/libippcpm7.so.9.0 && ln -f ${name}mx.so.9.0 src/.libs/libippcpmx.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}n8.so.9.0 src/.libs/libippcpn8.so.9.0 && ln -f ${name}y8.so.9.0 src/.libs/libippcpy8.so.9.0 && ln -f IPP/lib/libippcore.so src/.libs/libippcore.so && ln -f IPP/lib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  6638. fi
  6639. else
  6640. fastRSA_found=no
  6641. fi
  6642. break;;
  6643. *)
  6644. fastRSA_found=no
  6645. esac
  6646. if test "$fastRSA_found" = "yes"; then
  6647. # was successful so add tested LDFLAGS to AM_ flags
  6648. AM_LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}"
  6649. AM_CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}"
  6650. IPPHEADERS="${srcdir}/IPP/include/*.h"
  6651. fi
  6652. # restore LDFLAGS to user set
  6653. LDFLAGS=${STORE_LDFLAGS}
  6654. CPPFLAGS=${STORE_CPPFLAGS}
  6655. ], [fastRSA_found=no])
  6656. fi
  6657. # Don't cache the result so it can be checked
  6658. AS_UNSET([ac_cv_header_ippcp_h])
  6659. AS_UNSET([ac_cv_header_ipp_h])
  6660. AS_UNSET([ac_cv_lib_ippcp_ippsRSAEncrypt_PKCSv15]);
  6661. # Check link and see if user has pre-existing IPP Libraries if not using local
  6662. if test "$ENABLED_FAST_RSA" = "yes" && test "$fastRSA_found" = "no"; then
  6663. AC_MSG_NOTICE([Checking if IPP crypto library installed])
  6664. AC_CHECK_HEADER([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15],
  6665. [
  6666. fastRSA_found=yes
  6667. AM_LDFLAGS="${AM_LDFLAGS} -lippcore -lippcp"
  6668. ], [ fastRSA_found=no])
  6669. ], [fastRSA_found=no])
  6670. # Error out on not finding libraries
  6671. if test "$fastRSA_found" = "no"; then
  6672. AC_MSG_ERROR([Could not find fast rsa libraries])
  6673. fi
  6674. fi
  6675. fi # end of if for shared library
  6676. else # if user rsa is set than do not use fast rsa option
  6677. if test "$ENABLED_FAST_RSA" = "yes"; then
  6678. AC_MSG_ERROR([Could not use fast rsa libraries with user crypto or fips])
  6679. fi
  6680. fi # end of if for user rsa crypto or fips
  6681. # End result of checking for IPP Libraries
  6682. AC_MSG_CHECKING([for fast RSA])
  6683. if test "$ENABLED_FAST_RSA" = "yes"; then
  6684. AM_CFLAGS="$AM_CFLAGS -DHAVE_FAST_RSA -DHAVE_USER_RSA"
  6685. # add in user crypto header that uses Intel IPP
  6686. AM_CPPFLAGS="$AM_CPPFLAGS -I$srcdir/wolfcrypt/user-crypto/include"
  6687. if test "$enable_shared" = "yes"; then
  6688. LIBS="$LIBS -lippcore -lippcp"
  6689. LIB_ADD="-lippcp -lippcore $LIB_ADD"
  6690. else
  6691. LIB_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a $LIB_ADD"
  6692. fi
  6693. AC_MSG_RESULT([yes])
  6694. else
  6695. AC_MSG_RESULT([no])
  6696. fi
  6697. AC_SUBST([IPPLIBS])
  6698. AC_SUBST([IPPHEADERS])
  6699. AC_SUBST([IPPLINK])
  6700. # static memory use
  6701. AC_ARG_ENABLE([staticmemory],
  6702. [AS_HELP_STRING([--enable-staticmemory],[Enable static memory use (default: disabled)])],
  6703. [ ENABLED_STATICMEMORY=$enableval ],
  6704. [ ENABLED_STATICMEMORY=no ]
  6705. )
  6706. if test "x$ENABLED_STATICMEMORY" = "xyes"
  6707. then
  6708. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_MEMORY"
  6709. if test "x$ENABLED_HEAPMATH" = "xyes"
  6710. then
  6711. AC_MSG_ERROR([please use --enable-fastmath if enabling staticmemory.])
  6712. fi
  6713. if test "$ENABLED_LOWRESOURCE" = "yes" && test "$ENABLED_RSA" = "no"
  6714. then
  6715. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_MEMORY_SMALL"
  6716. fi
  6717. fi
  6718. # microchip api
  6719. AC_ARG_ENABLE([mcapi],
  6720. [AS_HELP_STRING([--enable-mcapi],[Enable Microchip API (default: disabled)])],
  6721. [ ENABLED_MCAPI=$enableval ],
  6722. [ ENABLED_MCAPI=no ]
  6723. )
  6724. if test "$ENABLED_MCAPI" = "yes"
  6725. then
  6726. AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI"
  6727. if test "x$ENABLED_AESCTR" != "xyes"
  6728. then
  6729. # These flags are already implied by --enable-aesctr
  6730. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"
  6731. fi
  6732. if test "x$ENABLED_AESGCM" != "xyes" && test "x$ENABLED_AESGCM" != "xno"
  6733. then
  6734. # Use the smaller object size implementation
  6735. ENABLED_AESGCM=yes
  6736. fi
  6737. fi
  6738. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_SHA512" = "no"
  6739. then
  6740. AC_MSG_ERROR([please enable sha512 if enabling mcapi.])
  6741. fi
  6742. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_ECC" = "no"
  6743. then
  6744. AC_MSG_ERROR([please enable ecc if enabling mcapi.])
  6745. fi
  6746. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_LIBZ" = "no"
  6747. then
  6748. AC_MSG_ERROR([please use --with-libz if enabling mcapi.])
  6749. fi
  6750. # cryptodev is old name, replaced with cryptocb
  6751. AC_ARG_ENABLE([cryptodev],
  6752. [AS_HELP_STRING([--enable-cryptodev],[DEPRECATED, use cryptocb instead])],
  6753. [ ENABLED_CRYPTOCB=$enableval ],[ ENABLED_CRYPTOCB=no ])
  6754. # Support for crypto callbacks
  6755. AC_ARG_ENABLE([cryptocb],
  6756. [AS_HELP_STRING([--enable-cryptocb],[Enable crypto callbacks (default: disabled)])],
  6757. [ ENABLED_CRYPTOCB=$enableval ],
  6758. [ ENABLED_CRYPTOCB=no ]
  6759. )
  6760. if test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_WOLFTPM" = "xyes" || test "$ENABLED_CAAM" != "no"
  6761. then
  6762. ENABLED_CRYPTOCB=yes
  6763. fi
  6764. if test "$ENABLED_CRYPTOCB" = "yes"
  6765. then
  6766. AM_CFLAGS="$AM_CFLAGS -DWOLF_CRYPTO_CB"
  6767. fi
  6768. # Asynchronous Crypto
  6769. AC_ARG_ENABLE([asynccrypt],
  6770. [AS_HELP_STRING([--enable-asynccrypt],[Enable Asynchronous Crypto (default: disabled)])],
  6771. [ ENABLED_ASYNCCRYPT=$enableval ],
  6772. [ ENABLED_ASYNCCRYPT=no ]
  6773. )
  6774. # Asynchronous crypto using software (i.e. not hardware). Required for
  6775. # non-blocking crypto with TLS/DTLS.
  6776. AC_ARG_ENABLE([asynccrypt-sw],
  6777. [AS_HELP_STRING([--enable-asynccrypt-sw],[Enable asynchronous software-based crypto (default: disabled)])],
  6778. [ ENABLED_ASYNCCRYPT_SW=$enableval ],
  6779. [ ENABLED_ASYNCCRYPT_SW=no ]
  6780. )
  6781. if test "$ENABLED_ASYNCCRYPT_SW" = "yes"
  6782. then
  6783. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT_SW"
  6784. ENABLED_ASYNCCRYPT=yes
  6785. fi
  6786. if test "$ENABLED_ASYNCCRYPT" = "yes"
  6787. then
  6788. AC_MSG_NOTICE([Enabling asynchronous support])
  6789. if ! test -f ${srcdir}/wolfcrypt/src/async.c || ! test -f ${srcdir}/wolfssl/wolfcrypt/async.h
  6790. then
  6791. AC_MSG_ERROR([--enable-asynccrypt requested, but WOLFSSL_ASYNC_CRYPT source files are missing.])
  6792. fi
  6793. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT -DHAVE_WOLF_EVENT -DHAVE_WOLF_BIGINT -DWOLFSSL_NO_HASH_RAW"
  6794. # If no async backend (hardware or software) has been explicitly enabled,
  6795. # use the software backend for testing.
  6796. if test "x$ENABLED_CAVIUM" != "xyes" && test "x$ENABLED_INTEL_QA" != "xyes" && test "x$ENABLED_CRYPTOCB" != "xyes" && test "x$ENABLED_PKCALLBACKS" != "xyes" && test "x$ENABLED_ASYNCCRYPT_SW" != "xyes"
  6797. then
  6798. AC_MSG_NOTICE([Enabling asynchronous software simulator])
  6799. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT_SW"
  6800. ENABLED_ASYNCCRYPT_SW=yes
  6801. fi
  6802. fi
  6803. # check for async if using Intel QuckAssist or Cavium
  6804. if test "x$ENABLED_INTEL_QA" = "xyes" || test "x$ENABLED_CAVIUM" = "xyes" ; then
  6805. if test "x$ENABLED_ASYNCCRYPT" = "xno" ; then
  6806. AC_MSG_ERROR([Please enable asynchronous support using --enable-asynccrypt])
  6807. fi
  6808. fi
  6809. # Asynchronous threading (Linux specific)
  6810. AC_ARG_ENABLE([asyncthreads],
  6811. [AS_HELP_STRING([--enable-asyncthreads],[Enable Asynchronous Threading (default: enabled)])],
  6812. [ ENABLED_ASYNCTHREADS=$enableval ],
  6813. [ ENABLED_ASYNCTHREADS=yes ]
  6814. )
  6815. if test "$ENABLED_ASYNCCRYPT" = "yes" && test "$ENABLED_ASYNCTHREADS" = "yes"
  6816. then
  6817. AX_PTHREAD([ENABLED_ASYNCTHREADS=yes],[ENABLED_ASYNCTHREADS=no])
  6818. else
  6819. ENABLED_ASYNCTHREADS=no
  6820. fi
  6821. if test "$ENABLED_ASYNCTHREADS" = "yes"
  6822. then
  6823. LIB_ADD="-lpthread $LIB_ADD"
  6824. AM_CFLAGS="$AM_CFLAGS -D_GNU_SOURCE"
  6825. else
  6826. AM_CFLAGS="$AM_CFLAGS -DWC_NO_ASYNC_THREADING"
  6827. fi
  6828. # Session Export
  6829. AC_ARG_ENABLE([sessionexport],
  6830. [AS_HELP_STRING([--enable-sessionexport],[Enable export and import of sessions (default: disabled)])],
  6831. [ ENABLED_SESSIONEXPORT=$enableval ],
  6832. [ ENABLED_SESSIONEXPORT=no ]
  6833. )
  6834. if test "$ENABLED_SESSIONEXPORT" = "yes" ||
  6835. test "$ENABLED_SESSIONEXPORT" = "nopeer"
  6836. then
  6837. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SESSION_EXPORT"
  6838. if test "$ENABLED_SESSIONEXPORT" = "nopeer"
  6839. then
  6840. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SESSION_EXPORT_NOPEER"
  6841. fi
  6842. fi
  6843. # AES key wrap
  6844. AC_ARG_ENABLE([aeskeywrap],
  6845. [AS_HELP_STRING([--enable-aeskeywrap],[Enable AES key wrap support (default: disabled)])],
  6846. [ ENABLED_AESKEYWRAP=$enableval ],
  6847. [ ENABLED_AESKEYWRAP=no ]
  6848. )
  6849. if test "$ENABLED_WPAS" != "no" && test "$ENABLED_FIPS" = "no"
  6850. then
  6851. ENABLED_AESKEYWRAP="yes"
  6852. fi
  6853. if test "$ENABLED_AESKEYWRAP" = "yes"
  6854. then
  6855. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT"
  6856. fi
  6857. # Old name support for backwards compatibility
  6858. AC_ARG_ENABLE([oldnames],
  6859. [AS_HELP_STRING([--enable-oldnames],[Keep backwards compat with old names (default: enabled)])],
  6860. [ ENABLED_OLDNAMES=$enableval ],
  6861. [ ENABLED_OLDNAMES=yes ]
  6862. )
  6863. if test "x$ENABLED_OLDNAMES" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  6864. then
  6865. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_RNGNAME -DNO_OLD_WC_NAMES -DNO_OLD_SSL_NAMES"
  6866. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA_NAMES -DNO_OLD_MD5_NAME"
  6867. fi
  6868. # Memory Tests
  6869. AC_ARG_ENABLE([memtest],
  6870. [AS_HELP_STRING([--enable-memtest],[Memory testing option, for internal use (default: disabled)])],
  6871. [ ENABLED_MEMTEST=$enableval ],
  6872. [ ENABLED_MEMTEST=no ]
  6873. )
  6874. if test "x$ENABLED_MEMTEST" != "xno"
  6875. then
  6876. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"
  6877. fi
  6878. if test "x$ENABLED_MEMTEST" = "xfail"
  6879. then
  6880. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FORCE_MALLOC_FAIL_TEST"
  6881. fi
  6882. # Enable hash flags support
  6883. # Hash flags are useful for runtime options such as SHA3 KECCAK256 selection
  6884. AC_ARG_ENABLE([hashflags],
  6885. [AS_HELP_STRING([--enable-hashflags],[Enable support for hash flags (default: disabled)])],
  6886. [ ENABLED_HASHFLAGS=$enableval ],
  6887. [ ENABLED_HASHFLAGS=no ]
  6888. )
  6889. if test "x$ENABLED_HASHFLAGS" != "xno"
  6890. then
  6891. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HASH_FLAGS"
  6892. fi
  6893. # Support for enabling setting default DH parameters in TLS
  6894. AC_ARG_ENABLE([defaultdhparams],
  6895. [AS_HELP_STRING([--enable-defaultdhparams],[Enables option for default dh parameters (default: disabled)])],
  6896. [ ENABLED_DHDEFAULTPARAMS=$enableval ],
  6897. [ ENABLED_DHDEFAULTPARAMS=yes ]
  6898. )
  6899. if test "x$ENABLED_DH" = "xyes" && test "x$ENABLED_DHDEFAULTPARAMS" = "xyes" && test "x$ENABLED_QT" != "xyes"
  6900. then
  6901. ENABLED_DHDEFAULTPARAMS=yes
  6902. AM_CFLAGS="$AM_CFLAGS -DHAVE_DH_DEFAULT_PARAMS"
  6903. fi
  6904. AC_ARG_WITH([max-rsa-bits],
  6905. [AS_HELP_STRING([--with-max-rsa-bits=number],[number of bits to support for RSA, DH, and DSA keys])],
  6906. [WITH_MAX_CLASSIC_ASYM_KEY_BITS=$withval],
  6907. [WITH_MAX_CLASSIC_ASYM_KEY_BITS="$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS"])
  6908. if test -n "$WITH_MAX_CLASSIC_ASYM_KEY_BITS"; then
  6909. if test "$WITH_MAX_CLASSIC_ASYM_KEY_BITS" -lt 1024 -o "$WITH_MAX_CLASSIC_ASYM_KEY_BITS" -gt 16384; then
  6910. AC_MSG_ERROR([--with-max-rsa-bits argument must be between 1024 and 16384 inclusive])
  6911. fi
  6912. if test "$ENABLED_FIPS" = "no"
  6913. then
  6914. AM_CFLAGS="$AM_CFLAGS -DRSA_MAX_SIZE=$WITH_MAX_CLASSIC_ASYM_KEY_BITS"
  6915. fi
  6916. MPI_MAX_KEY_BITS=$WITH_MAX_CLASSIC_ASYM_KEY_BITS
  6917. fi
  6918. AC_ARG_WITH([max-ecc-bits],
  6919. [AS_HELP_STRING([--with-max-ecc-bits=number],[number of bits to support for ECC algorithms])],
  6920. [WITH_MAX_ECC_BITS=$withval],
  6921. [WITH_MAX_ECC_BITS="$DEFAULT_MAX_ECC_BITS"])
  6922. if test -n "$WITH_MAX_ECC_BITS"; then
  6923. if test "$WITH_MAX_ECC_BITS" -lt 112 -o "$WITH_MAX_ECC_BITS" -gt 1024; then
  6924. AC_MSG_ERROR([--with-max-ecc-bits argument must be between 112 and 1024 inclusive])
  6925. fi
  6926. AM_CFLAGS="$AM_CFLAGS -DMAX_ECC_BITS=$WITH_MAX_ECC_BITS"
  6927. fi
  6928. if test -n "$MPI_MAX_KEY_BITS" -o -n "$WITH_MAX_ECC_BITS"; then
  6929. if test -n "$MAX_MPI_KEY_BITS" -a -n "$WITH_MAX_ECC_BITS"; then
  6930. if test "$MAX_MPI_KEY_BITS" -lt "$WITH_MAX_ECC_BITS"; then
  6931. MPI_MAX_KEY_BITS="$WITH_MAX_ECC_BITS"
  6932. fi
  6933. elif test -n "$WITH_MAX_ECC_BITS"; then
  6934. MPI_MAX_KEY_BITS="$WITH_MAX_ECC_BITS"
  6935. fi
  6936. if test "$MPI_MAX_KEY_BITS" -gt 1024; then
  6937. AM_CFLAGS="$AM_CFLAGS -DFP_MAX_BITS=$((MPI_MAX_KEY_BITS * 2)) -DSP_INT_BITS=$MPI_MAX_KEY_BITS"
  6938. fi
  6939. fi
  6940. # Library Suffix
  6941. LIBSUFFIX=""
  6942. AC_ARG_WITH([libsuffix],
  6943. [AS_HELP_STRING([--with-libsuffix=SUFFIX],[Library artifact SUFFIX, ie libwolfsslSUFFIX.so])],
  6944. [
  6945. if test "x$withval" != "xno" ; then
  6946. LIBSUFFIX=$withval
  6947. fi
  6948. if test "x$withval" = "xyes" ; then
  6949. AC_MSG_ERROR([Invalid argument to --with-libsuffix, no suffix given])
  6950. fi
  6951. ]
  6952. )
  6953. AC_SUBST(LIBSUFFIX)
  6954. AC_ARG_ENABLE([context-extra-user-data],
  6955. [AS_HELP_STRING([--enable-context-extra-user-data],[Enables option for storing user-defined data in TLS API contexts, with optional argument the number of slots to allocate (default: disabled)])],
  6956. [ ENABLED_EX_DATA=$enableval ],
  6957. [ ENABLED_EX_DATA=no ]
  6958. )
  6959. case "$ENABLED_EX_DATA" in
  6960. no) ;;
  6961. yes) AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  6962. ;;
  6963. [[1-9]]|[[1-9]][[0-9]]) AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DMAX_EX_DATA=$ENABLED_EX_DATA"
  6964. ;;
  6965. *) AC_MSG_ERROR([Invalid argument to --enable-context-extra-user-data -- must be yes, no, or a number from 1 to 99])
  6966. ;;
  6967. esac
  6968. # IoT-Safe support
  6969. AC_ARG_ENABLE([iotsafe],
  6970. [AS_HELP_STRING([--enable-iotsafe],[Enables support for IoT-Safe secure applet (default: disabled)])],
  6971. [ ENABLED_IOTSAFE=$enableval ],
  6972. [ ENABLED_IOTSAFE=no ]
  6973. )
  6974. AC_ARG_ENABLE([iotsafe-hwrng],
  6975. [AS_HELP_STRING([--enable-iotsafe-hwrng],[Enables support for IoT-Safe RNG (default: disabled)])],
  6976. [ ENABLED_IOTSAFE_HWRNG=$enableval ],
  6977. [ ENABLED_IOTSAFE_HWRNG=no ]
  6978. )
  6979. # Make clean
  6980. AC_ARG_ENABLE([makeclean],
  6981. [AS_HELP_STRING([--enable-makeclean], [Enables forced "make clean" at the
  6982. end of configure (default: enabled)])],
  6983. [ ENABLED_MAKECLEAN=$enableval ],
  6984. [ ENABLED_MAKECLEAN=yes ]
  6985. )
  6986. # User Settings
  6987. AC_ARG_ENABLE([usersettings],
  6988. [AS_HELP_STRING([--enable-usersettings],[Use your own user_settings.h and do not add Makefile CFLAGS (default: disabled)])],
  6989. [ ENABLED_USERSETTINGS=$enableval ],
  6990. [ ENABLED_USERSETTINGS=no ]
  6991. )
  6992. # Default optimization CFLAGS enable
  6993. AC_ARG_ENABLE([optflags],
  6994. [AS_HELP_STRING([--enable-optflags],[Enable default optimization CFLAGS for the compiler (default: enabled)])],
  6995. [ ENABLED_OPTFLAGS=$enableval ],
  6996. [ ENABLED_OPTFLAGS=yes ]
  6997. )
  6998. # Adds functionality to load CA certificates from the operating system.
  6999. AC_ARG_ENABLE([sys-ca-certs],
  7000. [AS_HELP_STRING([--enable-sys-ca-certs],[Enable ability to load CA certs from OS (default: enabled)])],
  7001. [ ENABLED_SYS_CA_CERTS=$enableval ],
  7002. [ ENABLED_SYS_CA_CERTS=yes ]
  7003. )
  7004. # check if should run the trusted peer certs test
  7005. # (for now checking both C_FLAGS and C_EXTRA_FLAGS)
  7006. AS_CASE(["$CFLAGS $CPPFLAGS"],[*'WOLFSSL_TRUST_PEER_CERT'*],[ENABLED_TRUSTED_PEER_CERT=yes])
  7007. AS_CASE(["$CFLAGS $CPPFLAGS $AM_CFLAGS"],[*'OPENSSL_COMPATIBLE_DEFAULTS'*],
  7008. [ENABLED_OPENSSL_COMPATIBLE_DEFAULTS=yes])
  7009. if test "x$ENABLED_OPENSSL_COMPATIBLE_DEFAULTS" = "xyes"
  7010. then
  7011. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRUST_PEER_CERT"
  7012. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE_REF"
  7013. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TLS13_NO_PEEK_HANDSHAKE_DONE"
  7014. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  7015. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PRIORITIZE_PSK"
  7016. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CHECK_ALERT_ON_ERR"
  7017. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TICKET_HAVE_ID"
  7018. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OCSP_ISSUER_CHECK"
  7019. ENABLED_TRUSTED_PEER_CERT=yes
  7020. fi
  7021. # determine if we have key validation mechanism
  7022. if test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_RSA" = "xyes"
  7023. then
  7024. if test "x$ENABLED_ASN" = "xyes"
  7025. then
  7026. ENABLED_PKI="yes"
  7027. fi
  7028. fi
  7029. # When building for wolfRand, strip out all options to disable everything.
  7030. AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$FIPS_VERSION" = "xrand"],
  7031. [NEW_AM_CFLAGS="-DNO_AES -DNO_DH -DNO_ASN -DNO_RSA -DNO_SHA -DNO_MD5 -DNO_BIG_INT"
  7032. for v in $AM_CFLAGS
  7033. do
  7034. case $v in
  7035. -DHAVE_FFDHE_2048 | -DTFM_TIMING_RESISTANT | -DECC_TIMING_RESISTANT | \
  7036. -DWC_RSA_BLINDING | -DHAVE_AESGCM | -DWOLFSSL_SHA512 | -DWOLFSSL_SHA384 | \
  7037. -DHAVE_ECC | -DTFM_ECC256 | -DECC_SHAMIR | -DHAVE_TLS_EXTENSIONS | \
  7038. -DHAVE_SUPPORTED_CURVES | -DHAVE_EXTENDED_MASTER | -DUSE_FAST_MATH | \
  7039. -DWOLFSSL_SHA3)
  7040. AS_ECHO(["ignoring $v"])
  7041. ;;
  7042. *)
  7043. NEW_AM_CFLAGS="$NEW_AM_CFLAGS $v"
  7044. ;;
  7045. esac
  7046. done
  7047. AM_CFLAGS=$NEW_AM_CFLAGS])
  7048. case $host_cpu in
  7049. *arm*)
  7050. if test "$host_alias" = "thumb" || test "$ARM_TARGET" = "thumb"; then
  7051. AM_CFLAGS="$AM_CFLAGS -mthumb -march=armv6"
  7052. else
  7053. if test "$host_alias" = "cortex" || test "$ARM_TARGET" = "cortex"; then
  7054. AM_CFLAGS="$AM_CFLAGS -mcpu=cortex-r5"
  7055. fi
  7056. fi
  7057. ;;
  7058. esac
  7059. if test "$ENABLED_LOWRESOURCE" = "yes" && test "$ENABLED_ECC" = "yes" && (test "$ENABLED_RSA" = "yes" || test "$ENABLED_DH" = "yes") && (test "$ENABLED_SP_MATH" = "yes" || test "$ENABLED_SP_MATH_ALL" = "yes")
  7060. then
  7061. AM_CFLAGS="$AM_CFLAGS -DALT_ECC_SIZE"
  7062. fi
  7063. ################################################################################
  7064. # Update ENABLE_* variables #
  7065. ################################################################################
  7066. if test "x$ENABLED_SYS_CA_CERTS" = "xyes"
  7067. then
  7068. if test "x$ENABLED_FILESYSTEM" = "xno"
  7069. then
  7070. ENABLED_SYS_CA_CERTS="no"
  7071. elif test "x$ENABLED_CERTS" = "xno"
  7072. then
  7073. ENABLED_SYS_CA_CERTS="no"
  7074. fi
  7075. case $host_os in
  7076. *darwin*)
  7077. AC_CHECK_HEADERS([Security/SecTrustSettings.h],
  7078. [
  7079. # For Mac we need these frameworks to load system CA certs
  7080. LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
  7081. ],
  7082. [
  7083. AC_MSG_NOTICE([Can't enable system CA certs without Security/SecTrustSettings.h])
  7084. ENABLED_SYS_CA_CERTS="no"
  7085. ]
  7086. )
  7087. ;;
  7088. esac
  7089. fi
  7090. if test "x$ENABLED_WOLFCLU" = "xyes"
  7091. then
  7092. if test "x$ENABLED_CERTGEN" = "xno"
  7093. then
  7094. ENABLED_CERTGEN="yes"
  7095. fi
  7096. if test "x$ENABLED_CERTREQ" = "xno"
  7097. then
  7098. ENABLED_CERTREQ="yes"
  7099. fi
  7100. if test "x$ENABLED_CERTEXT" = "xno"
  7101. then
  7102. ENABLED_CERTEXT="yes"
  7103. fi
  7104. # Requires md5
  7105. if test "$ENABLED_MD5" = "no"
  7106. then
  7107. ENABLED_MD5="yes"
  7108. fi
  7109. # Requires aesctr
  7110. if test "x$ENABLED_AESCTR" = "xno"
  7111. then
  7112. ENABLED_AESCTR="yes"
  7113. fi
  7114. # Uses key generation
  7115. if test "x$ENABLED_KEYGEN" = "xno"
  7116. then
  7117. ENABLED_KEYGEN="yes"
  7118. fi
  7119. # Uses functions guarded by opensslall
  7120. if test "$ENABLED_OPENSSLALL" = "no"
  7121. then
  7122. ENABLED_OPENSSLALL="yes"
  7123. fi
  7124. # Has option for signing with ED25519
  7125. if test "$ENABLED_ED25519" = "no"
  7126. then
  7127. ENABLED_ED25519=yes
  7128. ENABLED_FEMATH=yes
  7129. ENABLED_GEMATH=yes
  7130. ENABLED_CERTS=yes
  7131. fi
  7132. # Has sha512 hashing
  7133. if test "$ENABLED_SHA512" = "no"
  7134. then
  7135. ENABLED_SHA512="yes"
  7136. fi
  7137. # Has support for DES3 encrypt/decrypt
  7138. if test "$ENABLED_DES3" = "no"
  7139. then
  7140. ENABLED_DES3="yes"
  7141. fi
  7142. # Uses alt name
  7143. ENABLED_ALTNAMES="yes"
  7144. AM_CFLAGS="$AM_CFLAGS -DHAVE_OID_ENCODING -DWOLFSSL_NO_ASN_STRICT"
  7145. fi
  7146. if test "$ENABLED_STRONGSWAN" = "yes"; then
  7147. if test "$ENABLED_CERTREQ" = "no"; then
  7148. ENABLED_CERTREQ="yes"
  7149. fi
  7150. if test "$ENABLED_OCSP" = "no"; then
  7151. ENABLED_OCSP="yes"
  7152. fi
  7153. fi
  7154. AS_IF([test "x$ENABLED_MCAPI" = "xyes"],
  7155. [AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"])])
  7156. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || \
  7157. test "$ENABLED_SIGNAL" = "yes" || test "$ENABLED_WPAS" = "yes" || \
  7158. test "$ENABLED_FORTRESS" = "yes" || test "$ENABLED_BUMP" = "yes" || \
  7159. test "$ENABLED_OPENSSLALL" = "yes" || \
  7160. test "$ENABLED_LIBWEBSOCKETS" = "yes" || \
  7161. test "x$ENABLED_LIGHTY" = "xyes" || test "$ENABLED_LIBSSH2" = "yes" || \
  7162. test "x$ENABLED_NTP" = "xyes" || test "$ENABLED_RSYSLOG" = "yes" || \
  7163. test "$ENABLED_OPENLDAP" = "yes" || test "$ENABLED_HITCH" = "yes"
  7164. then
  7165. ENABLED_OPENSSLEXTRA="yes"
  7166. fi
  7167. if test "$ENABLED_ED25519" != "no" && test "$ENABLED_32BIT" = "no"
  7168. then
  7169. if test "$ENABLED_ED25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  7170. then
  7171. ENABLED_ED25519_SMALL=yes
  7172. ENABLED_CURVE25519_SMALL=yes
  7173. ENABLED_ED25519=yes
  7174. fi
  7175. ENABLED_FEMATH=yes
  7176. ENABLED_GEMATH=yes
  7177. ENABLED_CERTS=yes
  7178. fi
  7179. if test "$ENABLED_ED25519" != "no" || test "$ENABLED_ED448" != "no"
  7180. then
  7181. ENABLED_CERTS=yes
  7182. fi
  7183. if test "$ENABLED_MD5" = "yes"
  7184. then
  7185. # turn off MD5 if leanpsk or leantls on
  7186. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  7187. then
  7188. ENABLED_MD5=no
  7189. fi
  7190. fi
  7191. if test "x$ENABLED_LEANPSK" = "xyes" || test "x$ENABLED_CERTS" = "xno" || \
  7192. test "x$ENABLED_ASN" = "xno"
  7193. then
  7194. ENABLED_CERTS=no
  7195. ENABLED_ASN=no
  7196. fi
  7197. ################################################################################
  7198. # Check for build-type conflicts #
  7199. ################################################################################
  7200. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  7201. test "x$ENABLED_LEANPSK" = "xyes"],
  7202. [AC_MSG_ERROR([Cannot use Max Strength and Lean PSK at the same time.])])
  7203. AS_IF([test "x$ENABLED_OCSP" = "xyes" && \
  7204. test "x$ENABLED_ASN" = "xno"],
  7205. [AC_MSG_ERROR([please enable asn if enabling ocsp.])])
  7206. AS_IF([test "x$ENABLED_SMIME" = "xyes" && \
  7207. test "x$ENABLED_ASN" = "xno"],
  7208. [AC_MSG_ERROR([please enable asn if enabling S/MIME.])])
  7209. AS_IF([test "x$ENABLED_OCSP" = "xyes" && \
  7210. test "x$ENABLED_RSA" = "xno" && \
  7211. test "x$ENABLED_ECC" = "xno"],
  7212. [AC_MSG_ERROR([please enable rsa or ecc if enabling ocsp.])])
  7213. # Sync Intel QA and Sync Cavium Octeon require the crypto callback
  7214. AS_IF([test "x$ENABLED_INTEL_QA_SYNC" = "xyes" || test "x$ENABLED_OCTEON_SYNC" = "xyes"],
  7215. [AS_IF([test "x$ENABLED_CRYPTOCB" = "xno"],
  7216. [AC_MSG_ERROR([please enable the crypto callback support using --enable-cryptocb])])])
  7217. # checks for pkcs7 needed enables
  7218. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  7219. test "x$ENABLED_RSA" = "xno" && \
  7220. test "x$ENABLED_ECC" = "xno"],
  7221. [AC_MSG_ERROR([please enable ecc or rsa if enabling pkcs7.])])
  7222. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  7223. test "x$ENABLED_SHA" = "xno" && \
  7224. test "x$ENABLED_SHA256" = "xno"],
  7225. [AC_MSG_ERROR([please enable sha or sha256 if enabling pkcs7.])])
  7226. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  7227. test "x$ENABLED_AES" = "xno" && \
  7228. test "x$ENABLED_DES3" = "xno"],
  7229. [AC_MSG_ERROR([please enable either AES or 3DES if enabling pkcs7.])])
  7230. AS_IF([test "x$ENABLED_WOLFSCEP" = "xyes" && \
  7231. test "x$ENABLED_AES" = "xno" && \
  7232. test "x$ENABLED_DES3" = "xno"],
  7233. [AC_MSG_ERROR([please enable either AES or 3DES if enabling scep.])])
  7234. AS_IF([test "x$ENABLED_LEANTLS" = "xyes" && \
  7235. test "x$ENABLED_ECC" = "xno"],
  7236. [AC_MSG_ERROR([please enable ecc if enabling leantls.])])
  7237. AS_IF([test "x$ENABLED_SNIFFER" = "xyes" && \
  7238. test "x$ENABLED_RSA" = "xno" && \
  7239. test "x$ENABLED_ECC" = "xno" && \
  7240. test "x$ENABLED_CURVE25519" = "xno"],
  7241. [AC_MSG_ERROR([please enable ecc, rsa or curve25519 if enabling sniffer.])])
  7242. # Lean TLS forces off prereqs of SCEP.
  7243. AS_IF([test "x$ENABLED_SCEP" = "xyes" && \
  7244. test "x$ENABLED_LEANTLS" = "xyes"],
  7245. [AC_MSG_ERROR([Cannot use SCEP and Lean TLS at the same time.])])
  7246. # CMAC currently requires AES.
  7247. AS_IF([test "x$ENABLED_CMAC" = "xyes" && \
  7248. test "x$ENABLED_AES" = "xno"],
  7249. [AC_MSG_ERROR([cannot use CMAC without AES.])])
  7250. # certreq requires certgen
  7251. AS_IF([test "x$ENABLED_CERT_REQ" = "xyes" && \
  7252. test "x$ENABLED_CERT_GEN" = "xno"],
  7253. [AC_MSG_ERROR([cannot use certreq without certgen.])])
  7254. # ed25519 requires sha512
  7255. AS_IF([test "x$ENABLED_ED25519" = "xyes" && \
  7256. test "x$ENABLED_SHA512" = "xno" && \
  7257. test "x$ENABLED_32BIT" = "xno"],
  7258. [AC_MSG_ERROR([cannot enable ed25519 without enabling sha512.])])
  7259. # ed25519 stream requires ed25519
  7260. AS_IF([test "x$ENABLED_ED25519_STREAM" = "xyes" && \
  7261. test "x$ENABLED_ED25519" = "xno"],
  7262. [AC_MSG_ERROR([ED25519 verify streaming enabled but ED25519 is disabled])])
  7263. # Ensure only one size is enabled
  7264. AS_IF([test "x$ENABLED_64BIT" = "xyes" && \
  7265. test "x$ENABLED_32BIT" = "xyes"],
  7266. [AC_MSG_ERROR([cannot specify 64-bit build and 32-bit build.])])
  7267. AS_IF([test "x$ENABLED_64BIT" = "xyes" && \
  7268. test "x$ENABLED_16BIT" = "xyes"],
  7269. [AC_MSG_ERROR([cannot specify 64-bit build and 16-bit build.])])
  7270. AS_IF([test "x$ENABLED_32BIT" = "xyes" && \
  7271. test "x$ENABLED_16BIT" = "xyes"],
  7272. [AC_MSG_ERROR([cannot specify 32-bit build and 16-bit build.])])
  7273. # 16-bit build not supported with SP
  7274. AS_IF([test "x$ENABLED_16BIT" = "xyes" && \
  7275. test "x$ENABLED_SP" = "xyes"],
  7276. [AC_MSG_ERROR([16-bit build not available with SP.])])
  7277. ################################################################################
  7278. # Update CFLAGS based on options #
  7279. ################################################################################
  7280. AS_IF([test "x$ENABLED_SP_MATH_ALL" = "xno" && test "x$ENABLED_FASTMATH" = "xno" &&
  7281. test "x$ENABLED_HEAPMATH" = "xno"],
  7282. [AM_CFLAGS="$AM_CFLAGS -DNO_BIG_INT"])
  7283. AS_IF([test "x$ENABLED_CERTS" = "xno"],
  7284. [AM_CFLAGS="$AM_CFLAGS -DNO_CERTS"])
  7285. AS_IF([test "x$ENABLED_ASN" = "xno"],
  7286. [AM_CFLAGS="$AM_CFLAGS -DNO_ASN"])
  7287. AS_IF([test "x$ENABLED_SYS_CA_CERTS" = "xyes"],
  7288. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SYS_CA_CERTS"])
  7289. AS_IF([test "x$ENABLED_ALTNAMES" = "xyes"],
  7290. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_NAMES"])
  7291. AS_IF([test "x$ENABLED_KEYGEN" = "xyes"],
  7292. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"])
  7293. AS_IF([test "x$ENABLED_CERTREQ" = "xyes"],
  7294. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"])
  7295. AS_IF([test "x$ENABLED_CERTGEN" = "xyes"],
  7296. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"])
  7297. AS_IF([test "x$ENABLED_CERTEXT" = "xyes"],
  7298. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"])
  7299. AS_IF([test "x$ENABLED_ED25519" = "xyes" && test "x$ENABLED_32BIT" = "xno"],
  7300. [AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519"])
  7301. AS_IF([test "x$ENABLED_ED25519" = "xyes" && test "x$ENABLED_32BIT" = "xno"],
  7302. [AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_ED25519"])
  7303. AS_IF([test "x$ENABLED_ED25519_SMALL" = "xyes"],
  7304. [AM_CFLAGS="$AM_CFLAGS -DED25519_SMALL"])
  7305. AS_IF([test "x$ENABLED_OCSP" = "xyes"],
  7306. [AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"])
  7307. AS_IF([test "x$ENABLED_STRONGSWAN" = "xyes"],
  7308. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB -DWOLFSSL_LOG_PRINTF -DWOLFSSL_PUBLIC_MP -DHAVE_EX_DATA"])
  7309. AS_IF([test "x$ENABLED_OPENLDAP" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNER_DER_CERT"])
  7310. if test "$ENABLED_ED25519_STREAM" != "no" && test "$ENABLED_SE050" != "yes"
  7311. then
  7312. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED25519_STREAMING_VERIFY"
  7313. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED25519_STREAMING_VERIFY"
  7314. fi
  7315. if test "$ENABLED_ERROR_QUEUE" = "no" || test "$ENABLED_JNI" = "yes"
  7316. then
  7317. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_QUEUE"
  7318. fi
  7319. AS_IF([test "x$ENABLED_OPENSSLALL" = "xyes"],
  7320. [AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL -DWOLFSSL_EITHER_SIDE -DWC_RSA_NO_PADDING -DWC_RSA_PSS -DWOLFSSL_PSS_LONG_SALT -DWOLFSSL_TICKET_HAVE_ID -DWOLFSSL_ERROR_CODE_OPENSSL -DWOLFSSL_CERT_NAME_ALL"])
  7321. AS_IF([test "x$ENABLED_AESSIV" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_SIV"])
  7322. AS_IF([test "x$ENABLED_AESCTR" = "xyes" && test "x$ENABLED_FORTRESS" != "xyes"],
  7323. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"])
  7324. if test "$ENABLED_MD5" = "no"
  7325. then
  7326. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  7327. fi
  7328. if test "$ENABLED_HMAC" = "no"
  7329. then
  7330. AM_CFLAGS="$AM_CFLAGS -DNO_HMAC"
  7331. fi
  7332. if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  7333. then
  7334. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  7335. fi
  7336. if test "$ENABLED_OPENSSLEXTRA" = "x509small"
  7337. then
  7338. AC_MSG_NOTICE([Enabling only a subset of X509 opensslextra])
  7339. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
  7340. fi
  7341. if test "$ENABLED_WOLFSCEP" = "yes"
  7342. then
  7343. # Enable prereqs if not already enabled
  7344. if test "x$ENABLED_KEYGEN" = "xno"
  7345. then
  7346. ENABLED_KEYGEN="yes"
  7347. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  7348. fi
  7349. if test "x$ENABLED_CERTGEN" = "xno"
  7350. then
  7351. ENABLED_CERTGEN="yes"
  7352. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  7353. fi
  7354. if test "x$ENABLED_CERTREQ" = "xno"
  7355. then
  7356. ENABLED_CERTREQ="yes"
  7357. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  7358. fi
  7359. if test "x$ENABLED_CERTEXT" = "xno"
  7360. then
  7361. ENABLED_CERTEXT="yes"
  7362. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  7363. fi
  7364. if test "x$ENABLED_PKCS7" = "xno"
  7365. then
  7366. ENABLED_PKCS7="yes"
  7367. fi
  7368. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_WOLFSCEP"
  7369. fi
  7370. if test "x$ENABLED_PKCS7" = "xyes"
  7371. then
  7372. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  7373. # Enable prereqs if not already enabled
  7374. if test "x$ENABLED_AESKEYWRAP" = "xno"
  7375. then
  7376. ENABLED_AESKEYWRAP="yes"
  7377. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT"
  7378. fi
  7379. if test "x$ENABLED_X963KDF" = "xno" && test "$ENABLED_ECC" != "no"
  7380. then
  7381. ENABLED_X963KDF="yes"
  7382. AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF"
  7383. fi
  7384. fi
  7385. if test "x$ENABLED_DES3" = "xno"
  7386. then
  7387. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  7388. else
  7389. # turn off DES3 if leanpsk or leantls on
  7390. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  7391. then
  7392. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  7393. ENABLED_DES3=no
  7394. fi
  7395. fi
  7396. if test "$ENABLED_AESGCM" != "no"
  7397. then
  7398. if test "$ENABLED_AESGCM" = "word"
  7399. then
  7400. ENABLED_AESGCM=yes
  7401. fi
  7402. if test "$ENABLED_AESGCM" = "word32"
  7403. then
  7404. AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
  7405. ENABLED_AESGCM=yes
  7406. fi
  7407. if test "$ENABLED_AESGCM" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  7408. then
  7409. AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
  7410. ENABLED_AESGCM=yes
  7411. fi
  7412. if test "$ENABLED_AESGCM" = "table"
  7413. then
  7414. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
  7415. ENABLED_AESGCM=yes
  7416. fi
  7417. if test "$ENABLED_AESGCM" = "4bit"
  7418. then
  7419. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE_4BIT"
  7420. ENABLED_AESGCM=yes
  7421. fi
  7422. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"
  7423. fi
  7424. if test "$ENABLED_AESGCM_STREAM" != "no"
  7425. then
  7426. if test "$ENABLED_AESGCM" = "no"
  7427. then
  7428. AC_MSG_ERROR([AES-GCM streaming enabled but AES-GCM is disabled])
  7429. else
  7430. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESGCM_STREAM"
  7431. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AESGCM_STREAM"
  7432. fi
  7433. fi
  7434. if test "$ENABLED_IOTSAFE" != "no"
  7435. then
  7436. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IOTSAFE"
  7437. ENABLED_IOTSAFE=yes
  7438. fi
  7439. if test "$ENABLED_IOTSAFE_HWRNG" != "no"
  7440. then
  7441. AM_CFLAGS="$AM_CFLAGS -DHAVE_IOTSAFE_HWRNG"
  7442. ENABLED_IOTSAFE_HWRNG=yes
  7443. fi
  7444. if test "x$ENABLED_WOLFENGINE" = "xyes"
  7445. then
  7446. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_ECB"
  7447. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  7448. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_NO_PADDING"
  7449. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
  7450. AM_CFLAGS="$AM_CFLAGS -DECC_MIN_KEY_SZ=192"
  7451. fi
  7452. if test "$ENABLED_WOLFENGINE" = "yes" && test "$ENABLED_FIPS" != "no"
  7453. then
  7454. AM_CFLAGS="$AM_CFLAGS -DSha3=wc_Sha3"
  7455. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA256_NAMES"
  7456. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_MD5_NAME"
  7457. fi
  7458. if test "$ENABLED_WOLFENGINE" = "yes" && test "$FIPS_VERSION" != "v2"
  7459. then
  7460. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_LONG_SALT"
  7461. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_SALT_LEN_DISCOVER"
  7462. fi
  7463. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes"],
  7464. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAX_STRENGTH -DWOLFSSL_CIPHER_TEXT_CHECK"])
  7465. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  7466. test "x$ENABLED_OLD_TLS" = "xyes"],
  7467. [AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  7468. ENABLED_OLD_TLS=no])
  7469. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  7470. test "x$ENABLED_SSLV3" = "xyes"],
  7471. [AC_MSG_ERROR([Cannot use Max Strength and SSLv3 at the same time.])])
  7472. AS_IF([test "x$ENABLED_SCTP" = "xyes"],
  7473. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SCTP"])
  7474. AS_IF([test "x$ENABLED_SRTP" = "xyes"],
  7475. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SRTP"])
  7476. AS_IF([test "x$ENABLED_MCAST" = "xyes"],
  7477. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTICAST"])
  7478. # WOLFSSL_AFALG does not support SHA224 yet
  7479. AS_IF([(test "x$ENABLED_AFALG" = "xyes") && (test "x$ENABLED_SHA224" = "xyes")],
  7480. [AC_MSG_ERROR([--enable-sha224 with --enable-afalg not yet supported])])
  7481. # WOLFSSL_DEVCRYPTO does not support SHA224 yet
  7482. AS_IF([(test "x$ENABLED_DEVCRYPTO" = "xyes") && \
  7483. (test "x$ENABLED_CAAM" = "xno") && \
  7484. (test "x$ENABLED_SHA224" = "xyes")],
  7485. [AC_MSG_ERROR([--enable-sha224 with --enable-devcrypto not yet supported])])
  7486. # SCTP, Multicast, SRTP, and strongSwan require DTLS
  7487. AS_IF([(test "x$ENABLED_DTLS" = "xno") && \
  7488. (test "x$ENABLED_SCTP" = "xyes" || test "x$ENABLED_MCAST" = "xyes" || \
  7489. test "x$ENABLED_SRTP" = "xyes" || \
  7490. test "x$ENABLED_STRONGSWAN" = "xyes")],
  7491. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  7492. ENABLED_DTLS=yes])
  7493. # Multicast requires the null cipher
  7494. AS_IF([test "x$ENABLED_NULL_CIPHER" = "xno" && \
  7495. test "x$ENABLED_MCAST" = "xyes"],
  7496. [AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  7497. ENABLED_NULL_CIPHER=yes])
  7498. # wolfSSH and WPA Supplicant both need Public MP, only enable once.
  7499. # This will let you know if you enabled wolfSSH but have any of the prereqs
  7500. # disabled. Some of these options, disabling them adds things to the FLAGS and
  7501. # you need to check and add items in two places depending on the option.
  7502. AS_IF([test "x$ENABLED_WOLFSSH" = "xyes"],[AS_IF([test "x$ENABLED_WPAS" = "xno"],[AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"])])
  7503. if test "x$ENABLED_OPENSSLCOEXIST" = "xyes"; then
  7504. if test "x$ENABLED_OPENSSLALL" = "xyes"; then
  7505. AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslall])
  7506. fi
  7507. if test "x$ENABLED_OPENSSLEXTRA" = "xyes"; then
  7508. AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslextra])
  7509. fi
  7510. fi
  7511. AS_IF([test "x$ENABLED_WOLFSSH" = "xyes"],[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_WOLFSSH"])
  7512. # only allow secure renegotiation info with TLSV12 and ASN
  7513. if test "x$ENABLED_ASN" = "xno" || \
  7514. test "x$ENABLED_TLSV12" = "xno" || \
  7515. test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"; then
  7516. ENABLED_SECURE_RENEGOTIATION_INFO="no"
  7517. fi
  7518. if test "x$ENABLED_SECURE_RENEGOTIATION_INFO" = "xyes"; then
  7519. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SERVER_RENEGOTIATION_INFO"
  7520. fi
  7521. if test "$ENABLED_COMPKEY" = "yes"
  7522. then
  7523. AM_CFLAGS="$AM_CFLAGS -DHAVE_COMP_KEY"
  7524. fi
  7525. # Deprecated Algorithm Handling
  7526. if test "$ENABLED_ARC4" = "yes"
  7527. then
  7528. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_RC4"
  7529. fi
  7530. # Link with the math library iff needed.
  7531. if test "$ENABLED_DH" != "no" && test "$ENABLED_DH" != "const"; then
  7532. LT_LIB_M
  7533. fi
  7534. ################################################################################
  7535. # USER SETTINGS
  7536. if test "x$ENABLED_USERSETTINGS" = "xyes"
  7537. then
  7538. # Replace all options and just use WOLFSSL_USER_SETTINGS and
  7539. # WOLFSSL_USER_SETTINGS_ASM.
  7540. AM_CFLAGS="-DWOLFSSL_USER_SETTINGS -DWOLFSSL_USER_SETTINGS_ASM"
  7541. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_USER_SETTINGS -DWOLFSSL_USER_SETTINGS_ASM"
  7542. # Generate assembly-safe user_settings_asm.h (just preprocessor directives
  7543. # from user_settings.h).
  7544. $srcdir/scripts/user_settings_asm.sh "$CPPFLAGS $CFLAGS $CXXFLAGS"
  7545. if test $? -ne 0; then
  7546. AC_MSG_ERROR([$srcdir/scripts/user_settings_asm.sh failed.])
  7547. fi
  7548. fi
  7549. # OPTIMIZE FLAGS
  7550. # For distro disable custom build options that interfere with symbol generation
  7551. if test "$GCC" = "yes" && test "$ENABLED_DISTRO" = "no"
  7552. then
  7553. AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
  7554. if test "$ax_enable_debug" = "no"
  7555. then
  7556. AS_IF([test "x$ENABLED_OPTFLAGS" = "xyes"], [
  7557. if test "$ENABLED_FASTMATH" = "yes"
  7558. then
  7559. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  7560. if test "$ENABLED_FASTHUGEMATH" = "yes"
  7561. then
  7562. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  7563. fi
  7564. else
  7565. if (test "$ENABLED_SP" = "yes" || test "$ENABLED_SP_MATH_ALL" = "yes") && test "$ENABLED_SP_SMALL" = "no"
  7566. then
  7567. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  7568. if test "$ENABLED_FASTHUGEMATH" = "yes"
  7569. then
  7570. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  7571. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_LARGE_COMBA"
  7572. fi
  7573. else
  7574. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
  7575. fi
  7576. fi
  7577. ])
  7578. fi
  7579. fi
  7580. # ICC command line warning for non supported warning flags
  7581. if test "$CC" = "icc"
  7582. then
  7583. AM_CFLAGS="$AM_CFLAGS -wd10006"
  7584. fi
  7585. # Expose HAVE___UINT128_T to options flags"
  7586. if test "$ac_cv_type___uint128_t" = "yes"
  7587. then
  7588. AM_CFLAGS="$AM_CFLAGS -DHAVE___UINT128_T=1"
  7589. fi
  7590. LIB_SOCKET_NSL
  7591. AX_HARDEN_CC_COMPILER_FLAGS
  7592. case $host_os in
  7593. mingw*)
  7594. # if mingw then link to ws2_32 for sockets, and crypt32
  7595. LDFLAGS="$LDFLAGS -lws2_32"
  7596. LIB_ADD="$LIB_ADD -lcrypt32"
  7597. if test "$enable_shared" = "yes"
  7598. then
  7599. AC_DEFINE([WOLFSSL_DLL], [1], [Use __declspec(dllexport) when building library])
  7600. if test "$enable_static" = "yes"
  7601. then
  7602. MINGW_LIB_WARNING="yes"
  7603. fi
  7604. fi ;;
  7605. esac
  7606. if test "$enable_shared" = "no"; then
  7607. if test "$enable_static" = "yes"; then
  7608. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TEST_STATIC_BUILD"
  7609. fi
  7610. fi
  7611. if test "x$ENABLED_LINUXKM" = "xyes"; then
  7612. AX_SIMD_CC_COMPILER_FLAGS
  7613. AC_SUBST([CFLAGS_FPU_DISABLE])
  7614. AC_SUBST([CFLAGS_FPU_ENABLE])
  7615. AC_SUBST([CFLAGS_SIMD_DISABLE])
  7616. AC_SUBST([CFLAGS_SIMD_ENABLE])
  7617. AC_SUBST([CFLAGS_AUTO_VECTORIZE_DISABLE])
  7618. AC_SUBST([CFLAGS_AUTO_VECTORIZE_ENABLE])
  7619. AC_SUBST([ASFLAGS_FPU_DISABLE_SIMD_ENABLE])
  7620. AC_SUBST([ASFLAGS_FPU_ENABLE_SIMD_DISABLE])
  7621. AC_SUBST([ASFLAGS_FPUSIMD_DISABLE])
  7622. AC_SUBST([ASFLAGS_FPUSIMD_ENABLE])
  7623. if test "$ENABLED_OPENSSLEXTRA" != "no" && test "$ENABLED_CRYPTONLY" = "no"; then
  7624. AC_MSG_ERROR([--enable-opensslextra without --enable-cryptonly is incompatible with --enable-linuxkm.])
  7625. fi
  7626. if test "$ENABLED_FILESYSTEM" = "yes"; then
  7627. AC_MSG_ERROR([--enable-filesystem is incompatible with --enable-linuxkm.])
  7628. fi
  7629. if test "$ENABLED_AFALG" = "yes"; then
  7630. AC_MSG_ERROR([--enable-afalg is incompatible with --enable-linuxkm.])
  7631. fi
  7632. if test "$ENABLED_DEVCRYPTO" = "yes"; then
  7633. AC_MSG_ERROR([--enable-devcrypto is incompatible with --enable-linuxkm.])
  7634. fi
  7635. if test "$ENABLED_PKCS11" = "yes"; then
  7636. AC_MSG_ERROR([--enable-pkcs11 is incompatible with --enable-linuxkm.])
  7637. fi
  7638. if test "$ENABLED_JNI" = "yes"; then
  7639. AC_MSG_ERROR([--enable-jni is incompatible with --enable-linuxkm.])
  7640. fi
  7641. if test "$ENABLED_16BIT" = "yes"; then
  7642. AC_MSG_ERROR([--enable-16bit is incompatible with --enable-linuxkm.])
  7643. fi
  7644. if test "$ENABLED_SINGLETHREADED" = "yes"; then
  7645. AC_MSG_ERROR([--enable-singlethreaded is incompatible with --enable-linuxkm.])
  7646. fi
  7647. if test "$ENABLED_VALGRIND" = "yes"; then
  7648. AC_MSG_ERROR([--enable-valgrind is incompatible with --enable-linuxkm.])
  7649. fi
  7650. if test "$ENABLED_FASTMATH" = "yes"; then
  7651. AC_MSG_ERROR([--enable-fastmath is incompatible with --enable-linuxkm (exceeds stack limit).])
  7652. fi
  7653. if test "$ENABLED_FAST_RSA" = "yes"; then
  7654. AC_MSG_ERROR([--enable-fastrsa is incompatible with --enable-linuxkm.])
  7655. fi
  7656. if test "$ENABLED_LIBZ_RSA" = "yes"; then
  7657. AC_MSG_ERROR([--with-libz is incompatible with --enable-linuxkm.])
  7658. fi
  7659. if test "$ENABLED_IOPOOL" = "yes"; then
  7660. AC_MSG_ERROR([--enable-iopool is incompatible with --enable-linuxkm.])
  7661. fi
  7662. if test "$ENABLED_EXAMPLES" = "yes"; then
  7663. AC_MSG_ERROR([--enable-examples is incompatible with --enable-linuxkm.])
  7664. fi
  7665. if test "$ENABLED_SMALL_STACK" != "yes"; then
  7666. AC_MSG_ERROR([--enable-smallstack is required for --enable-linuxkm.])
  7667. fi
  7668. if test "$ENABLED_SP_MATH" = "no" && test "$ENABLED_SP_MATH_ALL" = "no" && test "$ENABLED_BIGNUM" != "no"; then
  7669. AC_MSG_ERROR([--enable-sp-math or --enable-sp-math-all is required for --enable-linuxkm.])
  7670. fi
  7671. if test "$ENABLED_STACKSIZE" != "no"; then
  7672. AC_MSG_ERROR([--enable-stacksize is incompatible with --enable-linuxkm.])
  7673. fi
  7674. if test "$ENABLED_STACKLOG" = "yes"; then
  7675. AC_MSG_ERROR([--enable-stacklog is incompatible with --enable-linuxkm.])
  7676. fi
  7677. if test "$ENABLED_COMPKEY" = "yes"; then
  7678. AC_MSG_ERROR([--enable-compkey is incompatible with --enable-linuxkm.])
  7679. fi
  7680. fi
  7681. # The following AM_CONDITIONAL statements set flags for use in the Makefiles.
  7682. # Some of these affect build targets and objects, some trigger different
  7683. # test scripts for make check.
  7684. AM_CONDITIONAL([BUILD_DISTRO],[test "x$ENABLED_DISTRO" = "xyes"])
  7685. AM_CONDITIONAL([BUILD_ALL],[test "x$ENABLED_ALL" = "xyes"])
  7686. AM_CONDITIONAL([BUILD_TLS13],[test "x$ENABLED_TLS13" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7687. AM_CONDITIONAL([BUILD_RNG],[test "x$ENABLED_RNG" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7688. AM_CONDITIONAL([BUILD_SCTP],[test "x$ENABLED_SCTP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7689. AM_CONDITIONAL([BUILD_SRTP],[test "x$ENABLED_SRTP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7690. AM_CONDITIONAL([BUILD_MCAST],[test "x$ENABLED_MCAST" = "xyes"])
  7691. AM_CONDITIONAL([BUILD_IPV6],[test "x$ENABLED_IPV6" = "xyes"])
  7692. AM_CONDITIONAL([BUILD_LEANPSK],[test "x$ENABLED_LEANPSK" = "xyes"])
  7693. AM_CONDITIONAL([BUILD_LEANTLS],[test "x$ENABLED_LEANTLS" = "xyes"])
  7694. AM_CONDITIONAL([BUILD_LOWMEM],[test "x$ENABLED_LOWRESOURCE" = "xyes"])
  7695. AM_CONDITIONAL([BUILD_PKCALLBACKS], [ test "x$ENABLED_PKCALLBACKS" = "xyes"])
  7696. AM_CONDITIONAL([BUILD_CRYPTOAUTHLIB],[test "x$ENABLED_CRYPTOAUTHLIB" = "xyes"])
  7697. AM_CONDITIONAL([BUILD_SNIFFER], [ test "x$ENABLED_SNIFFER" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7698. AM_CONDITIONAL([BUILD_SNIFFTEST],[ test "x$ENABLED_SNIFFTEST" = "xyes"])
  7699. AM_CONDITIONAL([BUILD_AESGCM],[test "x$ENABLED_AESGCM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7700. AM_CONDITIONAL([BUILD_AESCCM],[test "x$ENABLED_AESCCM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7701. AM_CONDITIONAL([BUILD_XTS],[test "x$ENABLED_XTS" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7702. AM_CONDITIONAL([BUILD_ARMASM],[test "x$ENABLED_ARMASM" = "xyes"])
  7703. AM_CONDITIONAL([BUILD_ARMASM_INLINE],[test "x$ENABLED_ARMASM_INLINE" = "xyes"])
  7704. AM_CONDITIONAL([BUILD_ARMASM_CRYPTO],[test "x$ENABLED_ARMASM_CRYPTO" = "xyes"])
  7705. AM_CONDITIONAL([BUILD_ARMASM_NEON],[test "x$ENABLED_ARMASM_NEON" = "xyes"])
  7706. AM_CONDITIONAL([BUILD_XILINX],[test "x$ENABLED_XILINX" = "xyes"])
  7707. AM_CONDITIONAL([BUILD_AESNI],[test "x$ENABLED_AESNI" = "xyes"])
  7708. AM_CONDITIONAL([BUILD_INTELASM],[test "x$ENABLED_INTELASM" = "xyes"])
  7709. AM_CONDITIONAL([BUILD_X86_ASM],[test "x$ENABLED_X86_ASM" = "xyes"])
  7710. AM_CONDITIONAL([BUILD_AFALG],[test "x$ENABLED_AFALG" = "xyes"])
  7711. AM_CONDITIONAL([BUILD_KCAPI],[test "x$ENABLED_KCAPI" = "xyes"])
  7712. AM_CONDITIONAL([BUILD_DEVCRYPTO],[test "x$ENABLED_DEVCRYPTO" = "xyes"])
  7713. AM_CONDITIONAL([BUILD_CAMELLIA],[test "x$ENABLED_CAMELLIA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7714. AM_CONDITIONAL([BUILD_MD2],[test "x$ENABLED_MD2" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7715. AM_CONDITIONAL([BUILD_RIPEMD],[test "x$ENABLED_RIPEMD" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7716. AM_CONDITIONAL([BUILD_BLAKE2],[test "x$ENABLED_BLAKE2" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7717. AM_CONDITIONAL([BUILD_BLAKE2S],[test "x$ENABLED_BLAKE2S" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7718. AM_CONDITIONAL([BUILD_SHA512],[test "x$ENABLED_SHA512" = "xyes" || test "x$ENABLED_SHA384" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7719. AM_CONDITIONAL([BUILD_DSA],[test "x$ENABLED_DSA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7720. AM_CONDITIONAL([BUILD_ECC],[test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7721. AM_CONDITIONAL([BUILD_ED25519],[test "x$ENABLED_ED25519" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7722. AM_CONDITIONAL([BUILD_ED25519_SMALL],[test "x$ENABLED_ED25519_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7723. AM_CONDITIONAL([BUILD_FEMATH], [test "x$ENABLED_FEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7724. AM_CONDITIONAL([BUILD_GEMATH], [test "x$ENABLED_GEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7725. AM_CONDITIONAL([BUILD_CURVE25519],[test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7726. AM_CONDITIONAL([BUILD_CURVE25519_SMALL],[test "x$ENABLED_CURVE25519_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7727. AM_CONDITIONAL([BUILD_ED448],[test "x$ENABLED_ED448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7728. AM_CONDITIONAL([BUILD_ED448_SMALL],[test "x$ENABLED_ED448_SMALL" = "xyes"])
  7729. AM_CONDITIONAL([BUILD_FE448], [test "x$ENABLED_FE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7730. AM_CONDITIONAL([BUILD_GE448], [test "x$ENABLED_GE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7731. AM_CONDITIONAL([BUILD_CURVE448],[test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7732. AM_CONDITIONAL([BUILD_CURVE448_SMALL],[test "x$ENABLED_CURVE448_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7733. AM_CONDITIONAL([BUILD_WC_LMS],[test "x$ENABLED_WC_LMS" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7734. AM_CONDITIONAL([BUILD_WC_KYBER],[test "x$ENABLED_WC_KYBER" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7735. AM_CONDITIONAL([BUILD_ECCSI],[test "x$ENABLED_ECCSI" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7736. AM_CONDITIONAL([BUILD_SAKKE],[test "x$ENABLED_SAKKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7737. AM_CONDITIONAL([BUILD_MEMORY],[test "x$ENABLED_MEMORY" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7738. AM_CONDITIONAL([BUILD_RSA],[test "x$ENABLED_RSA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7739. AM_CONDITIONAL([BUILD_DH],[test "x$ENABLED_DH" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7740. AM_CONDITIONAL([BUILD_ASN],[test "x$ENABLED_ASN" != "xno" || test "x$ENABLED_RSA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7741. AM_CONDITIONAL([BUILD_AES],[test "x$ENABLED_AES" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7742. AM_CONDITIONAL([BUILD_CODING],[test "x$ENABLED_CODING" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7743. AM_CONDITIONAL([BUILD_RC4],[test "x$ENABLED_ARC4" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7744. AM_CONDITIONAL([BUILD_MD5],[test "x$ENABLED_MD5" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7745. AM_CONDITIONAL([BUILD_SHA],[test "x$ENABLED_SHA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7746. AM_CONDITIONAL([BUILD_FIPS],[test "x$ENABLED_FIPS" = "xyes"])
  7747. AC_SUBST([ENABLED_FIPS])
  7748. AM_CONDITIONAL([BUILD_FIPS_V1],[test "$HAVE_FIPS_VERSION" = 1])
  7749. AM_CONDITIONAL([BUILD_FIPS_V2],[test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 0])
  7750. AM_CONDITIONAL([BUILD_FIPS_RAND],[test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 1])
  7751. AM_CONDITIONAL([BUILD_FIPS_V5],[test "$HAVE_FIPS_VERSION" = 5])
  7752. AM_CONDITIONAL([BUILD_FIPS_CURRENT],[test "$HAVE_FIPS_VERSION" -ge 2 ])
  7753. # BUILD_FIPS_CURRENT is for builds after cert 2425.
  7754. AM_CONDITIONAL([BUILD_SIPHASH],[test "x$ENABLED_SIPHASH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7755. AM_CONDITIONAL([BUILD_CMAC],[test "x$ENABLED_CMAC" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7756. AM_CONDITIONAL([BUILD_SELFTEST],[test "x$ENABLED_SELFTEST" = "xyes"])
  7757. AM_CONDITIONAL([BUILD_SHA224],[test "x$ENABLED_SHA224" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7758. AM_CONDITIONAL([BUILD_SHA3],[test "x$ENABLED_SHA3" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7759. AM_CONDITIONAL([BUILD_POLY1305],[test "x$ENABLED_POLY1305" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7760. AM_CONDITIONAL([BUILD_CHACHA],[test "x$ENABLED_CHACHA" = "xyes" || test "x$ENABLED_CHACHA" = "xnoasm" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7761. AM_CONDITIONAL([BUILD_XCHACHA],[test "x$ENABLED_XCHACHA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7762. AM_CONDITIONAL([BUILD_SM2],[test "x$ENABLED_SM2" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7763. AM_CONDITIONAL([BUILD_SM3],[test "x$ENABLED_SM3" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7764. AM_CONDITIONAL([BUILD_SM4],[test "x$ENABLED_SM4" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7765. AM_CONDITIONAL([BUILD_INLINE],[test "x$ENABLED_INLINE" = "xyes"])
  7766. AM_CONDITIONAL([BUILD_OCSP],[test "x$ENABLED_OCSP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7767. AM_CONDITIONAL([BUILD_OCSP_STAPLING],[test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"])
  7768. AM_CONDITIONAL([BUILD_OCSP_STAPLING_V2],[test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"])
  7769. AM_CONDITIONAL([BUILD_CRL],[test "x$ENABLED_CRL" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7770. AM_CONDITIONAL([BUILD_CRL_MONITOR],[test "x$ENABLED_CRL_MONITOR" = "xyes"])
  7771. AM_CONDITIONAL([BUILD_USER_RSA],[test "x$ENABLED_USER_RSA" = "xyes"] )
  7772. AM_CONDITIONAL([BUILD_USER_CRYPTO],[test "x$ENABLED_USER_CRYPTO" = "xyes"])
  7773. AM_CONDITIONAL([BUILD_LIBLMS],[test "x$ENABLED_LIBLMS" = "xyes"])
  7774. AM_CONDITIONAL([BUILD_LIBOQS],[test "x$ENABLED_LIBOQS" = "xyes"])
  7775. AM_CONDITIONAL([BUILD_WNR],[test "x$ENABLED_WNR" = "xyes"])
  7776. AM_CONDITIONAL([BUILD_SRP],[test "x$ENABLED_SRP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7777. AM_CONDITIONAL([USE_VALGRIND],[test "x$ENABLED_VALGRIND" = "xyes"])
  7778. AM_CONDITIONAL([BUILD_MD4],[test "x$ENABLED_MD4" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7779. AM_CONDITIONAL([BUILD_PWDBASED],[test "x$ENABLED_PWDBASED" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7780. AM_CONDITIONAL([BUILD_SCRYPT],[test "x$ENABLED_SCRYPT" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7781. AM_CONDITIONAL([BUILD_CRYPTONLY],[test "x$ENABLED_CRYPTONLY" = "xyes" && test "x$ENABLED_OPENSSLEXTRA" = "xno"])
  7782. AM_CONDITIONAL([BUILD_FASTMATH],[test "x$ENABLED_FASTMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7783. AM_CONDITIONAL([BUILD_HEAPMATH],[test "x$ENABLED_HEAPMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7784. AM_CONDITIONAL([BUILD_EXAMPLE_SERVERS],[test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
  7785. AM_CONDITIONAL([BUILD_EXAMPLE_CLIENTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
  7786. AM_CONDITIONAL([BUILD_EXAMPLE_ASN1],[test "x$ENABLED_EXAMPLES" = "xyes"] && [test "x$ENABLED_ASN_PRINT" = "xyes"] && [test "x$ENABLED_ASN" = "xyes"])
  7787. AM_CONDITIONAL([BUILD_TESTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
  7788. AM_CONDITIONAL([BUILD_THREADED_EXAMPLES],[test "x$ENABLED_SINGLETHREADED" = "xno" && test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
  7789. AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS],[test "x$ENABLED_CRYPT_TESTS" = "xyes"])
  7790. AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS_LIBS],[test "x$ENABLED_CRYPT_TESTS_LIBS" = "xyes"])
  7791. AM_CONDITIONAL([BUILD_LIBZ],[test "x$ENABLED_LIBZ" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7792. AM_CONDITIONAL([BUILD_PKCS11],[test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7793. AM_CONDITIONAL([BUILD_PKCS12],[test "x$ENABLED_PKCS12" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7794. AM_CONDITIONAL([BUILD_PKCS8],[test "x$ENABLED_PKCS8" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7795. AM_CONDITIONAL([BUILD_CAVIUM],[test "x$ENABLED_CAVIUM" = "xyes"])
  7796. AM_CONDITIONAL([BUILD_CAVIUM_V],[test "x$ENABLED_CAVIUM_V" = "xyes"])
  7797. AM_CONDITIONAL([BUILD_OCTEON_SYNC],[test "x$ENABLED_OCTEON_SYNC" = "xyes"])
  7798. AM_CONDITIONAL([BUILD_INTEL_QA],[test "x$ENABLED_INTEL_QA" = "xyes"])
  7799. AM_CONDITIONAL([BUILD_INTEL_QA_SYNC],[test "x$ENABLED_INTEL_QA_SYNC" = "xyes"])
  7800. INCLUDE_SP_INT="no"
  7801. AM_CONDITIONAL([BUILD_SP],[test "x$ENABLED_SP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7802. AM_CONDITIONAL([BUILD_SP_C32],[ ( ( (test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes" \
  7803. || test "$ENABLED_SP_ECC" = "yes") && test "x$ENABLED_SP_ASM" = "xno") \
  7804. || test "x$ENABLED_USERSETTINGS" = "xyes") && test "x$ENABLED_64BIT" != "xyes"])
  7805. AM_CONDITIONAL([BUILD_SP_C64],[ ( ( (test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes" \
  7806. || test "$ENABLED_SP_ECC" = "yes") && test "x$ENABLED_SP_ASM" = "xno") \
  7807. || test "x$ENABLED_USERSETTINGS" = "xyes") && test "x$ENABLED_32BIT" != "xyes"])
  7808. AM_CONDITIONAL([BUILD_SP_ARM64],[test "x$ENABLED_SP_ARM64_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7809. AM_CONDITIONAL([BUILD_SP_ARM32],[test "x$ENABLED_SP_ARM32_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7810. AM_CONDITIONAL([BUILD_SP_ARM_THUMB],[test "x$ENABLED_SP_ARM_THUMB_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7811. AM_CONDITIONAL([BUILD_SP_ARM_CORTEX],[test "x$ENABLED_SP_ARM_CORTEX_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7812. AM_CONDITIONAL([BUILD_SP_X86_64],[test "x$ENABLED_SP_X86_64_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7813. AM_CONDITIONAL([BUILD_SP_INT],[test "x$ENABLED_SP_MATH" = "xyes" || test "x$ENABLED_SP_MATH_ALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7814. AM_COND_IF([BUILD_SP], [INCLUDE_SP_INT="yes"])
  7815. AM_COND_IF([BUILD_SP_INT], [INCLUDE_SP_INT="yes"])
  7816. AC_SUBST([INCLUDE_SP_INT])
  7817. AM_CONDITIONAL([BUILD_FAST_RSA],[test "x$ENABLED_FAST_RSA" = "xyes"])
  7818. AM_CONDITIONAL([BUILD_MCAPI],[test "x$ENABLED_MCAPI" = "xyes"])
  7819. AM_CONDITIONAL([BUILD_ASYNCCRYPT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"])
  7820. AM_CONDITIONAL([BUILD_WOLFEVENT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"])
  7821. AM_CONDITIONAL([BUILD_CRYPTOCB],[test "x$ENABLED_CRYPTOCB" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7822. AM_CONDITIONAL([BUILD_PSK],[test "x$ENABLED_PSK" = "xyes"])
  7823. AM_CONDITIONAL([BUILD_TRUST_PEER_CERT],[test "x$ENABLED_TRUSTED_PEER_CERT" = "xyes"])
  7824. AM_CONDITIONAL([BUILD_PKI],[test "x$ENABLED_PKI" = "xyes"])
  7825. AM_CONDITIONAL([BUILD_DES3],[test "x$ENABLED_DES3" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7826. AM_CONDITIONAL([BUILD_PKCS7],[test "x$ENABLED_PKCS7" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7827. AM_CONDITIONAL([BUILD_SMIME],[test "x$ENABLED_SMIME" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7828. AM_CONDITIONAL([BUILD_HASHFLAGS],[test "x$ENABLED_HASHFLAGS" = "xyes"])
  7829. AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"])
  7830. AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"])
  7831. AM_CONDITIONAL([BUILD_BENCHMARK],[test "$ENABLED_BENCHMARK" = "yes"])
  7832. AM_CONDITIONAL([BUILD_RC2],[test "x$ENABLED_RC2" = "xyes"])
  7833. AM_CONDITIONAL([BUILD_CAAM],[test "x$ENABLED_CAAM" != "xno"])
  7834. AM_CONDITIONAL([BUILD_QNXCAAM],[test "x$ENABLED_CAAM_QNX" = "xyes"])
  7835. AM_CONDITIONAL([BUILD_IOTSAFE],[test "x$ENABLED_IOTSAFE" = "xyes"])
  7836. AM_CONDITIONAL([BUILD_IOTSAFE_HWRNG],[test "x$ENABLED_IOTSAFE_HWRNG" = "xyes"])
  7837. AM_CONDITIONAL([BUILD_SE050],[test "x$ENABLED_SE050" = "xyes"])
  7838. AM_CONDITIONAL([BUILD_KDF],[test "x$ENABLED_KDF" = "xyes"])
  7839. AM_CONDITIONAL([BUILD_HMAC],[test "x$ENABLED_HMAC" = "xyes"])
  7840. AM_CONDITIONAL([BUILD_ERROR_STRINGS],[test "x$ENABLED_ERROR_STRINGS" = "xyes"])
  7841. AM_CONDITIONAL([BUILD_DO178],[test "x$ENABLED_DO178" = "xyes"])
  7842. AM_CONDITIONAL([BUILD_PSA],[test "x$ENABLED_PSA" = "xyes"])
  7843. AM_CONDITIONAL([BUILD_DTLS13],[test "x$ENABLED_DTLS13" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7844. AM_CONDITIONAL([BUILD_QUIC],[test "x$ENABLED_QUIC" = "xyes"])
  7845. AM_CONDITIONAL([BUILD_DTLS_CID],[test "x$ENABLED_DTLS_CID" = "xyes"])
  7846. AM_CONDITIONAL([BUILD_HPKE],[test "x$ENABLED_HPKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7847. AM_CONDITIONAL([BUILD_DTLS],[test "x$ENABLED_DTLS" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  7848. AM_CONDITIONAL([BUILD_MAXQ10XX],[test "x$ENABLED_MAXQ10XX" = "xyes"])
  7849. AM_CONDITIONAL([BUILD_ARIA],[test "x$ENABLED_ARIA" = "xyes"])
  7850. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes" &&
  7851. (test "$ax_enable_debug" = "yes" ||
  7852. test "$ENABLED_STACKSIZE" != "no" ||
  7853. (test "$ENABLED_LEANTLS" = "no" &&
  7854. test "$ENABLED_LEANPSK" = "no" &&
  7855. test "$ENABLED_LOWRESOURCE" = "no"))
  7856. then
  7857. AM_CFLAGS="$AM_CFLAGS -DHAVE_WC_INTROSPECTION"
  7858. fi
  7859. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes"
  7860. then
  7861. AM_CFLAGS="$AM_CFLAGS -include ${output_objdir}/.build_params"
  7862. fi
  7863. AM_CPPFLAGS="$AM_CPPFLAGS $EXTRA_CPPFLAGS"
  7864. AM_CFLAGS="$AM_CFLAGS $EXTRA_CFLAGS"
  7865. AM_CCASFLAGS="$AM_CCASFLAGS $EXTRA_CCASFLAGS"
  7866. AM_LDFLAGS="$AM_LDFLAGS $EXTRA_LDFLAGS"
  7867. CREATE_HEX_VERSION
  7868. AC_SUBST([AM_CPPFLAGS])
  7869. AC_SUBST([AM_CFLAGS])
  7870. AC_SUBST([AM_LDFLAGS])
  7871. AC_SUBST([AM_CCASFLAGS])
  7872. AC_SUBST([LIB_ADD])
  7873. AC_SUBST([LIB_STATIC_ADD])
  7874. # FINAL
  7875. AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
  7876. AC_CONFIG_FILES([Makefile
  7877. wolfssl/version.h
  7878. wolfssl/options.h
  7879. support/wolfssl.pc
  7880. debian/control
  7881. debian/changelog
  7882. rpm/spec
  7883. wolfcrypt/test/test_paths.h
  7884. ])
  7885. AC_CONFIG_FILES([scripts/unit.test],[chmod +x scripts/unit.test])
  7886. AX_CREATE_GENERIC_CONFIG
  7887. AX_AM_JOBSERVER([yes])
  7888. # See Automake 9.4.1 Built Sources Example
  7889. AC_DEFUN([AX_OUT_OF_TREE_FILE],[
  7890. AC_CONFIG_COMMANDS([$1], [test ! -f $srcdir/$1 && >> $srcdir/$1])
  7891. ])
  7892. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/async.h])
  7893. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/fips.h])
  7894. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h])
  7895. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/intel/quickassist.h])
  7896. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/intel/quickassist_mem.h])
  7897. AC_OUTPUT
  7898. if test "$ENABLED_MAKECLEAN" = "yes"
  7899. then
  7900. # force make clean
  7901. AC_MSG_NOTICE([---])
  7902. AC_MSG_NOTICE([Running make clean...])
  7903. if test -z "$MAKE"; then
  7904. MAKE="make"
  7905. fi
  7906. if test "$verbose" = "yes"; then
  7907. $MAKE clean
  7908. else
  7909. $MAKE clean >/dev/null
  7910. fi
  7911. fi
  7912. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes"
  7913. then
  7914. ESCAPED_ARGS=$(echo "$ac_configure_args" | sed 's/\\/\\\\/g;s/\"/\\\"/g')
  7915. ESCAPED_GLOBAL_CFLAGS=$(echo "$CPPFLAGS $AM_CPPFLAGS $CFLAGS $AM_CFLAGS" | sed 's/\\/\\\\/g;s/\"/\\\"/g')
  7916. echo "#define LIBWOLFSSL_CONFIGURE_ARGS \"$ESCAPED_ARGS\"" > "${output_objdir}/.build_params" &&
  7917. echo "#define LIBWOLFSSL_GLOBAL_CFLAGS \"$ESCAPED_GLOBAL_CFLAGS\" LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS" >> "${output_objdir}/.build_params" ||
  7918. AC_MSG_ERROR([Couldn't create ${output_objdir}/.build_params.])
  7919. else
  7920. rm -f "${output_objdir}/.build_params"
  7921. fi
  7922. # generate user options header
  7923. AC_MSG_NOTICE([---])
  7924. AC_MSG_NOTICE([Generating user options header...])
  7925. OPTION_FILE="wolfssl/options.h"
  7926. rm -f $OPTION_FILE
  7927. echo "/* wolfssl options.h" > $OPTION_FILE
  7928. echo " * generated from configure options" >> $OPTION_FILE
  7929. echo " *" >> $OPTION_FILE
  7930. echo " * Copyright (C) 2006-2023 wolfSSL Inc." >> $OPTION_FILE
  7931. echo " *" >> $OPTION_FILE
  7932. echo " * This file is part of wolfSSL. (formerly known as CyaSSL)" >> $OPTION_FILE
  7933. echo " *" >> $OPTION_FILE
  7934. echo " */" >> $OPTION_FILE
  7935. echo "" >> $OPTION_FILE
  7936. echo "#ifndef WOLFSSL_OPTIONS_H" >> $OPTION_FILE
  7937. echo "#define WOLFSSL_OPTIONS_H" >> $OPTION_FILE
  7938. echo "" >> $OPTION_FILE
  7939. echo "" >> $OPTION_FILE
  7940. echo "#ifdef __cplusplus" >> $OPTION_FILE
  7941. echo "extern \"C\" {" >> $OPTION_FILE
  7942. echo "#endif" >> $OPTION_FILE
  7943. echo "" >> $OPTION_FILE
  7944. # Check for supported command to trim option with.
  7945. # note: cut requires an argument to exit with success.
  7946. if colrm >/dev/null 2>&1 </dev/null; then
  7947. TRIM="colrm 3"
  7948. elif cut --version >/dev/null 2>&1 </dev/null; then
  7949. TRIM="cut -c1-2"
  7950. else
  7951. AC_MSG_ERROR([Could not find colrm or cut to make options file])
  7952. fi
  7953. for option in $CPPFLAGS $AM_CPPFLAGS $CFLAGS $AM_CFLAGS; do
  7954. opt_type=$(echo $option | $TRIM )
  7955. case "$opt_type" in
  7956. -D)
  7957. option=$(echo "$option" | tr -d '\\')
  7958. RHS_only=$(echo "$option" | sed 's/^-D//')
  7959. noequalsign=$(echo "$RHS_only" | tr '=' ' ')
  7960. if test "$noequalsign" = "NDEBUG" || test "$noequalsign" = "DEBUG"
  7961. then
  7962. if test "$verbose" = "yes"; then
  7963. AC_MSG_NOTICE([not outputting (N)DEBUG to $OPTION_FILE])
  7964. fi
  7965. continue
  7966. fi
  7967. # allow user to ignore system options
  7968. ignoresys=$(echo "$noequalsign" | grep '^_.*')
  7969. if test -n "$ignoresys"
  7970. then
  7971. echo "#ifndef WOLFSSL_OPTIONS_IGNORE_SYS" >> $OPTION_FILE
  7972. fi
  7973. # note need to use both autotools-style [] quoting and shell-style ''
  7974. # quoting for sed script with [] character set expression here.
  7975. noarg=$(echo "$RHS_only" | sed ['s/\(([^=)]*)\)\{0,1\}=.*//'])
  7976. echo "#undef $noarg" >> $OPTION_FILE
  7977. echo "#define $noequalsign" >> $OPTION_FILE
  7978. if test -n "$ignoresys"
  7979. then
  7980. echo "#endif" >> $OPTION_FILE
  7981. fi
  7982. echo "" >> $OPTION_FILE
  7983. ;;
  7984. -U)
  7985. RHS_only=$(echo $option | sed 's/^-U//')
  7986. echo "#undef $RHS_only" >> $OPTION_FILE
  7987. echo "" >> $OPTION_FILE
  7988. ;;
  7989. *)
  7990. if test "$verbose" = "yes"; then
  7991. AC_MSG_NOTICE([option "$option" is not a preprocessor directive -- not saving to $OPTION_FILE])
  7992. fi
  7993. ;;
  7994. esac
  7995. done
  7996. echo "" >> $OPTION_FILE
  7997. echo "#ifdef __cplusplus" >> $OPTION_FILE
  7998. echo "}" >> $OPTION_FILE
  7999. echo "#endif" >> $OPTION_FILE
  8000. echo "" >> $OPTION_FILE
  8001. echo "" >> $OPTION_FILE
  8002. echo "#endif /* WOLFSSL_OPTIONS_H */" >> $OPTION_FILE
  8003. echo "" >> $OPTION_FILE
  8004. if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_LINUXKM" = "no"
  8005. then
  8006. SAVE_CFLAGS=$CFLAGS
  8007. CFLAGS="$CFLAGS $DEFS -I. -I$srcdir"
  8008. if test "$ENABLED_INTEL_QA" = "yes"
  8009. then
  8010. CFLAGS="$CFLAGS $QAT_FLAGS"
  8011. fi
  8012. build_pwd="$(pwd)"
  8013. cd "$srcdir"
  8014. openssl_headers=$(echo wolfssl/openssl/*.h)
  8015. cd "$build_pwd"
  8016. for header in $openssl_headers
  8017. do
  8018. AC_CHECK_HEADER([$header], [], [
  8019. AC_MSG_ERROR([Header file inconsistency detected -- error including ${header}.])
  8020. ], [
  8021. #include <${OPTION_FILE}>
  8022. extern int dummy_int_to_make_compiler_happy;
  8023. ])
  8024. done
  8025. CFLAGS=$SAVE_CFLAGS
  8026. fi
  8027. if test "$silent" != "yes"; then
  8028. # output config summary
  8029. echo "---"
  8030. echo "Configuration summary for $PACKAGE_NAME version $VERSION"
  8031. echo ""
  8032. echo " * Installation prefix: $prefix"
  8033. echo " * System type: $host_vendor-$host_os"
  8034. echo " * Host CPU: $host_cpu"
  8035. echo " * C Compiler: $CC"
  8036. echo " * C Flags: $CFLAGS"
  8037. echo " * C++ Compiler: $CXX"
  8038. echo " * C++ Flags: $CXXFLAGS"
  8039. echo " * CPP Flags: $CPPFLAGS"
  8040. echo " * CCAS Flags: $CCASFLAGS"
  8041. echo " * LD Flags: $LDFLAGS"
  8042. echo " * LIB Flags: $LIB"
  8043. echo " * Library Suffix: $LIBSUFFIX"
  8044. test "$ENABLED_LINUXKM" = "yes" && \
  8045. echo " * Linux Kernel Build Root: $KERNEL_ROOT" && \
  8046. echo " * Linux Kernel Build Arch: $KERNEL_ARCH" && \
  8047. echo " * fpu disable C flags: $CFLAGS_FPU_DISABLE" && \
  8048. echo " * fpu enable C flags: $CFLAGS_FPU_ENABLE" && \
  8049. echo " * SIMD disable C flags: $CFLAGS_SIMD_DISABLE" && \
  8050. echo " * SIMD enable C flags: $CFLAGS_SIMD_ENABLE" && \
  8051. echo " * No-auto-vectorize C flags: $CFLAGS_AUTO_VECTORIZE_DISABLE" && \
  8052. echo " * Auto-vectorize C flags: $CFLAGS_AUTO_VECTORIZE_ENABLE" && \
  8053. echo " * SIMD enable as flags: $ASFLAGS_FPU_DISABLE_SIMD_ENABLE" && \
  8054. echo " * FPU enable as flags: $ASFLAGS_FPU_ENABLE_SIMD_DISABLE" && \
  8055. echo " * SIMD+FPU disable as flags: $ASFLAGS_FPUSIMD_DISABLE" && \
  8056. echo " * SIMD+FPU enable as flags: $ASFLAGS_FPUSIMD_ENABLE" && \
  8057. echo " * Linux kernel module PIE: $ENABLED_LINUXKM_PIE"
  8058. echo " * Linux kernel module bench: $ENABLED_LINUXKM_BENCHMARKS"
  8059. echo " * Debug enabled: $ax_enable_debug"
  8060. echo " * Coverage enabled: $ax_enable_coverage"
  8061. echo " * Warnings as failure: $ac_cv_warnings_as_errors"
  8062. echo " * make -j: $enable_jobserver"
  8063. echo " * VCS checkout: $ac_cv_vcs_checkout"
  8064. echo
  8065. echo " Features "
  8066. if test "$ENABLED_FIPS" = "yes"; then
  8067. echo " * FIPS: $FIPS_VERSION"
  8068. else
  8069. echo " * FIPS: $ENABLED_FIPS"
  8070. fi
  8071. echo " * Single threaded: $ENABLED_SINGLETHREADED"
  8072. echo " * Filesystem: $ENABLED_FILESYSTEM"
  8073. echo " * OpenSSH Build: $ENABLED_OPENSSH"
  8074. echo " * OpenSSL Extra API: $ENABLED_OPENSSLEXTRA"
  8075. echo " * OpenSSL Coexist: $ENABLED_OPENSSLCOEXIST"
  8076. echo " * Old Names: $ENABLED_OLDNAMES"
  8077. echo " * Max Strength Build: $ENABLED_MAXSTRENGTH"
  8078. echo " * Distro Build: $ENABLED_DISTRO"
  8079. echo " * Reproducible Build: $ENABLED_REPRODUCIBLE_BUILD"
  8080. echo " * Side-channel Hardening: $ENABLED_HARDEN"
  8081. echo " * Single Precision Math: $ENABLED_SP"
  8082. if test "$ENABLED_SP_MATH_ALL" != "no"
  8083. then
  8084. ENABLED_SP_MATH_DESC="all"
  8085. else
  8086. if test "$ENABLED_SP_MATH" != "no"
  8087. then
  8088. ENABLED_SP_MATH_DESC="restricted"
  8089. else
  8090. ENABLED_SP_MATH_DESC="no"
  8091. fi
  8092. fi
  8093. echo " * SP implementation: $ENABLED_SP_MATH_DESC"
  8094. echo " * Fast Math: $ENABLED_FASTMATH"
  8095. echo " * Heap Math: $ENABLED_HEAPMATH"
  8096. echo " * Assembly Allowed: $ENABLED_ASM"
  8097. echo " * sniffer: $ENABLED_SNIFFER"
  8098. echo " * snifftest: $ENABLED_SNIFFTEST"
  8099. echo " * ARC4: $ENABLED_ARC4"
  8100. echo " * AES: $ENABLED_AES"
  8101. echo " * AES-NI: $ENABLED_AESNI"
  8102. echo " * AES-CBC: $ENABLED_AESCBC"
  8103. echo " * AES-CBC length checks: $ENABLED_AESCBC_LENGTH_CHECKS"
  8104. echo " * AES-GCM: $ENABLED_AESGCM"
  8105. echo " * AES-GCM streaming: $ENABLED_AESGCM_STREAM"
  8106. echo " * AES-CCM: $ENABLED_AESCCM"
  8107. echo " * AES-CTR: $ENABLED_AESCTR"
  8108. echo " * AES-CFB: $ENABLED_AESCFB"
  8109. echo " * AES-OFB: $ENABLED_AESOFB"
  8110. echo " * AES-SIV: $ENABLED_AESSIV"
  8111. echo " * ARIA: $ENABLED_ARIA"
  8112. echo " * DES3: $ENABLED_DES3"
  8113. echo " * Camellia: $ENABLED_CAMELLIA"
  8114. echo " * SM4-ECB: $ENABLED_SM4_ECB"
  8115. echo " * SM4-CBC: $ENABLED_SM4_CBC"
  8116. echo " * SM4-CTR: $ENABLED_SM4_CTR"
  8117. echo " * SM4-GCM: $ENABLED_SM4_GCM"
  8118. echo " * SM4-CCM: $ENABLED_SM4_CCM"
  8119. echo " * NULL Cipher: $ENABLED_NULL_CIPHER"
  8120. echo " * MD2: $ENABLED_MD2"
  8121. echo " * MD4: $ENABLED_MD4"
  8122. echo " * MD5: $ENABLED_MD5"
  8123. echo " * RIPEMD: $ENABLED_RIPEMD"
  8124. echo " * SHA: $ENABLED_SHA"
  8125. echo " * SHA-224: $ENABLED_SHA224"
  8126. echo " * SHA-384: $ENABLED_SHA384"
  8127. echo " * SHA-512: $ENABLED_SHA512"
  8128. echo " * SHA3: $ENABLED_SHA3"
  8129. echo " * SHAKE128: $ENABLED_SHAKE128"
  8130. echo " * SHAKE256: $ENABLED_SHAKE256"
  8131. echo " * SM3: $ENABLED_SM3"
  8132. echo " * BLAKE2: $ENABLED_BLAKE2"
  8133. echo " * BLAKE2S: $ENABLED_BLAKE2S"
  8134. echo " * SipHash: $ENABLED_SIPHASH"
  8135. echo " * CMAC: $ENABLED_CMAC"
  8136. echo " * keygen: $ENABLED_KEYGEN"
  8137. echo " * certgen: $ENABLED_CERTGEN"
  8138. echo " * certreq: $ENABLED_CERTREQ"
  8139. echo " * certext: $ENABLED_CERTEXT"
  8140. echo " * certgencache: $ENABLED_certgencache"
  8141. echo " * CHACHA: $ENABLED_CHACHA"
  8142. echo " * XCHACHA: $ENABLED_XCHACHA"
  8143. echo " * Hash DRBG: $ENABLED_HASHDRBG"
  8144. echo " * MmemUse Entropy: $ENABLED_ENTROPY_MEMUSE"
  8145. echo " * PWDBASED: $ENABLED_PWDBASED"
  8146. echo " * Encrypted keys: $ENABLED_ENCKEYS"
  8147. echo " * scrypt: $ENABLED_SCRYPT"
  8148. echo " * wolfCrypt Only: $ENABLED_CRYPTONLY"
  8149. echo " * HKDF: $ENABLED_HKDF"
  8150. echo " * HPKE: $ENABLED_HPKE"
  8151. echo " * X9.63 KDF: $ENABLED_X963KDF"
  8152. echo " * PSK: $ENABLED_PSK"
  8153. echo " * Poly1305: $ENABLED_POLY1305"
  8154. echo " * LEANPSK: $ENABLED_LEANPSK"
  8155. echo " * LEANTLS: $ENABLED_LEANTLS"
  8156. echo " * RSA: $ENABLED_RSA"
  8157. echo " * RSA-PSS: $ENABLED_RSAPSS"
  8158. echo " * DSA: $ENABLED_DSA"
  8159. echo " * DH: $ENABLED_DH"
  8160. echo " * DH Default Parameters: $ENABLED_DHDEFAULTPARAMS"
  8161. echo " * ECC: $ENABLED_ECC"
  8162. echo " * ECC Custom Curves: $ENABLED_ECCCUSTCURVES"
  8163. echo " * ECC Minimum Bits: $ENABLED_ECCMINSZ"
  8164. echo " * FPECC: $ENABLED_FPECC"
  8165. echo " * ECC_ENCRYPT: $ENABLED_ECC_ENCRYPT"
  8166. echo " * Brainpool: $ENABLED_BRAINPOOL"
  8167. echo " * SM2: $ENABLED_SM2"
  8168. echo " * CURVE25519: $ENABLED_CURVE25519"
  8169. echo " * ED25519: $ENABLED_ED25519"
  8170. echo " * ED25519 streaming: $ENABLED_ED25519_STREAM"
  8171. echo " * CURVE448: $ENABLED_CURVE448"
  8172. echo " * ED448: $ENABLED_ED448"
  8173. echo " * ED448 streaming: $ENABLED_ED448_STREAM"
  8174. echo " * LMS: $ENABLED_LMS"
  8175. echo " * LMS wolfSSL impl: $ENABLED_WC_LMS"
  8176. echo " * KYBER: $ENABLED_KYBER"
  8177. echo " * KYBER wolfSSL impl: $ENABLED_WC_KYBER"
  8178. echo " * ECCSI $ENABLED_ECCSI"
  8179. echo " * SAKKE $ENABLED_SAKKE"
  8180. echo " * ASN: $ENABLED_ASN"
  8181. echo " * Anonymous cipher: $ENABLED_ANON"
  8182. echo " * CODING: $ENABLED_CODING"
  8183. echo " * MEMORY: $ENABLED_MEMORY"
  8184. echo " * I/O POOL: $ENABLED_IOPOOL"
  8185. echo " * wolfSentry: $ENABLED_WOLFSENTRY"
  8186. echo " * LIGHTY: $ENABLED_LIGHTY"
  8187. echo " * WPA Supplicant: $ENABLED_WPAS"
  8188. echo " * HAPROXY: $ENABLED_HAPROXY"
  8189. echo " * STUNNEL: $ENABLED_STUNNEL"
  8190. echo " * tcpdump: $ENABLED_TCPDUMP"
  8191. echo " * libssh2: $ENABLED_LIBSSH2"
  8192. echo " * ntp: $ENABLED_NTP"
  8193. echo " * rsyslog: $ENABLED_RSYSLOG"
  8194. echo " * Apache httpd: $ENABLED_APACHE_HTTPD"
  8195. echo " * NGINX: $ENABLED_NGINX"
  8196. echo " * OpenResty: $ENABLED_OPENRESTY"
  8197. echo " * ASIO: $ENABLED_ASIO"
  8198. echo " * LIBWEBSOCKETS: $ENABLED_LIBWEBSOCKETS"
  8199. echo " * Qt: $ENABLED_QT"
  8200. echo " * Qt Unit Testing: $ENABLED_QT_TEST"
  8201. echo " * SIGNAL: $ENABLED_SIGNAL"
  8202. echo " * chrony: $ENABLED_CHRONY"
  8203. echo " * strongSwan: $ENABLED_STRONGSWAN"
  8204. echo " * OpenLDAP: $ENABLED_OPENLDAP"
  8205. echo " * hitch: $ENABLED_HITCH"
  8206. echo " * ERROR_STRINGS: $ENABLED_ERROR_STRINGS"
  8207. echo " * DTLS: $ENABLED_DTLS"
  8208. echo " * DTLS v1.3: $ENABLED_DTLS13"
  8209. echo " * SCTP: $ENABLED_SCTP"
  8210. echo " * SRTP: $ENABLED_SRTP"
  8211. echo " * Indefinite Length: $ENABLED_BER_INDEF"
  8212. echo " * Multicast: $ENABLED_MCAST"
  8213. echo " * SSL v3.0 (Old): $ENABLED_SSLV3"
  8214. echo " * TLS v1.0 (Old): $ENABLED_TLSV10"
  8215. echo " * TLS v1.1 (Old): $ENABLED_OLD_TLS"
  8216. echo " * TLS v1.2: $ENABLED_TLSV12"
  8217. echo " * TLS v1.3: $ENABLED_TLS13"
  8218. echo " * Post-handshake Auth: $ENABLED_TLS13_POST_AUTH"
  8219. echo " * Early Data: $ENABLED_TLS13_EARLY_DATA"
  8220. echo " * QUIC: $ENABLED_QUIC"
  8221. echo " * Send State in HRR Cookie: $ENABLED_SEND_HRR_COOKIE"
  8222. echo " * OCSP: $ENABLED_OCSP"
  8223. echo " * OCSP Stapling: $ENABLED_CERTIFICATE_STATUS_REQUEST"
  8224. echo " * OCSP Stapling v2: $ENABLED_CERTIFICATE_STATUS_REQUEST_V2"
  8225. echo " * CRL: $ENABLED_CRL"
  8226. echo " * CRL-MONITOR: $ENABLED_CRL_MONITOR"
  8227. echo " * Persistent session cache: $ENABLED_SAVESESSION"
  8228. echo " * Persistent cert cache: $ENABLED_SAVECERT"
  8229. echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
  8230. echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
  8231. echo " * liblms: $ENABLED_LIBLMS"
  8232. echo " * liboqs: $ENABLED_LIBOQS"
  8233. echo " * Whitewood netRandom: $ENABLED_WNR"
  8234. echo " * Server Name Indication: $ENABLED_SNI"
  8235. echo " * ALPN: $ENABLED_ALPN"
  8236. echo " * Maximum Fragment Length: $ENABLED_MAX_FRAGMENT"
  8237. echo " * Trusted CA Indication: $ENABLED_TRUSTED_CA"
  8238. echo " * Truncated HMAC: $ENABLED_TRUNCATED_HMAC"
  8239. echo " * Supported Elliptic Curves: $ENABLED_SUPPORTED_CURVES"
  8240. echo " * FFDHE only in client: $ENABLED_FFDHE_ONLY"
  8241. echo " * Session Ticket: $ENABLED_SESSION_TICKET"
  8242. echo " * Extended Master Secret: $ENABLED_EXTENDED_MASTER"
  8243. echo " * Renegotiation Indication: $ENABLED_RENEGOTIATION_INDICATION"
  8244. echo " * Secure Renegotiation: $ENABLED_SECURE_RENEGOTIATION"
  8245. echo " * Fallback SCSV: $ENABLED_FALLBACK_SCSV"
  8246. echo " * Keying Material Exporter: $ENABLED_KEYING_MATERIAL"
  8247. echo " * All TLS Extensions: $ENABLED_TLSX"
  8248. echo " * PKCS#7: $ENABLED_PKCS7"
  8249. echo " * S/MIME: $ENABLED_SMIME"
  8250. echo " * wolfSSH: $ENABLED_WOLFSSH"
  8251. echo " * wolfEngine: $ENABLED_WOLFENGINE"
  8252. echo " * wolfTPM: $ENABLED_WOLFTPM"
  8253. echo " * wolfCLU: $ENABLED_WOLFCLU"
  8254. echo " * wolfSCEP: $ENABLED_WOLFSCEP"
  8255. echo " * Secure Remote Password: $ENABLED_SRP"
  8256. echo " * Small Stack: $ENABLED_SMALL_STACK"
  8257. echo " * Linux Kernel Module: $ENABLED_LINUXKM"
  8258. echo " * valgrind unit tests: $ENABLED_VALGRIND"
  8259. echo " * LIBZ: $ENABLED_LIBZ"
  8260. echo " * Examples: $ENABLED_EXAMPLES"
  8261. echo " * Crypt tests: $ENABLED_CRYPT_TESTS"
  8262. echo " * Stack sizes in tests: $ENABLED_STACKSIZE"
  8263. echo " * Heap stats in tests: $ENABLED_TRACKMEMORY"
  8264. echo " * User Crypto: $ENABLED_USER_CRYPTO"
  8265. echo " * Fast RSA: $ENABLED_FAST_RSA"
  8266. echo " * Asynchronous Crypto: $ENABLED_ASYNCCRYPT"
  8267. echo " * Asynchronous Crypto (sim): $ENABLED_ASYNCCRYPT_SW"
  8268. echo " * PKCS#8: $ENABLED_PKCS8"
  8269. echo " * PKCS#11: $ENABLED_PKCS11"
  8270. echo " * PKCS#12: $ENABLED_PKCS12"
  8271. echo " * Cavium Nitrox: $ENABLED_CAVIUM"
  8272. echo " * Cavium Octeon (Sync): $ENABLED_OCTEON_SYNC"
  8273. echo " * Intel Quick Assist: $ENABLED_INTEL_QA"
  8274. if test "$ENABLED_ARMASM_INLINE" = "yes"
  8275. then
  8276. ENABLED_ARMASM="inline C"
  8277. fi
  8278. echo " * ARM ASM: $ENABLED_ARMASM"
  8279. echo " * ARM ASM SHA512/SHA3 Crypto $ENABLED_ARMASM_SHA3"
  8280. echo " * ARM ASM SM3/SM4 Crypto $ENABLED_ARMASM_CRYPTO_SM4"
  8281. echo " * AES Key Wrap: $ENABLED_AESKEYWRAP"
  8282. echo " * Write duplicate: $ENABLED_WRITEDUP"
  8283. echo " * Xilinx Hardware Acc.: $ENABLED_XILINX"
  8284. echo " * Inline Code: $ENABLED_INLINE"
  8285. echo " * Linux AF_ALG: $ENABLED_AFALG"
  8286. echo " * Linux KCAPI: $ENABLED_KCAPI"
  8287. echo " * Linux devcrypto: $ENABLED_DEVCRYPTO"
  8288. echo " * PK callbacks: $ENABLED_PKCALLBACKS"
  8289. echo " * Crypto callbacks: $ENABLED_CRYPTOCB"
  8290. echo " * i.MX CAAM: $ENABLED_CAAM"
  8291. echo " * IoT-Safe: $ENABLED_IOTSAFE"
  8292. echo " * IoT-Safe HWRNG: $ENABLED_IOTSAFE_HWRNG"
  8293. echo " * NXP SE050: $ENABLED_SE050"
  8294. echo " * Maxim Integrated MAXQ10XX: $ENABLED_MAXQ10XX"
  8295. echo " * PSA: $ENABLED_PSA"
  8296. echo " * System CA certs: $ENABLED_SYS_CA_CERTS"
  8297. echo " * ERR Queues per Thread: $ENABLED_ERRORQUEUEPERTHREAD"
  8298. echo " * rwlock: $ENABLED_RWLOCK"
  8299. echo " * keylog export: $ENABLED_KEYLOG_EXPORT"
  8300. echo ""
  8301. echo "---"
  8302. fi # $silent != yes
  8303. ################################################################################
  8304. # Show warnings at bottom so they are noticed
  8305. ################################################################################
  8306. if test "$ENABLED_ASYNCCRYPT" = "yes" && ! test -s $srcdir/wolfcrypt/src/async.c
  8307. then
  8308. AC_MSG_WARN([Make sure real async files are loaded. Contact wolfSSL for details on using the asynccrypt option.])
  8309. fi
  8310. # MinGW static vs shared library
  8311. # Reference URL from libtool for MinGW is located at
  8312. # http://www.gnu.org/software/libtool/manual/libtool.html#Cygwin-to-MinGW-Cross
  8313. # this allows for not even having dllimport/dllexport on functions
  8314. # with recent libtools, only requiring it with global variables.
  8315. #
  8316. # The following warning is displayed here because if not using "contemporary GNU
  8317. # tools" there is the possibility of export/import issues.
  8318. # wolfSSL uses __declspec(dllexport) and "contemporary GNU tools" handle the
  8319. # case where both static and shared libraries are built.
  8320. #
  8321. # More can be found about the MinGW linker at
  8322. # https://sourceware.org/binutils/docs/ld/WIN32.html
  8323. if test "$MINGW_LIB_WARNING" = "yes"
  8324. then
  8325. AC_MSG_WARN([Building with shared and static library at the same time on this system may cause export/import problems when using non contemporary GNU tools.])
  8326. fi