configure.ac 310 KB

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