configure.ac 271 KB

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