configure.ac 243 KB

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