configure.ac 271 KB

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