configure.ac 269 KB

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