configure.ac 309 KB

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