configure.ac 246 KB

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