configure.ac 331 KB

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