configure.ac 227 KB

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