configure.ac 343 KB

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