configure.ac 333 KB

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