1
0

configure.ac 324 KB

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