configure.ac 321 KB

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