configure.ac 328 KB

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