configure.ac 284 KB

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