configure.ac 280 KB

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