configure.ac 315 KB

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