configure.ac 308 KB

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