configure.ac 340 KB

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