configure.ac 281 KB

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