configure.ac 273 KB

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