configure.ac 209 KB

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