configure.ac 324 KB

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