configure.ac 289 KB

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