configure.ac 298 KB

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