configure.ac 311 KB

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