configure.ac 275 KB

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