configure.ac 287 KB

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