configure.ac 243 KB

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