configure.ac 337 KB

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