Makefile 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
  10. ifndef LIBS_c
  11. LIBS_c := $(LIBS)
  12. endif
  13. ifndef LIBS_p
  14. LIBS_p := $(LIBS)
  15. endif
  16. endif
  17. export LIBDIR ?= /usr/local/lib/
  18. export INCDIR ?= /usr/local/include/
  19. export BINDIR ?= /usr/local/sbin/
  20. PKG_CONFIG ?= pkg-config
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. -include .config
  25. ifndef CONFIG_NO_GITVER
  26. # Add VERSION_STR postfix for builds from a git repository
  27. ifeq ($(wildcard ../.git),../.git)
  28. GITVER := $(shell git describe --dirty=+)
  29. ifneq ($(GITVER),)
  30. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  31. endif
  32. endif
  33. endif
  34. ifdef CONFIG_TESTING_OPTIONS
  35. CFLAGS += -DCONFIG_TESTING_OPTIONS
  36. CONFIG_WPS_TESTING=y
  37. CONFIG_TDLS_TESTING=y
  38. endif
  39. BINALL=wpa_supplicant wpa_cli
  40. ifndef CONFIG_NO_WPA_PASSPHRASE
  41. BINALL += wpa_passphrase
  42. endif
  43. ALL = $(BINALL)
  44. ALL += systemd/wpa_supplicant.service
  45. ALL += systemd/wpa_supplicant@.service
  46. ALL += systemd/wpa_supplicant-nl80211@.service
  47. ALL += systemd/wpa_supplicant-wired@.service
  48. ALL += dbus/fi.epitest.hostap.WPASupplicant.service
  49. ALL += dbus/fi.w1.wpa_supplicant1.service
  50. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  51. ALL += libwpa_client.so
  52. endif
  53. all: verify_config $(ALL) dynamic_eap_methods
  54. verify_config:
  55. @if [ ! -r .config ]; then \
  56. echo 'Building wpa_supplicant requires a configuration file'; \
  57. echo '(.config). See README for more instructions. You can'; \
  58. echo 'run "cp defconfig .config" to create an example'; \
  59. echo 'configuration.'; \
  60. exit 1; \
  61. fi
  62. mkconfig:
  63. @if [ -f .config ]; then \
  64. echo '.config exists - did not replace it'; \
  65. exit 1; \
  66. fi
  67. echo CONFIG_DRIVER_HOSTAP=y >> .config
  68. echo CONFIG_DRIVER_WEXT=y >> .config
  69. $(DESTDIR)$(BINDIR)/%: %
  70. install -D $(<) $(@)
  71. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
  72. $(MAKE) -C ../src install
  73. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  74. install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
  75. install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
  76. endif
  77. ifdef CONFIG_FIPS
  78. CONFIG_NO_RANDOM_POOL=
  79. CONFIG_OPENSSL_CMAC=y
  80. endif
  81. OBJS = config.o
  82. OBJS += notify.o
  83. OBJS += bss.o
  84. OBJS += eap_register.o
  85. OBJS += ../src/utils/common.o
  86. OBJS += ../src/utils/wpa_debug.o
  87. OBJS += ../src/utils/wpabuf.o
  88. OBJS += ../src/utils/bitfield.o
  89. OBJS += op_classes.o
  90. OBJS += rrm.o
  91. OBJS_p = wpa_passphrase.o
  92. OBJS_p += ../src/utils/common.o
  93. OBJS_p += ../src/utils/wpa_debug.o
  94. OBJS_p += ../src/utils/wpabuf.o
  95. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  96. OBJS_c += ../src/utils/wpa_debug.o
  97. OBJS_c += ../src/utils/common.o
  98. OBJS_c += ../src/common/cli.o
  99. OBJS += wmm_ac.o
  100. ifndef CONFIG_OS
  101. ifdef CONFIG_NATIVE_WINDOWS
  102. CONFIG_OS=win32
  103. else
  104. CONFIG_OS=unix
  105. endif
  106. endif
  107. ifeq ($(CONFIG_OS), internal)
  108. CFLAGS += -DOS_NO_C_LIB_DEFINES
  109. endif
  110. OBJS += ../src/utils/os_$(CONFIG_OS).o
  111. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  112. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  113. ifdef CONFIG_WPA_TRACE
  114. CFLAGS += -DWPA_TRACE
  115. OBJS += ../src/utils/trace.o
  116. OBJS_p += ../src/utils/trace.o
  117. OBJS_c += ../src/utils/trace.o
  118. OBJS_priv += ../src/utils/trace.o
  119. LIBCTRL += ../src/utils/trace.o
  120. LIBCTRLSO += ../src/utils/trace.c
  121. LDFLAGS += -rdynamic
  122. CFLAGS += -funwind-tables
  123. ifdef CONFIG_WPA_TRACE_BFD
  124. CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
  125. LIBS += -lbfd -ldl -liberty -lz
  126. LIBS_p += -lbfd -ldl -liberty -lz
  127. LIBS_c += -lbfd -ldl -liberty -lz
  128. endif
  129. endif
  130. ifndef CONFIG_ELOOP
  131. CONFIG_ELOOP=eloop
  132. endif
  133. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  134. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  135. ifndef CONFIG_OSX
  136. ifeq ($(CONFIG_ELOOP), eloop)
  137. # Using glibc < 2.17 requires -lrt for clock_gettime()
  138. # OS X has an alternate implementation
  139. LIBS += -lrt
  140. LIBS_c += -lrt
  141. LIBS_p += -lrt
  142. endif
  143. endif
  144. ifdef CONFIG_ELOOP_POLL
  145. CFLAGS += -DCONFIG_ELOOP_POLL
  146. endif
  147. ifdef CONFIG_ELOOP_EPOLL
  148. CFLAGS += -DCONFIG_ELOOP_EPOLL
  149. endif
  150. ifdef CONFIG_ELOOP_KQUEUE
  151. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  152. endif
  153. ifdef CONFIG_EAPOL_TEST
  154. CFLAGS += -Werror -DEAPOL_TEST
  155. endif
  156. ifdef CONFIG_CODE_COVERAGE
  157. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  158. LIBS += -lgcov
  159. LIBS_c += -lgcov
  160. LIBS_p += -lgcov
  161. endif
  162. ifdef CONFIG_HT_OVERRIDES
  163. CFLAGS += -DCONFIG_HT_OVERRIDES
  164. endif
  165. ifdef CONFIG_VHT_OVERRIDES
  166. CFLAGS += -DCONFIG_VHT_OVERRIDES
  167. endif
  168. ifndef CONFIG_BACKEND
  169. CONFIG_BACKEND=file
  170. endif
  171. ifeq ($(CONFIG_BACKEND), file)
  172. OBJS += config_file.o
  173. ifndef CONFIG_NO_CONFIG_BLOBS
  174. NEED_BASE64=y
  175. endif
  176. CFLAGS += -DCONFIG_BACKEND_FILE
  177. endif
  178. ifeq ($(CONFIG_BACKEND), winreg)
  179. OBJS += config_winreg.o
  180. endif
  181. ifeq ($(CONFIG_BACKEND), none)
  182. OBJS += config_none.o
  183. endif
  184. ifdef CONFIG_NO_CONFIG_WRITE
  185. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  186. endif
  187. ifdef CONFIG_NO_CONFIG_BLOBS
  188. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  189. endif
  190. ifdef CONFIG_NO_SCAN_PROCESSING
  191. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  192. endif
  193. ifdef CONFIG_SUITEB
  194. CFLAGS += -DCONFIG_SUITEB
  195. NEED_SHA256=y
  196. NEED_AES_OMAC1=y
  197. endif
  198. ifdef CONFIG_SUITEB192
  199. CFLAGS += -DCONFIG_SUITEB192
  200. NEED_SHA384=y
  201. endif
  202. ifdef CONFIG_IEEE80211W
  203. CFLAGS += -DCONFIG_IEEE80211W
  204. NEED_SHA256=y
  205. NEED_AES_OMAC1=y
  206. endif
  207. ifdef CONFIG_IEEE80211R_AP
  208. CONFIG_IEEE80211R=y
  209. endif
  210. ifdef CONFIG_IEEE80211R
  211. CFLAGS += -DCONFIG_IEEE80211R
  212. OBJS += ../src/rsn_supp/wpa_ft.o
  213. NEED_SHA256=y
  214. NEED_AES_OMAC1=y
  215. endif
  216. ifdef CONFIG_MESH
  217. NEED_80211_COMMON=y
  218. NEED_SHA256=y
  219. NEED_AES_SIV=y
  220. CONFIG_SAE=y
  221. CONFIG_AP=y
  222. CFLAGS += -DCONFIG_MESH
  223. OBJS += mesh.o
  224. OBJS += mesh_mpm.o
  225. OBJS += mesh_rsn.o
  226. endif
  227. ifdef CONFIG_SAE
  228. CFLAGS += -DCONFIG_SAE
  229. OBJS += ../src/common/sae.o
  230. NEED_ECC=y
  231. NEED_DH_GROUPS=y
  232. endif
  233. ifdef CONFIG_OWE
  234. CFLAGS += -DCONFIG_OWE
  235. NEED_ECC=y
  236. NEED_HMAC_SHA256_KDF=y
  237. endif
  238. ifdef CONFIG_FILS
  239. CFLAGS += -DCONFIG_FILS
  240. NEED_SHA384=y
  241. NEED_AES_SIV=y
  242. ifdef CONFIG_FILS_SK_PFS
  243. CFLAGS += -DCONFIG_FILS_SK_PFS
  244. NEED_ECC=y
  245. endif
  246. endif
  247. ifdef CONFIG_MBO
  248. CONFIG_WNM=y
  249. endif
  250. ifdef CONFIG_WNM
  251. CFLAGS += -DCONFIG_WNM
  252. OBJS += wnm_sta.o
  253. endif
  254. ifdef CONFIG_TDLS
  255. CFLAGS += -DCONFIG_TDLS
  256. OBJS += ../src/rsn_supp/tdls.o
  257. NEED_SHA256=y
  258. NEED_AES_OMAC1=y
  259. endif
  260. ifdef CONFIG_TDLS_TESTING
  261. CFLAGS += -DCONFIG_TDLS_TESTING
  262. endif
  263. ifdef CONFIG_PEERKEY
  264. CFLAGS += -DCONFIG_PEERKEY
  265. endif
  266. ifdef CONFIG_PMKSA_CACHE_EXTERNAL
  267. CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
  268. endif
  269. ifndef CONFIG_NO_WPA
  270. OBJS += ../src/rsn_supp/wpa.o
  271. OBJS += ../src/rsn_supp/preauth.o
  272. OBJS += ../src/rsn_supp/pmksa_cache.o
  273. OBJS += ../src/rsn_supp/peerkey.o
  274. OBJS += ../src/rsn_supp/wpa_ie.o
  275. OBJS += ../src/common/wpa_common.o
  276. NEED_AES=y
  277. NEED_SHA1=y
  278. NEED_MD5=y
  279. NEED_RC4=y
  280. else
  281. CFLAGS += -DCONFIG_NO_WPA
  282. ifeq ($(CONFIG_TLS), internal)
  283. NEED_SHA1=y
  284. NEED_MD5=y
  285. endif
  286. endif
  287. ifdef CONFIG_IBSS_RSN
  288. NEED_RSN_AUTHENTICATOR=y
  289. CFLAGS += -DCONFIG_IBSS_RSN
  290. CFLAGS += -DCONFIG_NO_VLAN
  291. OBJS += ibss_rsn.o
  292. endif
  293. ifdef CONFIG_MATCH_IFACE
  294. CFLAGS += -DCONFIG_MATCH_IFACE
  295. endif
  296. ifdef CONFIG_P2P
  297. OBJS += p2p_supplicant.o
  298. OBJS += p2p_supplicant_sd.o
  299. OBJS += ../src/p2p/p2p.o
  300. OBJS += ../src/p2p/p2p_utils.o
  301. OBJS += ../src/p2p/p2p_parse.o
  302. OBJS += ../src/p2p/p2p_build.o
  303. OBJS += ../src/p2p/p2p_go_neg.o
  304. OBJS += ../src/p2p/p2p_sd.o
  305. OBJS += ../src/p2p/p2p_pd.o
  306. OBJS += ../src/p2p/p2p_invitation.o
  307. OBJS += ../src/p2p/p2p_dev_disc.o
  308. OBJS += ../src/p2p/p2p_group.o
  309. OBJS += ../src/ap/p2p_hostapd.o
  310. CFLAGS += -DCONFIG_P2P
  311. NEED_GAS=y
  312. NEED_OFFCHANNEL=y
  313. CONFIG_WPS=y
  314. CONFIG_AP=y
  315. ifdef CONFIG_P2P_STRICT
  316. CFLAGS += -DCONFIG_P2P_STRICT
  317. endif
  318. endif
  319. ifdef CONFIG_WIFI_DISPLAY
  320. CFLAGS += -DCONFIG_WIFI_DISPLAY
  321. OBJS += wifi_display.o
  322. endif
  323. ifdef CONFIG_HS20
  324. OBJS += hs20_supplicant.o
  325. CFLAGS += -DCONFIG_HS20
  326. CONFIG_INTERWORKING=y
  327. NEED_AES_OMAC1=y
  328. endif
  329. ifdef CONFIG_INTERWORKING
  330. OBJS += interworking.o
  331. CFLAGS += -DCONFIG_INTERWORKING
  332. NEED_GAS=y
  333. endif
  334. ifdef CONFIG_NO_ROAMING
  335. CFLAGS += -DCONFIG_NO_ROAMING
  336. endif
  337. include ../src/drivers/drivers.mak
  338. ifdef CONFIG_AP
  339. OBJS_d += $(DRV_BOTH_OBJS)
  340. CFLAGS += $(DRV_BOTH_CFLAGS)
  341. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  342. LIBS += $(DRV_BOTH_LIBS)
  343. else
  344. NEED_AP_MLME=
  345. OBJS_d += $(DRV_WPA_OBJS)
  346. CFLAGS += $(DRV_WPA_CFLAGS)
  347. LDFLAGS += $(DRV_WPA_LDFLAGS)
  348. LIBS += $(DRV_WPA_LIBS)
  349. endif
  350. ifndef CONFIG_L2_PACKET
  351. CONFIG_L2_PACKET=linux
  352. endif
  353. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  354. ifeq ($(CONFIG_L2_PACKET), pcap)
  355. ifdef CONFIG_WINPCAP
  356. CFLAGS += -DCONFIG_WINPCAP
  357. LIBS += -lwpcap -lpacket
  358. LIBS_w += -lwpcap
  359. else
  360. LIBS += -ldnet -lpcap
  361. endif
  362. endif
  363. ifeq ($(CONFIG_L2_PACKET), winpcap)
  364. LIBS += -lwpcap -lpacket
  365. LIBS_w += -lwpcap
  366. endif
  367. ifeq ($(CONFIG_L2_PACKET), freebsd)
  368. LIBS += -lpcap
  369. endif
  370. ifdef CONFIG_ERP
  371. CFLAGS += -DCONFIG_ERP
  372. NEED_SHA256=y
  373. NEED_HMAC_SHA256_KDF=y
  374. endif
  375. ifdef CONFIG_EAP_TLS
  376. # EAP-TLS
  377. ifeq ($(CONFIG_EAP_TLS), dyn)
  378. CFLAGS += -DEAP_TLS_DYNAMIC
  379. EAPDYN += ../src/eap_peer/eap_tls.so
  380. else
  381. CFLAGS += -DEAP_TLS
  382. OBJS += ../src/eap_peer/eap_tls.o
  383. endif
  384. TLS_FUNCS=y
  385. CONFIG_IEEE8021X_EAPOL=y
  386. endif
  387. ifdef CONFIG_EAP_UNAUTH_TLS
  388. # EAP-UNAUTH-TLS
  389. CFLAGS += -DEAP_UNAUTH_TLS
  390. ifndef CONFIG_EAP_TLS
  391. OBJS += ../src/eap_peer/eap_tls.o
  392. TLS_FUNCS=y
  393. endif
  394. CONFIG_IEEE8021X_EAPOL=y
  395. endif
  396. ifdef CONFIG_EAP_PEAP
  397. # EAP-PEAP
  398. ifeq ($(CONFIG_EAP_PEAP), dyn)
  399. CFLAGS += -DEAP_PEAP_DYNAMIC
  400. EAPDYN += ../src/eap_peer/eap_peap.so
  401. else
  402. CFLAGS += -DEAP_PEAP
  403. OBJS += ../src/eap_peer/eap_peap.o
  404. OBJS += ../src/eap_common/eap_peap_common.o
  405. endif
  406. TLS_FUNCS=y
  407. CONFIG_IEEE8021X_EAPOL=y
  408. endif
  409. ifdef CONFIG_EAP_TTLS
  410. # EAP-TTLS
  411. ifeq ($(CONFIG_EAP_TTLS), dyn)
  412. CFLAGS += -DEAP_TTLS_DYNAMIC
  413. EAPDYN += ../src/eap_peer/eap_ttls.so
  414. else
  415. CFLAGS += -DEAP_TTLS
  416. OBJS += ../src/eap_peer/eap_ttls.o
  417. endif
  418. TLS_FUNCS=y
  419. ifndef CONFIG_FIPS
  420. MS_FUNCS=y
  421. CHAP=y
  422. endif
  423. CONFIG_IEEE8021X_EAPOL=y
  424. endif
  425. ifdef CONFIG_EAP_MD5
  426. # EAP-MD5
  427. ifeq ($(CONFIG_EAP_MD5), dyn)
  428. CFLAGS += -DEAP_MD5_DYNAMIC
  429. EAPDYN += ../src/eap_peer/eap_md5.so
  430. else
  431. CFLAGS += -DEAP_MD5
  432. OBJS += ../src/eap_peer/eap_md5.o
  433. endif
  434. CHAP=y
  435. CONFIG_IEEE8021X_EAPOL=y
  436. endif
  437. # backwards compatibility for old spelling
  438. ifdef CONFIG_MSCHAPV2
  439. ifndef CONFIG_EAP_MSCHAPV2
  440. CONFIG_EAP_MSCHAPV2=y
  441. endif
  442. endif
  443. ifdef CONFIG_EAP_MSCHAPV2
  444. # EAP-MSCHAPv2
  445. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  446. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  447. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  448. EAPDYN += ../src/eap_peer/mschapv2.so
  449. else
  450. CFLAGS += -DEAP_MSCHAPv2
  451. OBJS += ../src/eap_peer/eap_mschapv2.o
  452. OBJS += ../src/eap_peer/mschapv2.o
  453. endif
  454. MS_FUNCS=y
  455. CONFIG_IEEE8021X_EAPOL=y
  456. endif
  457. ifdef CONFIG_EAP_GTC
  458. # EAP-GTC
  459. ifeq ($(CONFIG_EAP_GTC), dyn)
  460. CFLAGS += -DEAP_GTC_DYNAMIC
  461. EAPDYN += ../src/eap_peer/eap_gtc.so
  462. else
  463. CFLAGS += -DEAP_GTC
  464. OBJS += ../src/eap_peer/eap_gtc.o
  465. endif
  466. CONFIG_IEEE8021X_EAPOL=y
  467. endif
  468. ifdef CONFIG_EAP_OTP
  469. # EAP-OTP
  470. ifeq ($(CONFIG_EAP_OTP), dyn)
  471. CFLAGS += -DEAP_OTP_DYNAMIC
  472. EAPDYN += ../src/eap_peer/eap_otp.so
  473. else
  474. CFLAGS += -DEAP_OTP
  475. OBJS += ../src/eap_peer/eap_otp.o
  476. endif
  477. CONFIG_IEEE8021X_EAPOL=y
  478. endif
  479. ifdef CONFIG_EAP_SIM
  480. # EAP-SIM
  481. ifeq ($(CONFIG_EAP_SIM), dyn)
  482. CFLAGS += -DEAP_SIM_DYNAMIC
  483. EAPDYN += ../src/eap_peer/eap_sim.so
  484. else
  485. CFLAGS += -DEAP_SIM
  486. OBJS += ../src/eap_peer/eap_sim.o
  487. endif
  488. CONFIG_IEEE8021X_EAPOL=y
  489. CONFIG_EAP_SIM_COMMON=y
  490. NEED_AES_CBC=y
  491. endif
  492. ifdef CONFIG_EAP_LEAP
  493. # EAP-LEAP
  494. ifeq ($(CONFIG_EAP_LEAP), dyn)
  495. CFLAGS += -DEAP_LEAP_DYNAMIC
  496. EAPDYN += ../src/eap_peer/eap_leap.so
  497. else
  498. CFLAGS += -DEAP_LEAP
  499. OBJS += ../src/eap_peer/eap_leap.o
  500. endif
  501. MS_FUNCS=y
  502. CONFIG_IEEE8021X_EAPOL=y
  503. endif
  504. ifdef CONFIG_EAP_PSK
  505. # EAP-PSK
  506. ifeq ($(CONFIG_EAP_PSK), dyn)
  507. CFLAGS += -DEAP_PSK_DYNAMIC
  508. EAPDYN += ../src/eap_peer/eap_psk.so
  509. else
  510. CFLAGS += -DEAP_PSK
  511. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  512. endif
  513. CONFIG_IEEE8021X_EAPOL=y
  514. NEED_AES=y
  515. NEED_AES_OMAC1=y
  516. NEED_AES_ENCBLOCK=y
  517. NEED_AES_EAX=y
  518. endif
  519. ifdef CONFIG_EAP_AKA
  520. # EAP-AKA
  521. ifeq ($(CONFIG_EAP_AKA), dyn)
  522. CFLAGS += -DEAP_AKA_DYNAMIC
  523. EAPDYN += ../src/eap_peer/eap_aka.so
  524. else
  525. CFLAGS += -DEAP_AKA
  526. OBJS += ../src/eap_peer/eap_aka.o
  527. endif
  528. CONFIG_IEEE8021X_EAPOL=y
  529. CONFIG_EAP_SIM_COMMON=y
  530. NEED_AES_CBC=y
  531. endif
  532. ifdef CONFIG_EAP_PROXY
  533. CFLAGS += -DCONFIG_EAP_PROXY
  534. OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
  535. include eap_proxy_$(CONFIG_EAP_PROXY).mak
  536. CONFIG_IEEE8021X_EAPOL=y
  537. endif
  538. ifdef CONFIG_EAP_AKA_PRIME
  539. # EAP-AKA'
  540. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  541. CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  542. else
  543. CFLAGS += -DEAP_AKA_PRIME
  544. endif
  545. NEED_SHA256=y
  546. endif
  547. ifdef CONFIG_EAP_SIM_COMMON
  548. OBJS += ../src/eap_common/eap_sim_common.o
  549. NEED_AES=y
  550. NEED_FIPS186_2_PRF=y
  551. endif
  552. ifdef CONFIG_EAP_FAST
  553. # EAP-FAST
  554. ifeq ($(CONFIG_EAP_FAST), dyn)
  555. CFLAGS += -DEAP_FAST_DYNAMIC
  556. EAPDYN += ../src/eap_peer/eap_fast.so
  557. EAPDYN += ../src/eap_common/eap_fast_common.o
  558. else
  559. CFLAGS += -DEAP_FAST
  560. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  561. OBJS += ../src/eap_common/eap_fast_common.o
  562. endif
  563. TLS_FUNCS=y
  564. CONFIG_IEEE8021X_EAPOL=y
  565. NEED_T_PRF=y
  566. endif
  567. ifdef CONFIG_EAP_PAX
  568. # EAP-PAX
  569. ifeq ($(CONFIG_EAP_PAX), dyn)
  570. CFLAGS += -DEAP_PAX_DYNAMIC
  571. EAPDYN += ../src/eap_peer/eap_pax.so
  572. else
  573. CFLAGS += -DEAP_PAX
  574. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  575. endif
  576. CONFIG_IEEE8021X_EAPOL=y
  577. endif
  578. ifdef CONFIG_EAP_SAKE
  579. # EAP-SAKE
  580. ifeq ($(CONFIG_EAP_SAKE), dyn)
  581. CFLAGS += -DEAP_SAKE_DYNAMIC
  582. EAPDYN += ../src/eap_peer/eap_sake.so
  583. else
  584. CFLAGS += -DEAP_SAKE
  585. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  586. endif
  587. CONFIG_IEEE8021X_EAPOL=y
  588. endif
  589. ifdef CONFIG_EAP_GPSK
  590. # EAP-GPSK
  591. ifeq ($(CONFIG_EAP_GPSK), dyn)
  592. CFLAGS += -DEAP_GPSK_DYNAMIC
  593. EAPDYN += ../src/eap_peer/eap_gpsk.so
  594. else
  595. CFLAGS += -DEAP_GPSK
  596. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  597. endif
  598. CONFIG_IEEE8021X_EAPOL=y
  599. ifdef CONFIG_EAP_GPSK_SHA256
  600. CFLAGS += -DEAP_GPSK_SHA256
  601. endif
  602. NEED_SHA256=y
  603. NEED_AES_OMAC1=y
  604. endif
  605. ifdef CONFIG_EAP_PWD
  606. CFLAGS += -DEAP_PWD
  607. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  608. CONFIG_IEEE8021X_EAPOL=y
  609. NEED_SHA256=y
  610. endif
  611. ifdef CONFIG_EAP_EKE
  612. # EAP-EKE
  613. ifeq ($(CONFIG_EAP_EKE), dyn)
  614. CFLAGS += -DEAP_EKE_DYNAMIC
  615. EAPDYN += ../src/eap_peer/eap_eke.so
  616. else
  617. CFLAGS += -DEAP_EKE
  618. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  619. endif
  620. CONFIG_IEEE8021X_EAPOL=y
  621. NEED_DH_GROUPS=y
  622. NEED_DH_GROUPS_ALL=y
  623. NEED_SHA256=y
  624. NEED_AES_CBC=y
  625. endif
  626. ifdef CONFIG_WPS
  627. # EAP-WSC
  628. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  629. OBJS += wps_supplicant.o
  630. OBJS += ../src/utils/uuid.o
  631. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  632. OBJS += ../src/wps/wps.o
  633. OBJS += ../src/wps/wps_common.o
  634. OBJS += ../src/wps/wps_attr_parse.o
  635. OBJS += ../src/wps/wps_attr_build.o
  636. OBJS += ../src/wps/wps_attr_process.o
  637. OBJS += ../src/wps/wps_dev_attr.o
  638. OBJS += ../src/wps/wps_enrollee.o
  639. OBJS += ../src/wps/wps_registrar.o
  640. CONFIG_IEEE8021X_EAPOL=y
  641. NEED_DH_GROUPS=y
  642. NEED_SHA256=y
  643. NEED_BASE64=y
  644. NEED_AES_CBC=y
  645. NEED_MODEXP=y
  646. ifdef CONFIG_WPS_NFC
  647. CFLAGS += -DCONFIG_WPS_NFC
  648. OBJS += ../src/wps/ndef.o
  649. NEED_WPS_OOB=y
  650. endif
  651. ifdef NEED_WPS_OOB
  652. CFLAGS += -DCONFIG_WPS_OOB
  653. endif
  654. ifdef CONFIG_WPS_ER
  655. CONFIG_WPS_UPNP=y
  656. CFLAGS += -DCONFIG_WPS_ER
  657. OBJS += ../src/wps/wps_er.o
  658. OBJS += ../src/wps/wps_er_ssdp.o
  659. endif
  660. ifdef CONFIG_WPS_UPNP
  661. CFLAGS += -DCONFIG_WPS_UPNP
  662. OBJS += ../src/wps/wps_upnp.o
  663. OBJS += ../src/wps/wps_upnp_ssdp.o
  664. OBJS += ../src/wps/wps_upnp_web.o
  665. OBJS += ../src/wps/wps_upnp_event.o
  666. OBJS += ../src/wps/wps_upnp_ap.o
  667. OBJS += ../src/wps/upnp_xml.o
  668. OBJS += ../src/wps/httpread.o
  669. OBJS += ../src/wps/http_client.o
  670. OBJS += ../src/wps/http_server.o
  671. endif
  672. ifdef CONFIG_WPS_STRICT
  673. CFLAGS += -DCONFIG_WPS_STRICT
  674. OBJS += ../src/wps/wps_validate.o
  675. endif
  676. ifdef CONFIG_WPS_TESTING
  677. CFLAGS += -DCONFIG_WPS_TESTING
  678. endif
  679. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  680. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  681. endif
  682. endif
  683. ifdef CONFIG_EAP_IKEV2
  684. # EAP-IKEv2
  685. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  686. CFLAGS += -DEAP_IKEV2_DYNAMIC
  687. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  688. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  689. else
  690. CFLAGS += -DEAP_IKEV2
  691. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  692. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  693. endif
  694. CONFIG_IEEE8021X_EAPOL=y
  695. NEED_DH_GROUPS=y
  696. NEED_DH_GROUPS_ALL=y
  697. NEED_MODEXP=y
  698. NEED_CIPHER=y
  699. endif
  700. ifdef CONFIG_EAP_VENDOR_TEST
  701. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  702. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  703. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  704. else
  705. CFLAGS += -DEAP_VENDOR_TEST
  706. OBJS += ../src/eap_peer/eap_vendor_test.o
  707. endif
  708. CONFIG_IEEE8021X_EAPOL=y
  709. endif
  710. ifdef CONFIG_EAP_TNC
  711. # EAP-TNC
  712. CFLAGS += -DEAP_TNC
  713. OBJS += ../src/eap_peer/eap_tnc.o
  714. OBJS += ../src/eap_peer/tncc.o
  715. NEED_BASE64=y
  716. ifndef CONFIG_NATIVE_WINDOWS
  717. ifndef CONFIG_DRIVER_BSD
  718. LIBS += -ldl
  719. endif
  720. endif
  721. endif
  722. ifdef CONFIG_IEEE8021X_EAPOL
  723. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  724. CFLAGS += -DIEEE8021X_EAPOL
  725. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  726. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  727. NEED_EAP_COMMON=y
  728. ifdef CONFIG_DYNAMIC_EAP_METHODS
  729. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  730. LIBS += -ldl -rdynamic
  731. endif
  732. endif
  733. ifdef CONFIG_MACSEC
  734. CFLAGS += -DCONFIG_MACSEC
  735. NEED_AES_ENCBLOCK=y
  736. NEED_AES_UNWRAP=y
  737. NEED_AES_WRAP=y
  738. NEED_AES_OMAC1=y
  739. OBJS += wpas_kay.o
  740. OBJS += ../src/pae/ieee802_1x_cp.o
  741. OBJS += ../src/pae/ieee802_1x_kay.o
  742. OBJS += ../src/pae/ieee802_1x_key.o
  743. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  744. endif
  745. ifdef CONFIG_AP
  746. NEED_EAP_COMMON=y
  747. NEED_RSN_AUTHENTICATOR=y
  748. CFLAGS += -DCONFIG_AP
  749. OBJS += ap.o
  750. CFLAGS += -DCONFIG_NO_RADIUS
  751. CFLAGS += -DCONFIG_NO_ACCOUNTING
  752. CFLAGS += -DCONFIG_NO_VLAN
  753. OBJS += ../src/ap/hostapd.o
  754. OBJS += ../src/ap/wpa_auth_glue.o
  755. OBJS += ../src/ap/utils.o
  756. OBJS += ../src/ap/authsrv.o
  757. OBJS += ../src/ap/ap_config.o
  758. OBJS += ../src/utils/ip_addr.o
  759. OBJS += ../src/ap/sta_info.o
  760. OBJS += ../src/ap/tkip_countermeasures.o
  761. OBJS += ../src/ap/ap_mlme.o
  762. OBJS += ../src/ap/ieee802_1x.o
  763. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  764. OBJS += ../src/ap/ieee802_11_auth.o
  765. OBJS += ../src/ap/ieee802_11_shared.o
  766. OBJS += ../src/ap/drv_callbacks.o
  767. OBJS += ../src/ap/ap_drv_ops.o
  768. OBJS += ../src/ap/beacon.o
  769. OBJS += ../src/ap/bss_load.o
  770. OBJS += ../src/ap/eap_user_db.o
  771. OBJS += ../src/ap/neighbor_db.o
  772. OBJS += ../src/ap/rrm.o
  773. ifdef CONFIG_IEEE80211N
  774. OBJS += ../src/ap/ieee802_11_ht.o
  775. ifdef CONFIG_IEEE80211AC
  776. OBJS += ../src/ap/ieee802_11_vht.o
  777. endif
  778. ifdef CONFIG_IEEE80211AX
  779. OBJS += ../src/ap/ieee802_11_he.o
  780. endif
  781. endif
  782. ifdef CONFIG_WNM
  783. OBJS += ../src/ap/wnm_ap.o
  784. endif
  785. ifdef CONFIG_MBO
  786. OBJS += ../src/ap/mbo_ap.o
  787. endif
  788. ifdef CONFIG_FILS
  789. OBJS += ../src/ap/fils_hlp.o
  790. endif
  791. ifdef CONFIG_CTRL_IFACE
  792. OBJS += ../src/ap/ctrl_iface_ap.o
  793. endif
  794. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  795. OBJS += ../src/eap_server/eap_server.o
  796. OBJS += ../src/eap_server/eap_server_identity.o
  797. OBJS += ../src/eap_server/eap_server_methods.o
  798. ifdef CONFIG_IEEE80211N
  799. CFLAGS += -DCONFIG_IEEE80211N
  800. ifdef CONFIG_IEEE80211AC
  801. CFLAGS += -DCONFIG_IEEE80211AC
  802. endif
  803. ifdef CONFIG_IEEE80211AX
  804. CFLAGS += -DCONFIG_IEEE80211AX
  805. endif
  806. endif
  807. ifdef NEED_AP_MLME
  808. OBJS += ../src/ap/wmm.o
  809. OBJS += ../src/ap/ap_list.o
  810. OBJS += ../src/ap/ieee802_11.o
  811. OBJS += ../src/ap/hw_features.o
  812. OBJS += ../src/ap/dfs.o
  813. CFLAGS += -DNEED_AP_MLME
  814. endif
  815. ifdef CONFIG_WPS
  816. CFLAGS += -DEAP_SERVER_WSC
  817. OBJS += ../src/ap/wps_hostapd.o
  818. OBJS += ../src/eap_server/eap_server_wsc.o
  819. endif
  820. ifdef CONFIG_INTERWORKING
  821. OBJS += ../src/ap/gas_serv.o
  822. endif
  823. ifdef CONFIG_HS20
  824. OBJS += ../src/ap/hs20.o
  825. endif
  826. endif
  827. ifdef CONFIG_MBO
  828. OBJS += mbo.o
  829. CFLAGS += -DCONFIG_MBO
  830. endif
  831. ifdef NEED_RSN_AUTHENTICATOR
  832. CFLAGS += -DCONFIG_NO_RADIUS
  833. NEED_AES_WRAP=y
  834. OBJS += ../src/ap/wpa_auth.o
  835. OBJS += ../src/ap/wpa_auth_ie.o
  836. OBJS += ../src/ap/pmksa_cache_auth.o
  837. ifdef CONFIG_IEEE80211R_AP
  838. CFLAGS += -DCONFIG_IEEE80211R_AP
  839. OBJS += ../src/ap/wpa_auth_ft.o
  840. endif
  841. ifdef CONFIG_PEERKEY
  842. OBJS += ../src/ap/peerkey_auth.o
  843. endif
  844. endif
  845. ifdef CONFIG_ACS
  846. CFLAGS += -DCONFIG_ACS
  847. OBJS += ../src/ap/acs.o
  848. LIBS += -lm
  849. endif
  850. ifdef CONFIG_PCSC
  851. # PC/SC interface for smartcards (USIM, GSM SIM)
  852. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  853. OBJS += ../src/utils/pcsc_funcs.o
  854. # -lpthread may not be needed depending on how pcsc-lite was configured
  855. ifdef CONFIG_NATIVE_WINDOWS
  856. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  857. #dynamic symbol loading that is now used in pcsc_funcs.c
  858. #LIBS += -lwinscard
  859. else
  860. ifdef CONFIG_OSX
  861. LIBS += -framework PCSC
  862. else
  863. LIBS += -lpcsclite -lpthread
  864. endif
  865. endif
  866. endif
  867. ifdef CONFIG_SIM_SIMULATOR
  868. CFLAGS += -DCONFIG_SIM_SIMULATOR
  869. NEED_MILENAGE=y
  870. endif
  871. ifdef CONFIG_USIM_SIMULATOR
  872. CFLAGS += -DCONFIG_USIM_SIMULATOR
  873. NEED_MILENAGE=y
  874. endif
  875. ifdef NEED_MILENAGE
  876. OBJS += ../src/crypto/milenage.o
  877. NEED_AES_ENCBLOCK=y
  878. endif
  879. ifdef CONFIG_PKCS12
  880. CFLAGS += -DPKCS12_FUNCS
  881. endif
  882. ifdef CONFIG_SMARTCARD
  883. CFLAGS += -DCONFIG_SMARTCARD
  884. endif
  885. ifdef MS_FUNCS
  886. OBJS += ../src/crypto/ms_funcs.o
  887. NEED_DES=y
  888. NEED_MD4=y
  889. endif
  890. ifdef CHAP
  891. OBJS += ../src/eap_common/chap.o
  892. endif
  893. ifdef TLS_FUNCS
  894. NEED_DES=y
  895. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  896. OBJS += ../src/eap_peer/eap_tls_common.o
  897. ifndef CONFIG_FIPS
  898. NEED_TLS_PRF=y
  899. NEED_SHA1=y
  900. NEED_MD5=y
  901. endif
  902. endif
  903. ifndef CONFIG_TLS
  904. CONFIG_TLS=openssl
  905. endif
  906. ifdef CONFIG_TLSV11
  907. CFLAGS += -DCONFIG_TLSV11
  908. endif
  909. ifdef CONFIG_TLSV12
  910. CFLAGS += -DCONFIG_TLSV12
  911. NEED_SHA256=y
  912. endif
  913. ifeq ($(CONFIG_TLS), openssl)
  914. ifdef TLS_FUNCS
  915. CFLAGS += -DEAP_TLS_OPENSSL
  916. OBJS += ../src/crypto/tls_openssl.o
  917. OBJS += ../src/crypto/tls_openssl_ocsp.o
  918. LIBS += -lssl
  919. endif
  920. OBJS += ../src/crypto/crypto_openssl.o
  921. OBJS_p += ../src/crypto/crypto_openssl.o
  922. OBJS_priv += ../src/crypto/crypto_openssl.o
  923. ifdef NEED_FIPS186_2_PRF
  924. OBJS += ../src/crypto/fips_prf_openssl.o
  925. endif
  926. NEED_SHA256=y
  927. NEED_TLS_PRF_SHA256=y
  928. LIBS += -lcrypto
  929. LIBS_p += -lcrypto
  930. ifdef CONFIG_TLS_ADD_DL
  931. LIBS += -ldl
  932. LIBS_p += -ldl
  933. endif
  934. endif
  935. ifeq ($(CONFIG_TLS), gnutls)
  936. ifdef TLS_FUNCS
  937. OBJS += ../src/crypto/tls_gnutls.o
  938. LIBS += -lgnutls -lgpg-error
  939. endif
  940. OBJS += ../src/crypto/crypto_gnutls.o
  941. OBJS_p += ../src/crypto/crypto_gnutls.o
  942. OBJS_priv += ../src/crypto/crypto_gnutls.o
  943. ifdef NEED_FIPS186_2_PRF
  944. OBJS += ../src/crypto/fips_prf_internal.o
  945. SHA1OBJS += ../src/crypto/sha1-internal.o
  946. endif
  947. LIBS += -lgcrypt
  948. LIBS_p += -lgcrypt
  949. CONFIG_INTERNAL_SHA256=y
  950. CONFIG_INTERNAL_RC4=y
  951. CONFIG_INTERNAL_DH_GROUP5=y
  952. endif
  953. ifeq ($(CONFIG_TLS), internal)
  954. ifndef CONFIG_CRYPTO
  955. CONFIG_CRYPTO=internal
  956. endif
  957. ifdef TLS_FUNCS
  958. OBJS += ../src/crypto/crypto_internal-rsa.o
  959. OBJS += ../src/crypto/tls_internal.o
  960. OBJS += ../src/tls/tlsv1_common.o
  961. OBJS += ../src/tls/tlsv1_record.o
  962. OBJS += ../src/tls/tlsv1_cred.o
  963. OBJS += ../src/tls/tlsv1_client.o
  964. OBJS += ../src/tls/tlsv1_client_write.o
  965. OBJS += ../src/tls/tlsv1_client_read.o
  966. OBJS += ../src/tls/tlsv1_client_ocsp.o
  967. OBJS += ../src/tls/asn1.o
  968. OBJS += ../src/tls/rsa.o
  969. OBJS += ../src/tls/x509v3.o
  970. OBJS += ../src/tls/pkcs1.o
  971. OBJS += ../src/tls/pkcs5.o
  972. OBJS += ../src/tls/pkcs8.o
  973. NEED_SHA256=y
  974. NEED_BASE64=y
  975. NEED_TLS_PRF=y
  976. ifdef CONFIG_TLSV12
  977. NEED_TLS_PRF_SHA256=y
  978. endif
  979. NEED_MODEXP=y
  980. NEED_CIPHER=y
  981. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  982. endif
  983. ifdef NEED_CIPHER
  984. NEED_DES=y
  985. OBJS += ../src/crypto/crypto_internal-cipher.o
  986. endif
  987. ifdef NEED_MODEXP
  988. OBJS += ../src/crypto/crypto_internal-modexp.o
  989. OBJS += ../src/tls/bignum.o
  990. endif
  991. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  992. OBJS += ../src/crypto/crypto_libtomcrypt.o
  993. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  994. LIBS += -ltomcrypt -ltfm
  995. LIBS_p += -ltomcrypt -ltfm
  996. CONFIG_INTERNAL_SHA256=y
  997. CONFIG_INTERNAL_RC4=y
  998. CONFIG_INTERNAL_DH_GROUP5=y
  999. endif
  1000. ifeq ($(CONFIG_CRYPTO), internal)
  1001. OBJS += ../src/crypto/crypto_internal.o
  1002. OBJS_p += ../src/crypto/crypto_internal.o
  1003. NEED_AES_ENC=y
  1004. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  1005. ifdef CONFIG_INTERNAL_LIBTOMMATH
  1006. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1007. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  1008. CFLAGS += -DLTM_FAST
  1009. endif
  1010. else
  1011. LIBS += -ltommath
  1012. LIBS_p += -ltommath
  1013. endif
  1014. CONFIG_INTERNAL_AES=y
  1015. CONFIG_INTERNAL_DES=y
  1016. CONFIG_INTERNAL_SHA1=y
  1017. CONFIG_INTERNAL_MD4=y
  1018. CONFIG_INTERNAL_MD5=y
  1019. CONFIG_INTERNAL_SHA256=y
  1020. CONFIG_INTERNAL_SHA384=y
  1021. CONFIG_INTERNAL_SHA512=y
  1022. CONFIG_INTERNAL_RC4=y
  1023. CONFIG_INTERNAL_DH_GROUP5=y
  1024. endif
  1025. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1026. OBJS += ../src/crypto/crypto_cryptoapi.o
  1027. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  1028. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  1029. CONFIG_INTERNAL_SHA256=y
  1030. CONFIG_INTERNAL_RC4=y
  1031. endif
  1032. endif
  1033. ifeq ($(CONFIG_TLS), linux)
  1034. OBJS += ../src/crypto/crypto_linux.o
  1035. OBJS_p += ../src/crypto/crypto_linux.o
  1036. ifdef TLS_FUNCS
  1037. OBJS += ../src/crypto/crypto_internal-rsa.o
  1038. OBJS += ../src/crypto/tls_internal.o
  1039. OBJS += ../src/tls/tlsv1_common.o
  1040. OBJS += ../src/tls/tlsv1_record.o
  1041. OBJS += ../src/tls/tlsv1_cred.o
  1042. OBJS += ../src/tls/tlsv1_client.o
  1043. OBJS += ../src/tls/tlsv1_client_write.o
  1044. OBJS += ../src/tls/tlsv1_client_read.o
  1045. OBJS += ../src/tls/tlsv1_client_ocsp.o
  1046. OBJS += ../src/tls/asn1.o
  1047. OBJS += ../src/tls/rsa.o
  1048. OBJS += ../src/tls/x509v3.o
  1049. OBJS += ../src/tls/pkcs1.o
  1050. OBJS += ../src/tls/pkcs5.o
  1051. OBJS += ../src/tls/pkcs8.o
  1052. NEED_SHA256=y
  1053. NEED_BASE64=y
  1054. NEED_TLS_PRF=y
  1055. ifdef CONFIG_TLSV12
  1056. NEED_TLS_PRF_SHA256=y
  1057. endif
  1058. NEED_MODEXP=y
  1059. NEED_CIPHER=y
  1060. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  1061. endif
  1062. ifdef NEED_MODEXP
  1063. OBJS += ../src/crypto/crypto_internal-modexp.o
  1064. OBJS += ../src/tls/bignum.o
  1065. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1066. CFLAGS += -DLTM_FAST
  1067. endif
  1068. CONFIG_INTERNAL_DH_GROUP5=y
  1069. ifdef NEED_FIPS186_2_PRF
  1070. OBJS += ../src/crypto/fips_prf_internal.o
  1071. OBJS += ../src/crypto/sha1-internal.o
  1072. endif
  1073. endif
  1074. ifeq ($(CONFIG_TLS), none)
  1075. ifdef TLS_FUNCS
  1076. OBJS += ../src/crypto/tls_none.o
  1077. CFLAGS += -DEAP_TLS_NONE
  1078. CONFIG_INTERNAL_AES=y
  1079. CONFIG_INTERNAL_SHA1=y
  1080. CONFIG_INTERNAL_MD5=y
  1081. endif
  1082. OBJS += ../src/crypto/crypto_none.o
  1083. OBJS_p += ../src/crypto/crypto_none.o
  1084. CONFIG_INTERNAL_SHA256=y
  1085. CONFIG_INTERNAL_RC4=y
  1086. endif
  1087. ifdef TLS_FUNCS
  1088. ifdef CONFIG_SMARTCARD
  1089. ifndef CONFIG_NATIVE_WINDOWS
  1090. ifneq ($(CONFIG_L2_PACKET), freebsd)
  1091. LIBS += -ldl
  1092. endif
  1093. endif
  1094. endif
  1095. endif
  1096. ifndef TLS_FUNCS
  1097. OBJS += ../src/crypto/tls_none.o
  1098. ifeq ($(CONFIG_TLS), internal)
  1099. CONFIG_INTERNAL_AES=y
  1100. CONFIG_INTERNAL_SHA1=y
  1101. CONFIG_INTERNAL_MD5=y
  1102. CONFIG_INTERNAL_RC4=y
  1103. endif
  1104. endif
  1105. AESOBJS = # none so far (see below)
  1106. ifdef CONFIG_INTERNAL_AES
  1107. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  1108. endif
  1109. ifneq ($(CONFIG_TLS), openssl)
  1110. NEED_INTERNAL_AES_WRAP=y
  1111. endif
  1112. ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
  1113. # Seems to be needed at least with BoringSSL
  1114. NEED_INTERNAL_AES_WRAP=y
  1115. CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
  1116. endif
  1117. ifdef CONFIG_FIPS
  1118. # Have to use internal AES key wrap routines to use OpenSSL EVP since the
  1119. # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
  1120. NEED_INTERNAL_AES_WRAP=y
  1121. endif
  1122. ifdef NEED_INTERNAL_AES_WRAP
  1123. ifneq ($(CONFIG_TLS), linux)
  1124. AESOBJS += ../src/crypto/aes-unwrap.o
  1125. endif
  1126. endif
  1127. ifdef NEED_AES_EAX
  1128. AESOBJS += ../src/crypto/aes-eax.o
  1129. NEED_AES_CTR=y
  1130. NEED_AES_OMAC1=y
  1131. endif
  1132. ifdef NEED_AES_SIV
  1133. AESOBJS += ../src/crypto/aes-siv.o
  1134. NEED_AES_CTR=y
  1135. NEED_AES_OMAC1=y
  1136. endif
  1137. ifdef NEED_AES_CTR
  1138. AESOBJS += ../src/crypto/aes-ctr.o
  1139. endif
  1140. ifdef NEED_AES_ENCBLOCK
  1141. AESOBJS += ../src/crypto/aes-encblock.o
  1142. endif
  1143. ifdef NEED_AES_OMAC1
  1144. NEED_AES_ENC=y
  1145. ifdef CONFIG_OPENSSL_CMAC
  1146. CFLAGS += -DCONFIG_OPENSSL_CMAC
  1147. else
  1148. ifneq ($(CONFIG_TLS), linux)
  1149. AESOBJS += ../src/crypto/aes-omac1.o
  1150. endif
  1151. endif
  1152. endif
  1153. ifdef NEED_AES_WRAP
  1154. NEED_AES_ENC=y
  1155. ifdef NEED_INTERNAL_AES_WRAP
  1156. AESOBJS += ../src/crypto/aes-wrap.o
  1157. endif
  1158. endif
  1159. ifdef NEED_AES_CBC
  1160. NEED_AES_ENC=y
  1161. ifneq ($(CONFIG_TLS), openssl)
  1162. ifneq ($(CONFIG_TLS), linux)
  1163. AESOBJS += ../src/crypto/aes-cbc.o
  1164. endif
  1165. endif
  1166. endif
  1167. ifdef NEED_AES_ENC
  1168. ifdef CONFIG_INTERNAL_AES
  1169. AESOBJS += ../src/crypto/aes-internal-enc.o
  1170. endif
  1171. endif
  1172. ifdef NEED_AES
  1173. OBJS += $(AESOBJS)
  1174. endif
  1175. ifdef NEED_SHA1
  1176. ifneq ($(CONFIG_TLS), openssl)
  1177. ifneq ($(CONFIG_TLS), linux)
  1178. SHA1OBJS += ../src/crypto/sha1.o
  1179. endif
  1180. endif
  1181. SHA1OBJS += ../src/crypto/sha1-prf.o
  1182. ifdef CONFIG_INTERNAL_SHA1
  1183. SHA1OBJS += ../src/crypto/sha1-internal.o
  1184. ifdef NEED_FIPS186_2_PRF
  1185. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  1186. endif
  1187. endif
  1188. ifdef CONFIG_NO_WPA_PASSPHRASE
  1189. CFLAGS += -DCONFIG_NO_PBKDF2
  1190. else
  1191. ifneq ($(CONFIG_TLS), openssl)
  1192. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  1193. endif
  1194. endif
  1195. ifdef NEED_T_PRF
  1196. SHA1OBJS += ../src/crypto/sha1-tprf.o
  1197. endif
  1198. ifdef NEED_TLS_PRF
  1199. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  1200. endif
  1201. endif
  1202. ifndef CONFIG_FIPS
  1203. ifneq ($(CONFIG_TLS), openssl)
  1204. ifneq ($(CONFIG_TLS), linux)
  1205. MD5OBJS += ../src/crypto/md5.o
  1206. endif
  1207. endif
  1208. endif
  1209. ifdef NEED_MD5
  1210. ifdef CONFIG_INTERNAL_MD5
  1211. MD5OBJS += ../src/crypto/md5-internal.o
  1212. endif
  1213. OBJS += $(MD5OBJS)
  1214. OBJS_p += $(MD5OBJS)
  1215. OBJS_priv += $(MD5OBJS)
  1216. endif
  1217. ifdef NEED_MD4
  1218. ifdef CONFIG_INTERNAL_MD4
  1219. OBJS += ../src/crypto/md4-internal.o
  1220. endif
  1221. endif
  1222. DESOBJS = # none needed when not internal
  1223. ifdef NEED_DES
  1224. ifdef CONFIG_INTERNAL_DES
  1225. DESOBJS += ../src/crypto/des-internal.o
  1226. endif
  1227. endif
  1228. ifdef CONFIG_NO_RC4
  1229. CFLAGS += -DCONFIG_NO_RC4
  1230. endif
  1231. ifdef NEED_RC4
  1232. ifdef CONFIG_INTERNAL_RC4
  1233. ifndef CONFIG_NO_RC4
  1234. OBJS += ../src/crypto/rc4.o
  1235. endif
  1236. endif
  1237. endif
  1238. SHA256OBJS = # none by default
  1239. ifdef NEED_SHA256
  1240. CFLAGS += -DCONFIG_SHA256
  1241. ifneq ($(CONFIG_TLS), openssl)
  1242. ifneq ($(CONFIG_TLS), linux)
  1243. SHA256OBJS += ../src/crypto/sha256.o
  1244. endif
  1245. endif
  1246. SHA256OBJS += ../src/crypto/sha256-prf.o
  1247. ifdef CONFIG_INTERNAL_SHA256
  1248. SHA256OBJS += ../src/crypto/sha256-internal.o
  1249. endif
  1250. ifdef CONFIG_INTERNAL_SHA384
  1251. CFLAGS += -DCONFIG_INTERNAL_SHA384
  1252. SHA256OBJS += ../src/crypto/sha384-internal.o
  1253. endif
  1254. ifdef CONFIG_INTERNAL_SHA512
  1255. CFLAGS += -DCONFIG_INTERNAL_SHA512
  1256. SHA256OBJS += ../src/crypto/sha512-internal.o
  1257. endif
  1258. ifdef NEED_TLS_PRF_SHA256
  1259. SHA256OBJS += ../src/crypto/sha256-tlsprf.o
  1260. endif
  1261. ifdef NEED_HMAC_SHA256_KDF
  1262. CFLAGS += -DCONFIG_HMAC_SHA256_KDF
  1263. OBJS += ../src/crypto/sha256-kdf.o
  1264. endif
  1265. OBJS += $(SHA256OBJS)
  1266. endif
  1267. ifdef NEED_SHA384
  1268. ifneq ($(CONFIG_TLS), openssl)
  1269. ifneq ($(CONFIG_TLS), linux)
  1270. OBJS += ../src/crypto/sha384.o
  1271. endif
  1272. endif
  1273. CFLAGS += -DCONFIG_SHA384
  1274. OBJS += ../src/crypto/sha384-prf.o
  1275. endif
  1276. ifdef NEED_DH_GROUPS
  1277. OBJS += ../src/crypto/dh_groups.o
  1278. endif
  1279. ifdef NEED_DH_GROUPS_ALL
  1280. CFLAGS += -DALL_DH_GROUPS
  1281. endif
  1282. ifdef CONFIG_INTERNAL_DH_GROUP5
  1283. ifdef NEED_DH_GROUPS
  1284. OBJS += ../src/crypto/dh_group5.o
  1285. endif
  1286. endif
  1287. ifdef NEED_ECC
  1288. CFLAGS += -DCONFIG_ECC
  1289. endif
  1290. ifdef CONFIG_NO_RANDOM_POOL
  1291. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1292. else
  1293. OBJS += ../src/crypto/random.o
  1294. endif
  1295. ifdef CONFIG_CTRL_IFACE
  1296. ifeq ($(CONFIG_CTRL_IFACE), y)
  1297. ifdef CONFIG_NATIVE_WINDOWS
  1298. CONFIG_CTRL_IFACE=named_pipe
  1299. else
  1300. CONFIG_CTRL_IFACE=unix
  1301. endif
  1302. endif
  1303. CFLAGS += -DCONFIG_CTRL_IFACE
  1304. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1305. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1306. OBJS += ../src/common/ctrl_iface_common.o
  1307. endif
  1308. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1309. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1310. endif
  1311. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  1312. CONFIG_CTRL_IFACE=udp
  1313. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1314. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1315. endif
  1316. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1317. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1318. endif
  1319. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1320. CONFIG_CTRL_IFACE=udp
  1321. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1322. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1323. endif
  1324. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  1325. CONFIG_CTRL_IFACE=udp
  1326. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1327. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1328. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1329. endif
  1330. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  1331. endif
  1332. ifdef CONFIG_CTRL_IFACE_DBUS
  1333. DBUS=y
  1334. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1335. DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
  1336. ifdef CONFIG_WPS
  1337. DBUS_OBJS += dbus/dbus_old_handlers_wps.o
  1338. endif
  1339. DBUS_OBJS += dbus/dbus_dict_helpers.o
  1340. ifndef DBUS_LIBS
  1341. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1342. endif
  1343. ifndef DBUS_INCLUDE
  1344. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1345. endif
  1346. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1347. DBUS_INTERFACE=fi.epitest.hostap.WPASupplicant
  1348. endif
  1349. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1350. DBUS=y
  1351. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1352. DBUS_OBJS ?= dbus/dbus_dict_helpers.o
  1353. DBUS_OBJS += dbus/dbus_new_helpers.o
  1354. DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
  1355. ifdef CONFIG_WPS
  1356. DBUS_OBJS += dbus/dbus_new_handlers_wps.o
  1357. endif
  1358. ifdef CONFIG_P2P
  1359. DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
  1360. endif
  1361. ifndef DBUS_LIBS
  1362. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1363. endif
  1364. ifndef DBUS_INCLUDE
  1365. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1366. endif
  1367. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1368. DBUS_OBJS += dbus/dbus_new_introspect.o
  1369. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1370. endif
  1371. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1372. DBUS_INTERFACE=fi.w1.wpa_supplicant1
  1373. endif
  1374. ifdef DBUS
  1375. DBUS_CFLAGS += -DCONFIG_DBUS
  1376. DBUS_OBJS += dbus/dbus_common.o
  1377. endif
  1378. OBJS += $(DBUS_OBJS)
  1379. CFLAGS += $(DBUS_CFLAGS)
  1380. LIBS += $(DBUS_LIBS)
  1381. ifdef CONFIG_READLINE
  1382. OBJS_c += ../src/utils/edit_readline.o
  1383. LIBS_c += -lreadline -lncurses
  1384. else
  1385. ifdef CONFIG_WPA_CLI_EDIT
  1386. OBJS_c += ../src/utils/edit.o
  1387. else
  1388. OBJS_c += ../src/utils/edit_simple.o
  1389. endif
  1390. endif
  1391. ifdef CONFIG_NATIVE_WINDOWS
  1392. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1393. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1394. LIBS_c += -lws2_32
  1395. LIBS_p += -lws2_32 -lgdi32
  1396. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1397. LIBS_p += -lcrypt32
  1398. endif
  1399. endif
  1400. ifdef CONFIG_NO_STDOUT_DEBUG
  1401. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1402. ifndef CONFIG_CTRL_IFACE
  1403. CFLAGS += -DCONFIG_NO_WPA_MSG
  1404. endif
  1405. endif
  1406. ifdef CONFIG_IPV6
  1407. # for eapol_test only
  1408. CFLAGS += -DCONFIG_IPV6
  1409. endif
  1410. ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1411. CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1412. endif
  1413. ifdef NEED_BASE64
  1414. OBJS += ../src/utils/base64.o
  1415. endif
  1416. ifdef NEED_SME
  1417. OBJS += sme.o
  1418. CFLAGS += -DCONFIG_SME
  1419. endif
  1420. OBJS += ../src/common/ieee802_11_common.o
  1421. OBJS += ../src/common/hw_features_common.o
  1422. ifdef NEED_EAP_COMMON
  1423. OBJS += ../src/eap_common/eap_common.o
  1424. endif
  1425. ifndef CONFIG_MAIN
  1426. CONFIG_MAIN=main
  1427. endif
  1428. ifdef CONFIG_DEBUG_SYSLOG
  1429. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1430. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1431. CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1432. endif
  1433. endif
  1434. ifdef CONFIG_DEBUG_LINUX_TRACING
  1435. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1436. endif
  1437. ifdef CONFIG_DEBUG_FILE
  1438. CFLAGS += -DCONFIG_DEBUG_FILE
  1439. endif
  1440. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1441. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1442. endif
  1443. ifdef CONFIG_FIPS
  1444. CFLAGS += -DCONFIG_FIPS
  1445. ifneq ($(CONFIG_TLS), openssl)
  1446. $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
  1447. endif
  1448. endif
  1449. OBJS += $(SHA1OBJS) $(DESOBJS)
  1450. OBJS_p += $(SHA1OBJS)
  1451. OBJS_p += $(SHA256OBJS)
  1452. OBJS_priv += $(SHA1OBJS)
  1453. ifdef CONFIG_BGSCAN_SIMPLE
  1454. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1455. OBJS += bgscan_simple.o
  1456. NEED_BGSCAN=y
  1457. endif
  1458. ifdef CONFIG_BGSCAN_LEARN
  1459. CFLAGS += -DCONFIG_BGSCAN_LEARN
  1460. OBJS += bgscan_learn.o
  1461. NEED_BGSCAN=y
  1462. endif
  1463. ifdef NEED_BGSCAN
  1464. CFLAGS += -DCONFIG_BGSCAN
  1465. OBJS += bgscan.o
  1466. endif
  1467. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1468. CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1469. OBJS += autoscan_exponential.o
  1470. NEED_AUTOSCAN=y
  1471. endif
  1472. ifdef CONFIG_AUTOSCAN_PERIODIC
  1473. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1474. OBJS += autoscan_periodic.o
  1475. NEED_AUTOSCAN=y
  1476. endif
  1477. ifdef NEED_AUTOSCAN
  1478. CFLAGS += -DCONFIG_AUTOSCAN
  1479. OBJS += autoscan.o
  1480. endif
  1481. ifdef CONFIG_EXT_PASSWORD_TEST
  1482. OBJS += ../src/utils/ext_password_test.o
  1483. CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1484. NEED_EXT_PASSWORD=y
  1485. endif
  1486. ifdef NEED_EXT_PASSWORD
  1487. OBJS += ../src/utils/ext_password.o
  1488. CFLAGS += -DCONFIG_EXT_PASSWORD
  1489. endif
  1490. ifdef NEED_GAS
  1491. OBJS += ../src/common/gas.o
  1492. OBJS += gas_query.o
  1493. CFLAGS += -DCONFIG_GAS
  1494. NEED_OFFCHANNEL=y
  1495. endif
  1496. ifdef NEED_OFFCHANNEL
  1497. OBJS += offchannel.o
  1498. CFLAGS += -DCONFIG_OFFCHANNEL
  1499. endif
  1500. ifdef CONFIG_MODULE_TESTS
  1501. CFLAGS += -DCONFIG_MODULE_TESTS
  1502. OBJS += wpas_module_tests.o
  1503. OBJS += ../src/utils/utils_module_tests.o
  1504. OBJS += ../src/common/common_module_tests.o
  1505. OBJS += ../src/crypto/crypto_module_tests.o
  1506. ifdef CONFIG_WPS
  1507. OBJS += ../src/wps/wps_module_tests.o
  1508. endif
  1509. endif
  1510. OBJS += ../src/drivers/driver_common.o
  1511. OBJS_priv += ../src/drivers/driver_common.o
  1512. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1513. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
  1514. OBJS_t += ../src/radius/radius_client.o
  1515. OBJS_t += ../src/radius/radius.o
  1516. ifndef CONFIG_AP
  1517. OBJS_t += ../src/utils/ip_addr.o
  1518. endif
  1519. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1520. OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
  1521. OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
  1522. OBJS += $(CONFIG_MAIN).o
  1523. ifdef CONFIG_PRIVSEP
  1524. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
  1525. OBJS_priv += $(OBJS_l2)
  1526. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1527. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1528. OBJS_priv += ../src/utils/common.o
  1529. OBJS_priv += ../src/utils/wpa_debug.o
  1530. OBJS_priv += ../src/utils/wpabuf.o
  1531. OBJS_priv += wpa_priv.o
  1532. ifdef CONFIG_DRIVER_NL80211
  1533. OBJS_priv += ../src/common/ieee802_11_common.o
  1534. endif
  1535. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1536. OBJS += ../src/drivers/driver_privsep.o
  1537. EXTRA_progs += wpa_priv
  1538. else
  1539. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1540. OBJS += $(OBJS_l2)
  1541. endif
  1542. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1543. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1544. OBJS += ../src/drivers/ndis_events.o
  1545. EXTRALIBS += -loleaut32 -lole32 -luuid
  1546. ifdef PLATFORMSDKLIB
  1547. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1548. else
  1549. EXTRALIBS += WbemUuid.Lib
  1550. endif
  1551. endif
  1552. ifdef CONFIG_FST
  1553. CFLAGS += -DCONFIG_FST
  1554. ifdef CONFIG_FST_TEST
  1555. CFLAGS += -DCONFIG_FST_TEST
  1556. endif
  1557. FST_OBJS += ../src/fst/fst.o
  1558. FST_OBJS += ../src/fst/fst_session.o
  1559. FST_OBJS += ../src/fst/fst_iface.o
  1560. FST_OBJS += ../src/fst/fst_group.o
  1561. FST_OBJS += ../src/fst/fst_ctrl_aux.o
  1562. ifdef CONFIG_CTRL_IFACE
  1563. FST_OBJS += ../src/fst/fst_ctrl_iface.o
  1564. endif
  1565. OBJS += $(FST_OBJS)
  1566. OBJS_t += $(FST_OBJS)
  1567. OBJS_t2 += $(FST_OBJS)
  1568. OBJS_nfc += $(FST_OBJS)
  1569. endif
  1570. ifndef LDO
  1571. LDO=$(CC)
  1572. endif
  1573. Q=@
  1574. E=echo
  1575. ifeq ($(V), 1)
  1576. Q=
  1577. E=true
  1578. endif
  1579. ifeq ($(QUIET), 1)
  1580. Q=@
  1581. E=true
  1582. endif
  1583. dynamic_eap_methods: $(EAPDYN)
  1584. ../src/drivers/build.wpa_supplicant:
  1585. @if [ -f ../src/drivers/build.hostapd ]; then \
  1586. $(MAKE) -C ../src/drivers clean; \
  1587. fi
  1588. @touch ../src/drivers/build.wpa_supplicant
  1589. BCHECK=../src/drivers/build.wpa_supplicant
  1590. wpa_priv: $(BCHECK) $(OBJS_priv)
  1591. $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1592. @$(E) " LD " $@
  1593. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  1594. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  1595. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1596. @$(E) " LD " $@
  1597. eapol_test: $(OBJS_t)
  1598. $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1599. @$(E) " LD " $@
  1600. preauth_test: $(OBJS_t2)
  1601. $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1602. @$(E) " LD " $@
  1603. wpa_passphrase: $(OBJS_p)
  1604. $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  1605. @$(E) " LD " $@
  1606. wpa_cli: $(OBJS_c)
  1607. $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1608. @$(E) " LD " $@
  1609. LIBCTRL += ../src/common/wpa_ctrl.o
  1610. LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
  1611. LIBCTRL += ../src/utils/common.o
  1612. LIBCTRL += ../src/utils/wpa_debug.o
  1613. LIBCTRLSO += ../src/common/wpa_ctrl.c
  1614. LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
  1615. LIBCTRLSO += ../src/utils/common.c
  1616. LIBCTRLSO += ../src/utils/wpa_debug.c
  1617. libwpa_client.a: $(LIBCTRL)
  1618. $(Q)rm -f $@
  1619. $(Q)$(AR) crs $@ $?
  1620. @$(E) " AR " $@
  1621. libwpa_client.so: $(LIBCTRLSO)
  1622. @$(E) " CC $@ ($^)"
  1623. $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
  1624. libwpa_test1: libwpa_test.o libwpa_client.a
  1625. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
  1626. @$(E) " LD " $@
  1627. libwpa_test2: libwpa_test.o libwpa_client.so
  1628. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
  1629. @$(E) " LD " $@
  1630. nfc_pw_token: $(OBJS_nfc)
  1631. $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
  1632. @$(E) " LD " $@
  1633. win_if_list: win_if_list.c
  1634. $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1635. @$(E) " LD " $@
  1636. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1637. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1638. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1639. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1640. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1641. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1642. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1643. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1644. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1645. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1646. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1647. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1648. eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c
  1649. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1650. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1651. eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
  1652. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1653. -Deap_peer_eke_register=eap_peer_method_dynamic_init
  1654. %.so: %.c
  1655. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1656. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1657. ifdef CONFIG_CODE_COVERAGE
  1658. %.o: %.c
  1659. @$(E) " CC " $<
  1660. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1661. else
  1662. %.o: %.c
  1663. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1664. @$(E) " CC " $<
  1665. endif
  1666. %.service: %.service.in
  1667. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1668. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1669. @$(E) " sed" $<
  1670. %@.service: %.service.arg.in
  1671. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1672. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1673. @$(E) " sed" $<
  1674. wpa_supplicant.exe: wpa_supplicant
  1675. mv -f $< $@
  1676. wpa_cli.exe: wpa_cli
  1677. mv -f $< $@
  1678. wpa_passphrase.exe: wpa_passphrase
  1679. mv -f $< $@
  1680. win_if_list.exe: win_if_list
  1681. mv -f $< $@
  1682. eapol_test.exe: eapol_test
  1683. mv -f $< $@
  1684. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1685. windows-bin: $(WINALL)
  1686. $(STRIP) $(WINALL)
  1687. wpa_gui:
  1688. @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
  1689. wpa_gui-qt4/Makefile:
  1690. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1691. wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
  1692. lrelease wpa_gui-qt4/wpa_gui.pro
  1693. wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
  1694. $(MAKE) -C wpa_gui-qt4
  1695. FIPSDIR=/usr/local/ssl/fips-2.0
  1696. FIPSLD=$(FIPSDIR)/bin/fipsld
  1697. fips:
  1698. $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
  1699. lcov-html: wpa_supplicant.gcda
  1700. lcov -c -d .. > lcov.info
  1701. genhtml lcov.info --output-directory lcov-html
  1702. clean:
  1703. $(MAKE) -C ../src clean
  1704. $(MAKE) -C dbus clean
  1705. rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
  1706. rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1707. rm -f wpa_priv
  1708. rm -f nfc_pw_token
  1709. rm -f lcov.info
  1710. rm -rf lcov-html
  1711. rm -f libwpa_client.a
  1712. rm -f libwpa_client.so
  1713. rm -f libwpa_test1 libwpa_test2
  1714. -include $(OBJS:%.o=%.d)