configure.ac 322 KB

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