configure.ac 241 KB

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