configure.ac 322 KB

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