2
0

configure.ac 343 KB

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