configure.ac 279 KB

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