configure.ac 255 KB

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