configure.ac 306 KB

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