Android.mk 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607
  1. #
  2. # Copyright (C) 2008 The Android Open Source Project
  3. #
  4. # This software may be distributed under the terms of the BSD license.
  5. # See README for more details.
  6. #
  7. LOCAL_PATH := $(call my-dir)
  8. PKG_CONFIG ?= pkg-config
  9. ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
  10. CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
  11. endif
  12. include $(LOCAL_PATH)/android.config
  13. # To ignore possible wrong network configurations
  14. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  15. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  16. # Set Android log name
  17. L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
  18. # Disable unused parameter warnings
  19. L_CFLAGS += -Wno-unused-parameter
  20. # Set Android extended P2P functionality
  21. L_CFLAGS += -DANDROID_P2P
  22. ifeq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  23. L_CFLAGS += -DANDROID_LIB_STUB
  24. endif
  25. # Disable roaming in wpa_supplicant
  26. ifdef CONFIG_NO_ROAMING
  27. L_CFLAGS += -DCONFIG_NO_ROAMING
  28. endif
  29. # Use Android specific directory for control interface sockets
  30. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  31. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/misc/wifi/sockets\"
  32. # Use Android specific directory for wpa_cli command completion history
  33. L_CFLAGS += -DCONFIG_WPA_CLI_HISTORY_DIR=\"/data/misc/wifi\"
  34. # To force sizeof(enum) = 4
  35. ifeq ($(TARGET_ARCH),arm)
  36. L_CFLAGS += -mabi=aapcs-linux
  37. endif
  38. INCLUDES = $(LOCAL_PATH)
  39. INCLUDES += $(LOCAL_PATH)/src
  40. INCLUDES += $(LOCAL_PATH)/src/common
  41. # INCLUDES += $(LOCAL_PATH)/src/crypto # To force proper includes
  42. INCLUDES += $(LOCAL_PATH)/src/drivers
  43. INCLUDES += $(LOCAL_PATH)/src/eap_common
  44. INCLUDES += $(LOCAL_PATH)/src/eapol_supp
  45. INCLUDES += $(LOCAL_PATH)/src/eap_peer
  46. INCLUDES += $(LOCAL_PATH)/src/eap_server
  47. INCLUDES += $(LOCAL_PATH)/src/hlr_auc_gw
  48. INCLUDES += $(LOCAL_PATH)/src/l2_packet
  49. INCLUDES += $(LOCAL_PATH)/src/radius
  50. INCLUDES += $(LOCAL_PATH)/src/rsn_supp
  51. INCLUDES += $(LOCAL_PATH)/src/tls
  52. INCLUDES += $(LOCAL_PATH)/src/utils
  53. INCLUDES += $(LOCAL_PATH)/src/wps
  54. INCLUDES += external/openssl/include
  55. INCLUDES += system/security/keystore/include
  56. ifdef CONFIG_DRIVER_NL80211
  57. ifneq ($(wildcard external/libnl),)
  58. INCLUDES += external/libnl/include
  59. else
  60. INCLUDES += external/libnl-headers
  61. endif
  62. endif
  63. ifdef CONFIG_FIPS
  64. CONFIG_NO_RANDOM_POOL=
  65. CONFIG_OPENSSL_CMAC=y
  66. endif
  67. OBJS = config.c
  68. OBJS += notify.c
  69. OBJS += bss.c
  70. OBJS += eap_register.c
  71. OBJS += src/utils/common.c
  72. OBJS += src/utils/wpa_debug.c
  73. OBJS += src/utils/wpabuf.c
  74. OBJS += wmm_ac.c
  75. OBJS_p = wpa_passphrase.c
  76. OBJS_p += src/utils/common.c
  77. OBJS_p += src/utils/wpa_debug.c
  78. OBJS_p += src/utils/wpabuf.c
  79. OBJS_c = wpa_cli.c src/common/wpa_ctrl.c
  80. OBJS_c += src/utils/wpa_debug.c
  81. OBJS_c += src/utils/common.c
  82. OBJS_d =
  83. OBJS_priv =
  84. ifndef CONFIG_OS
  85. ifdef CONFIG_NATIVE_WINDOWS
  86. CONFIG_OS=win32
  87. else
  88. CONFIG_OS=unix
  89. endif
  90. endif
  91. ifeq ($(CONFIG_OS), internal)
  92. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  93. endif
  94. OBJS += src/utils/os_$(CONFIG_OS).c
  95. OBJS_p += src/utils/os_$(CONFIG_OS).c
  96. OBJS_c += src/utils/os_$(CONFIG_OS).c
  97. ifdef CONFIG_WPA_TRACE
  98. L_CFLAGS += -DWPA_TRACE
  99. OBJS += src/utils/trace.c
  100. OBJS_p += src/utils/trace.c
  101. OBJS_c += src/utils/trace.c
  102. LDFLAGS += -rdynamic
  103. L_CFLAGS += -funwind-tables
  104. ifdef CONFIG_WPA_TRACE_BFD
  105. L_CFLAGS += -DWPA_TRACE_BFD
  106. LIBS += -lbfd
  107. LIBS_p += -lbfd
  108. LIBS_c += -lbfd
  109. endif
  110. endif
  111. ifndef CONFIG_ELOOP
  112. CONFIG_ELOOP=eloop
  113. endif
  114. OBJS += src/utils/$(CONFIG_ELOOP).c
  115. OBJS_c += src/utils/$(CONFIG_ELOOP).c
  116. ifdef CONFIG_ELOOP_POLL
  117. L_CFLAGS += -DCONFIG_ELOOP_POLL
  118. endif
  119. ifdef CONFIG_ELOOP_EPOLL
  120. L_CFLAGS += -DCONFIG_ELOOP_EPOLL
  121. endif
  122. ifdef CONFIG_EAPOL_TEST
  123. L_CFLAGS += -Werror -DEAPOL_TEST
  124. endif
  125. ifdef CONFIG_HT_OVERRIDES
  126. L_CFLAGS += -DCONFIG_HT_OVERRIDES
  127. endif
  128. ifdef CONFIG_VHT_OVERRIDES
  129. L_CFLAGS += -DCONFIG_VHT_OVERRIDES
  130. endif
  131. ifndef CONFIG_BACKEND
  132. CONFIG_BACKEND=file
  133. endif
  134. ifeq ($(CONFIG_BACKEND), file)
  135. OBJS += config_file.c
  136. ifndef CONFIG_NO_CONFIG_BLOBS
  137. NEED_BASE64=y
  138. endif
  139. L_CFLAGS += -DCONFIG_BACKEND_FILE
  140. endif
  141. ifeq ($(CONFIG_BACKEND), winreg)
  142. OBJS += config_winreg.c
  143. endif
  144. ifeq ($(CONFIG_BACKEND), none)
  145. OBJS += config_none.c
  146. endif
  147. ifdef CONFIG_NO_CONFIG_WRITE
  148. L_CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  149. endif
  150. ifdef CONFIG_NO_CONFIG_BLOBS
  151. L_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  152. endif
  153. ifdef CONFIG_NO_SCAN_PROCESSING
  154. L_CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  155. endif
  156. ifdef CONFIG_SUITEB
  157. L_CFLAGS += -DCONFIG_SUITEB
  158. NEED_SHA256=y
  159. NEED_AES_OMAC1=y
  160. endif
  161. ifdef CONFIG_SUITEB192
  162. L_CFLAGS += -DCONFIG_SUITEB192
  163. NEED_SHA384=y
  164. endif
  165. ifdef CONFIG_IEEE80211W
  166. L_CFLAGS += -DCONFIG_IEEE80211W
  167. NEED_SHA256=y
  168. NEED_AES_OMAC1=y
  169. endif
  170. ifdef CONFIG_IEEE80211R
  171. L_CFLAGS += -DCONFIG_IEEE80211R
  172. OBJS += src/rsn_supp/wpa_ft.c
  173. NEED_SHA256=y
  174. NEED_AES_OMAC1=y
  175. endif
  176. ifdef CONFIG_MESH
  177. NEED_80211_COMMON=y
  178. NEED_SHA256=y
  179. NEED_AES_SIV=y
  180. NEED_AES_OMAC1=y
  181. NEED_AES_CTR=y
  182. CONFIG_SAE=y
  183. CONFIG_AP=y
  184. L_CFLAGS += -DCONFIG_MESH
  185. OBJS += mesh.c
  186. OBJS += mesh_mpm.c
  187. OBJS += mesh_rsn.c
  188. endif
  189. ifdef CONFIG_SAE
  190. L_CFLAGS += -DCONFIG_SAE
  191. OBJS += src/common/sae.c
  192. NEED_ECC=y
  193. NEED_DH_GROUPS=y
  194. endif
  195. ifdef CONFIG_WNM
  196. L_CFLAGS += -DCONFIG_WNM
  197. OBJS += wnm_sta.c
  198. endif
  199. ifdef CONFIG_TDLS
  200. L_CFLAGS += -DCONFIG_TDLS
  201. OBJS += src/rsn_supp/tdls.c
  202. NEED_SHA256=y
  203. NEED_AES_OMAC1=y
  204. endif
  205. ifdef CONFIG_TDLS_TESTING
  206. L_CFLAGS += -DCONFIG_TDLS_TESTING
  207. endif
  208. ifdef CONFIG_PEERKEY
  209. L_CFLAGS += -DCONFIG_PEERKEY
  210. endif
  211. ifndef CONFIG_NO_WPA
  212. OBJS += src/rsn_supp/wpa.c
  213. OBJS += src/rsn_supp/preauth.c
  214. OBJS += src/rsn_supp/pmksa_cache.c
  215. OBJS += src/rsn_supp/peerkey.c
  216. OBJS += src/rsn_supp/wpa_ie.c
  217. OBJS += src/common/wpa_common.c
  218. NEED_AES=y
  219. NEED_SHA1=y
  220. NEED_MD5=y
  221. NEED_RC4=y
  222. else
  223. L_CFLAGS += -DCONFIG_NO_WPA
  224. endif
  225. ifdef CONFIG_IBSS_RSN
  226. NEED_RSN_AUTHENTICATOR=y
  227. L_CFLAGS += -DCONFIG_IBSS_RSN
  228. OBJS += ibss_rsn.c
  229. endif
  230. ifdef CONFIG_P2P
  231. OBJS += p2p_supplicant.c
  232. OBJS += p2p_supplicant_sd.c
  233. OBJS += src/p2p/p2p.c
  234. OBJS += src/p2p/p2p_utils.c
  235. OBJS += src/p2p/p2p_parse.c
  236. OBJS += src/p2p/p2p_build.c
  237. OBJS += src/p2p/p2p_go_neg.c
  238. OBJS += src/p2p/p2p_sd.c
  239. OBJS += src/p2p/p2p_pd.c
  240. OBJS += src/p2p/p2p_invitation.c
  241. OBJS += src/p2p/p2p_dev_disc.c
  242. OBJS += src/p2p/p2p_group.c
  243. OBJS += src/ap/p2p_hostapd.c
  244. OBJS += src/utils/bitfield.c
  245. L_CFLAGS += -DCONFIG_P2P
  246. NEED_GAS=y
  247. NEED_OFFCHANNEL=y
  248. CONFIG_WPS=y
  249. CONFIG_AP=y
  250. ifdef CONFIG_P2P_STRICT
  251. L_CFLAGS += -DCONFIG_P2P_STRICT
  252. endif
  253. endif
  254. ifdef CONFIG_WIFI_DISPLAY
  255. L_CFLAGS += -DCONFIG_WIFI_DISPLAY
  256. OBJS += wifi_display.c
  257. endif
  258. ifdef CONFIG_HS20
  259. OBJS += hs20_supplicant.c
  260. L_CFLAGS += -DCONFIG_HS20
  261. CONFIG_INTERWORKING=y
  262. NEED_AES_OMAC1=y
  263. endif
  264. ifdef CONFIG_INTERWORKING
  265. OBJS += interworking.c
  266. L_CFLAGS += -DCONFIG_INTERWORKING
  267. NEED_GAS=y
  268. endif
  269. ifdef CONFIG_FST
  270. L_CFLAGS += -DCONFIG_FST
  271. OBJS += src/fst/fst.c
  272. OBJS += src/fst/fst_session.c
  273. OBJS += src/fst/fst_iface.c
  274. OBJS += src/fst/fst_group.c
  275. OBJS += src/fst/fst_ctrl_aux.c
  276. ifdef CONFIG_FST_TEST
  277. L_CFLAGS += -DCONFIG_FST_TEST
  278. endif
  279. ifdef CONFIG_CTRL_IFACE
  280. OBJS += src/fst/fst_ctrl_iface.c
  281. endif
  282. endif
  283. include $(LOCAL_PATH)/src/drivers/drivers.mk
  284. ifdef CONFIG_AP
  285. OBJS_d += $(DRV_BOTH_OBJS)
  286. L_CFLAGS += $(DRV_BOTH_CFLAGS)
  287. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  288. LIBS += $(DRV_BOTH_LIBS)
  289. else
  290. NEED_AP_MLME=
  291. OBJS_d += $(DRV_WPA_OBJS)
  292. L_CFLAGS += $(DRV_WPA_CFLAGS)
  293. LDFLAGS += $(DRV_WPA_LDFLAGS)
  294. LIBS += $(DRV_WPA_LIBS)
  295. endif
  296. ifndef CONFIG_L2_PACKET
  297. CONFIG_L2_PACKET=linux
  298. endif
  299. OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
  300. ifeq ($(CONFIG_L2_PACKET), pcap)
  301. ifdef CONFIG_WINPCAP
  302. L_CFLAGS += -DCONFIG_WINPCAP
  303. LIBS += -lwpcap -lpacket
  304. LIBS_w += -lwpcap
  305. else
  306. LIBS += -ldnet -lpcap
  307. endif
  308. endif
  309. ifeq ($(CONFIG_L2_PACKET), winpcap)
  310. LIBS += -lwpcap -lpacket
  311. LIBS_w += -lwpcap
  312. endif
  313. ifeq ($(CONFIG_L2_PACKET), freebsd)
  314. LIBS += -lpcap
  315. endif
  316. ifdef CONFIG_ERP
  317. L_CFLAGS += -DCONFIG_ERP
  318. NEED_SHA256=y
  319. NEED_HMAC_SHA256_KDF=y
  320. endif
  321. ifdef CONFIG_EAP_TLS
  322. # EAP-TLS
  323. ifeq ($(CONFIG_EAP_TLS), dyn)
  324. L_CFLAGS += -DEAP_TLS_DYNAMIC
  325. EAPDYN += src/eap_peer/eap_tls.so
  326. else
  327. L_CFLAGS += -DEAP_TLS
  328. OBJS += src/eap_peer/eap_tls.c
  329. endif
  330. TLS_FUNCS=y
  331. CONFIG_IEEE8021X_EAPOL=y
  332. endif
  333. ifdef CONFIG_EAP_UNAUTH_TLS
  334. # EAP-UNAUTH-TLS
  335. L_CFLAGS += -DEAP_UNAUTH_TLS
  336. ifndef CONFIG_EAP_TLS
  337. OBJS += src/eap_peer/eap_tls.c
  338. TLS_FUNCS=y
  339. endif
  340. CONFIG_IEEE8021X_EAPOL=y
  341. endif
  342. ifdef CONFIG_EAP_PEAP
  343. # EAP-PEAP
  344. ifeq ($(CONFIG_EAP_PEAP), dyn)
  345. L_CFLAGS += -DEAP_PEAP_DYNAMIC
  346. EAPDYN += src/eap_peer/eap_peap.so
  347. else
  348. L_CFLAGS += -DEAP_PEAP
  349. OBJS += src/eap_peer/eap_peap.c
  350. OBJS += src/eap_common/eap_peap_common.c
  351. endif
  352. TLS_FUNCS=y
  353. CONFIG_IEEE8021X_EAPOL=y
  354. endif
  355. ifdef CONFIG_EAP_TTLS
  356. # EAP-TTLS
  357. ifeq ($(CONFIG_EAP_TTLS), dyn)
  358. L_CFLAGS += -DEAP_TTLS_DYNAMIC
  359. EAPDYN += src/eap_peer/eap_ttls.so
  360. else
  361. L_CFLAGS += -DEAP_TTLS
  362. OBJS += src/eap_peer/eap_ttls.c
  363. endif
  364. TLS_FUNCS=y
  365. ifndef CONFIG_FIPS
  366. MS_FUNCS=y
  367. CHAP=y
  368. endif
  369. CONFIG_IEEE8021X_EAPOL=y
  370. endif
  371. ifdef CONFIG_EAP_MD5
  372. # EAP-MD5
  373. ifeq ($(CONFIG_EAP_MD5), dyn)
  374. L_CFLAGS += -DEAP_MD5_DYNAMIC
  375. EAPDYN += src/eap_peer/eap_md5.so
  376. else
  377. L_CFLAGS += -DEAP_MD5
  378. OBJS += src/eap_peer/eap_md5.c
  379. endif
  380. CHAP=y
  381. CONFIG_IEEE8021X_EAPOL=y
  382. endif
  383. # backwards compatibility for old spelling
  384. ifdef CONFIG_MSCHAPV2
  385. ifndef CONFIG_EAP_MSCHAPV2
  386. CONFIG_EAP_MSCHAPV2=y
  387. endif
  388. endif
  389. ifdef CONFIG_EAP_MSCHAPV2
  390. # EAP-MSCHAPv2
  391. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  392. L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  393. EAPDYN += src/eap_peer/eap_mschapv2.so
  394. EAPDYN += src/eap_peer/mschapv2.so
  395. else
  396. L_CFLAGS += -DEAP_MSCHAPv2
  397. OBJS += src/eap_peer/eap_mschapv2.c
  398. OBJS += src/eap_peer/mschapv2.c
  399. endif
  400. MS_FUNCS=y
  401. CONFIG_IEEE8021X_EAPOL=y
  402. endif
  403. ifdef CONFIG_EAP_GTC
  404. # EAP-GTC
  405. ifeq ($(CONFIG_EAP_GTC), dyn)
  406. L_CFLAGS += -DEAP_GTC_DYNAMIC
  407. EAPDYN += src/eap_peer/eap_gtc.so
  408. else
  409. L_CFLAGS += -DEAP_GTC
  410. OBJS += src/eap_peer/eap_gtc.c
  411. endif
  412. CONFIG_IEEE8021X_EAPOL=y
  413. endif
  414. ifdef CONFIG_EAP_OTP
  415. # EAP-OTP
  416. ifeq ($(CONFIG_EAP_OTP), dyn)
  417. L_CFLAGS += -DEAP_OTP_DYNAMIC
  418. EAPDYN += src/eap_peer/eap_otp.so
  419. else
  420. L_CFLAGS += -DEAP_OTP
  421. OBJS += src/eap_peer/eap_otp.c
  422. endif
  423. CONFIG_IEEE8021X_EAPOL=y
  424. endif
  425. ifdef CONFIG_EAP_SIM
  426. # EAP-SIM
  427. ifeq ($(CONFIG_EAP_SIM), dyn)
  428. L_CFLAGS += -DEAP_SIM_DYNAMIC
  429. EAPDYN += src/eap_peer/eap_sim.so
  430. else
  431. L_CFLAGS += -DEAP_SIM
  432. OBJS += src/eap_peer/eap_sim.c
  433. endif
  434. CONFIG_IEEE8021X_EAPOL=y
  435. CONFIG_EAP_SIM_COMMON=y
  436. NEED_AES_CBC=y
  437. endif
  438. ifdef CONFIG_EAP_LEAP
  439. # EAP-LEAP
  440. ifeq ($(CONFIG_EAP_LEAP), dyn)
  441. L_CFLAGS += -DEAP_LEAP_DYNAMIC
  442. EAPDYN += src/eap_peer/eap_leap.so
  443. else
  444. L_CFLAGS += -DEAP_LEAP
  445. OBJS += src/eap_peer/eap_leap.c
  446. endif
  447. MS_FUNCS=y
  448. CONFIG_IEEE8021X_EAPOL=y
  449. endif
  450. ifdef CONFIG_EAP_PSK
  451. # EAP-PSK
  452. ifeq ($(CONFIG_EAP_PSK), dyn)
  453. L_CFLAGS += -DEAP_PSK_DYNAMIC
  454. EAPDYN += src/eap_peer/eap_psk.so
  455. else
  456. L_CFLAGS += -DEAP_PSK
  457. OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
  458. endif
  459. CONFIG_IEEE8021X_EAPOL=y
  460. NEED_AES=y
  461. NEED_AES_OMAC1=y
  462. NEED_AES_ENCBLOCK=y
  463. NEED_AES_EAX=y
  464. endif
  465. ifdef CONFIG_EAP_AKA
  466. # EAP-AKA
  467. ifeq ($(CONFIG_EAP_AKA), dyn)
  468. L_CFLAGS += -DEAP_AKA_DYNAMIC
  469. EAPDYN += src/eap_peer/eap_aka.so
  470. else
  471. L_CFLAGS += -DEAP_AKA
  472. OBJS += src/eap_peer/eap_aka.c
  473. endif
  474. CONFIG_IEEE8021X_EAPOL=y
  475. CONFIG_EAP_SIM_COMMON=y
  476. NEED_AES_CBC=y
  477. endif
  478. ifdef CONFIG_EAP_PROXY
  479. L_CFLAGS += -DCONFIG_EAP_PROXY
  480. OBJS += src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).c
  481. include $(LOCAL_PATH)/eap_proxy_$(CONFIG_EAP_PROXY).mk
  482. CONFIG_IEEE8021X_EAPOL=y
  483. endif
  484. ifdef CONFIG_EAP_AKA_PRIME
  485. # EAP-AKA'
  486. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  487. L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  488. else
  489. L_CFLAGS += -DEAP_AKA_PRIME
  490. endif
  491. NEED_SHA256=y
  492. endif
  493. ifdef CONFIG_EAP_SIM_COMMON
  494. OBJS += src/eap_common/eap_sim_common.c
  495. NEED_AES=y
  496. NEED_FIPS186_2_PRF=y
  497. endif
  498. ifdef CONFIG_EAP_FAST
  499. # EAP-FAST
  500. ifeq ($(CONFIG_EAP_FAST), dyn)
  501. L_CFLAGS += -DEAP_FAST_DYNAMIC
  502. EAPDYN += src/eap_peer/eap_fast.so
  503. EAPDYN += src/eap_common/eap_fast_common.c
  504. else
  505. L_CFLAGS += -DEAP_FAST
  506. OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
  507. OBJS += src/eap_common/eap_fast_common.c
  508. endif
  509. TLS_FUNCS=y
  510. CONFIG_IEEE8021X_EAPOL=y
  511. NEED_T_PRF=y
  512. endif
  513. ifdef CONFIG_EAP_PAX
  514. # EAP-PAX
  515. ifeq ($(CONFIG_EAP_PAX), dyn)
  516. L_CFLAGS += -DEAP_PAX_DYNAMIC
  517. EAPDYN += src/eap_peer/eap_pax.so
  518. else
  519. L_CFLAGS += -DEAP_PAX
  520. OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
  521. endif
  522. CONFIG_IEEE8021X_EAPOL=y
  523. endif
  524. ifdef CONFIG_EAP_SAKE
  525. # EAP-SAKE
  526. ifeq ($(CONFIG_EAP_SAKE), dyn)
  527. L_CFLAGS += -DEAP_SAKE_DYNAMIC
  528. EAPDYN += src/eap_peer/eap_sake.so
  529. else
  530. L_CFLAGS += -DEAP_SAKE
  531. OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
  532. endif
  533. CONFIG_IEEE8021X_EAPOL=y
  534. endif
  535. ifdef CONFIG_EAP_GPSK
  536. # EAP-GPSK
  537. ifeq ($(CONFIG_EAP_GPSK), dyn)
  538. L_CFLAGS += -DEAP_GPSK_DYNAMIC
  539. EAPDYN += src/eap_peer/eap_gpsk.so
  540. else
  541. L_CFLAGS += -DEAP_GPSK
  542. OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
  543. endif
  544. CONFIG_IEEE8021X_EAPOL=y
  545. ifdef CONFIG_EAP_GPSK_SHA256
  546. L_CFLAGS += -DEAP_GPSK_SHA256
  547. endif
  548. NEED_SHA256=y
  549. NEED_AES_OMAC1=y
  550. endif
  551. ifdef CONFIG_EAP_PWD
  552. L_CFLAGS += -DEAP_PWD
  553. OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
  554. CONFIG_IEEE8021X_EAPOL=y
  555. NEED_SHA256=y
  556. endif
  557. ifdef CONFIG_EAP_EKE
  558. # EAP-EKE
  559. ifeq ($(CONFIG_EAP_EKE), dyn)
  560. L_CFLAGS += -DEAP_EKE_DYNAMIC
  561. EAPDYN += src/eap_peer/eap_eke.so
  562. else
  563. L_CFLAGS += -DEAP_EKE
  564. OBJS += src/eap_peer/eap_eke.c src/eap_common/eap_eke_common.c
  565. endif
  566. CONFIG_IEEE8021X_EAPOL=y
  567. NEED_DH_GROUPS=y
  568. NEED_DH_GROUPS_ALL=y
  569. NEED_SHA256=y
  570. NEED_AES_CBC=y
  571. endif
  572. ifdef CONFIG_WPS
  573. # EAP-WSC
  574. L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
  575. OBJS += wps_supplicant.c
  576. OBJS += src/utils/uuid.c
  577. OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
  578. OBJS += src/wps/wps.c
  579. OBJS += src/wps/wps_common.c
  580. OBJS += src/wps/wps_attr_parse.c
  581. OBJS += src/wps/wps_attr_build.c
  582. OBJS += src/wps/wps_attr_process.c
  583. OBJS += src/wps/wps_dev_attr.c
  584. OBJS += src/wps/wps_enrollee.c
  585. OBJS += src/wps/wps_registrar.c
  586. CONFIG_IEEE8021X_EAPOL=y
  587. NEED_DH_GROUPS=y
  588. NEED_SHA256=y
  589. NEED_BASE64=y
  590. NEED_AES_CBC=y
  591. NEED_MODEXP=y
  592. ifdef CONFIG_WPS_NFC
  593. L_CFLAGS += -DCONFIG_WPS_NFC
  594. OBJS += src/wps/ndef.c
  595. NEED_WPS_OOB=y
  596. endif
  597. ifdef NEED_WPS_OOB
  598. L_CFLAGS += -DCONFIG_WPS_OOB
  599. endif
  600. ifdef CONFIG_WPS_ER
  601. CONFIG_WPS_UPNP=y
  602. L_CFLAGS += -DCONFIG_WPS_ER
  603. OBJS += src/wps/wps_er.c
  604. OBJS += src/wps/wps_er_ssdp.c
  605. endif
  606. ifdef CONFIG_WPS_UPNP
  607. L_CFLAGS += -DCONFIG_WPS_UPNP
  608. OBJS += src/wps/wps_upnp.c
  609. OBJS += src/wps/wps_upnp_ssdp.c
  610. OBJS += src/wps/wps_upnp_web.c
  611. OBJS += src/wps/wps_upnp_event.c
  612. OBJS += src/wps/wps_upnp_ap.c
  613. OBJS += src/wps/upnp_xml.c
  614. OBJS += src/wps/httpread.c
  615. OBJS += src/wps/http_client.c
  616. OBJS += src/wps/http_server.c
  617. endif
  618. ifdef CONFIG_WPS_STRICT
  619. L_CFLAGS += -DCONFIG_WPS_STRICT
  620. OBJS += src/wps/wps_validate.c
  621. endif
  622. ifdef CONFIG_WPS_TESTING
  623. L_CFLAGS += -DCONFIG_WPS_TESTING
  624. endif
  625. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  626. L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  627. endif
  628. endif
  629. ifdef CONFIG_EAP_IKEV2
  630. # EAP-IKEv2
  631. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  632. L_CFLAGS += -DEAP_IKEV2_DYNAMIC
  633. EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
  634. EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  635. else
  636. L_CFLAGS += -DEAP_IKEV2
  637. OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
  638. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  639. endif
  640. CONFIG_IEEE8021X_EAPOL=y
  641. NEED_DH_GROUPS=y
  642. NEED_DH_GROUPS_ALL=y
  643. NEED_MODEXP=y
  644. NEED_CIPHER=y
  645. endif
  646. ifdef CONFIG_EAP_VENDOR_TEST
  647. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  648. L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  649. EAPDYN += src/eap_peer/eap_vendor_test.so
  650. else
  651. L_CFLAGS += -DEAP_VENDOR_TEST
  652. OBJS += src/eap_peer/eap_vendor_test.c
  653. endif
  654. CONFIG_IEEE8021X_EAPOL=y
  655. endif
  656. ifdef CONFIG_EAP_TNC
  657. # EAP-TNC
  658. L_CFLAGS += -DEAP_TNC
  659. OBJS += src/eap_peer/eap_tnc.c
  660. OBJS += src/eap_peer/tncc.c
  661. NEED_BASE64=y
  662. ifndef CONFIG_NATIVE_WINDOWS
  663. ifndef CONFIG_DRIVER_BSD
  664. LIBS += -ldl
  665. endif
  666. endif
  667. endif
  668. ifdef CONFIG_IEEE8021X_EAPOL
  669. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  670. L_CFLAGS += -DIEEE8021X_EAPOL
  671. OBJS += src/eapol_supp/eapol_supp_sm.c
  672. OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
  673. NEED_EAP_COMMON=y
  674. ifdef CONFIG_DYNAMIC_EAP_METHODS
  675. L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  676. LIBS += -ldl -rdynamic
  677. endif
  678. endif
  679. ifdef CONFIG_AP
  680. NEED_EAP_COMMON=y
  681. NEED_RSN_AUTHENTICATOR=y
  682. L_CFLAGS += -DCONFIG_AP
  683. OBJS += ap.c
  684. L_CFLAGS += -DCONFIG_NO_RADIUS
  685. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  686. L_CFLAGS += -DCONFIG_NO_VLAN
  687. OBJS += src/ap/hostapd.c
  688. OBJS += src/ap/wpa_auth_glue.c
  689. OBJS += src/ap/utils.c
  690. OBJS += src/ap/authsrv.c
  691. OBJS += src/ap/ap_config.c
  692. OBJS += src/utils/ip_addr.c
  693. OBJS += src/ap/sta_info.c
  694. OBJS += src/ap/tkip_countermeasures.c
  695. OBJS += src/ap/ap_mlme.c
  696. OBJS += src/ap/ieee802_1x.c
  697. OBJS += src/eapol_auth/eapol_auth_sm.c
  698. OBJS += src/ap/ieee802_11_auth.c
  699. OBJS += src/ap/ieee802_11_shared.c
  700. OBJS += src/ap/drv_callbacks.c
  701. OBJS += src/ap/ap_drv_ops.c
  702. OBJS += src/ap/beacon.c
  703. OBJS += src/ap/bss_load.c
  704. OBJS += src/ap/eap_user_db.c
  705. ifdef CONFIG_IEEE80211N
  706. OBJS += src/ap/ieee802_11_ht.c
  707. ifdef CONFIG_IEEE80211AC
  708. OBJS += src/ap/ieee802_11_vht.c
  709. endif
  710. endif
  711. ifdef CONFIG_WNM
  712. OBJS += src/ap/wnm_ap.c
  713. endif
  714. ifdef CONFIG_CTRL_IFACE
  715. OBJS += src/ap/ctrl_iface_ap.c
  716. endif
  717. L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  718. OBJS += src/eap_server/eap_server.c
  719. OBJS += src/eap_server/eap_server_identity.c
  720. OBJS += src/eap_server/eap_server_methods.c
  721. ifdef CONFIG_IEEE80211N
  722. L_CFLAGS += -DCONFIG_IEEE80211N
  723. ifdef CONFIG_IEEE80211AC
  724. L_CFLAGS += -DCONFIG_IEEE80211AC
  725. endif
  726. endif
  727. ifdef NEED_AP_MLME
  728. OBJS += src/ap/wmm.c
  729. OBJS += src/ap/ap_list.c
  730. OBJS += src/ap/ieee802_11.c
  731. OBJS += src/ap/hw_features.c
  732. OBJS += src/ap/dfs.c
  733. L_CFLAGS += -DNEED_AP_MLME
  734. endif
  735. ifdef CONFIG_WPS
  736. L_CFLAGS += -DEAP_SERVER_WSC
  737. OBJS += src/ap/wps_hostapd.c
  738. OBJS += src/eap_server/eap_server_wsc.c
  739. endif
  740. ifdef CONFIG_INTERWORKING
  741. OBJS += src/ap/gas_serv.c
  742. endif
  743. ifdef CONFIG_HS20
  744. OBJS += src/ap/hs20.c
  745. endif
  746. endif
  747. ifdef NEED_RSN_AUTHENTICATOR
  748. L_CFLAGS += -DCONFIG_NO_RADIUS
  749. NEED_AES_WRAP=y
  750. OBJS += src/ap/wpa_auth.c
  751. OBJS += src/ap/wpa_auth_ie.c
  752. OBJS += src/ap/pmksa_cache_auth.c
  753. ifdef CONFIG_IEEE80211R
  754. OBJS += src/ap/wpa_auth_ft.c
  755. endif
  756. ifdef CONFIG_PEERKEY
  757. OBJS += src/ap/peerkey_auth.c
  758. endif
  759. endif
  760. ifdef CONFIG_PCSC
  761. # PC/SC interface for smartcards (USIM, GSM SIM)
  762. L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  763. OBJS += src/utils/pcsc_funcs.c
  764. # -lpthread may not be needed depending on how pcsc-lite was configured
  765. ifdef CONFIG_NATIVE_WINDOWS
  766. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  767. #dynamic symbol loading that is now used in pcsc_funcs.c
  768. #LIBS += -lwinscard
  769. else
  770. LIBS += -lpcsclite -lpthread
  771. endif
  772. endif
  773. ifdef CONFIG_SIM_SIMULATOR
  774. L_CFLAGS += -DCONFIG_SIM_SIMULATOR
  775. NEED_MILENAGE=y
  776. endif
  777. ifdef CONFIG_USIM_SIMULATOR
  778. L_CFLAGS += -DCONFIG_USIM_SIMULATOR
  779. NEED_MILENAGE=y
  780. endif
  781. ifdef NEED_MILENAGE
  782. OBJS += src/crypto/milenage.c
  783. NEED_AES_ENCBLOCK=y
  784. endif
  785. ifdef CONFIG_PKCS12
  786. L_CFLAGS += -DPKCS12_FUNCS
  787. endif
  788. ifdef CONFIG_SMARTCARD
  789. L_CFLAGS += -DCONFIG_SMARTCARD
  790. endif
  791. ifdef MS_FUNCS
  792. OBJS += src/crypto/ms_funcs.c
  793. NEED_DES=y
  794. NEED_MD4=y
  795. endif
  796. ifdef CHAP
  797. OBJS += src/eap_common/chap.c
  798. endif
  799. ifdef TLS_FUNCS
  800. NEED_DES=y
  801. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  802. OBJS += src/eap_peer/eap_tls_common.c
  803. ifndef CONFIG_FIPS
  804. NEED_TLS_PRF=y
  805. NEED_SHA1=y
  806. NEED_MD5=y
  807. endif
  808. endif
  809. ifndef CONFIG_TLS
  810. CONFIG_TLS=openssl
  811. endif
  812. ifdef CONFIG_TLSV11
  813. L_CFLAGS += -DCONFIG_TLSV11
  814. endif
  815. ifdef CONFIG_TLSV12
  816. L_CFLAGS += -DCONFIG_TLSV12
  817. NEED_SHA256=y
  818. endif
  819. ifeq ($(CONFIG_TLS), openssl)
  820. ifdef TLS_FUNCS
  821. L_CFLAGS += -DEAP_TLS_OPENSSL
  822. OBJS += src/crypto/tls_openssl.c
  823. OBJS += src/crypto/tls_openssl_ocsp.c
  824. LIBS += -lssl
  825. endif
  826. OBJS += src/crypto/crypto_openssl.c
  827. OBJS_p += src/crypto/crypto_openssl.c
  828. ifdef NEED_FIPS186_2_PRF
  829. OBJS += src/crypto/fips_prf_openssl.c
  830. endif
  831. NEED_SHA256=y
  832. NEED_TLS_PRF_SHA256=y
  833. LIBS += -lcrypto
  834. LIBS_p += -lcrypto
  835. ifdef CONFIG_TLS_ADD_DL
  836. LIBS += -ldl
  837. LIBS_p += -ldl
  838. endif
  839. endif
  840. ifeq ($(CONFIG_TLS), gnutls)
  841. ifdef TLS_FUNCS
  842. OBJS += src/crypto/tls_gnutls.c
  843. LIBS += -lgnutls -lgpg-error
  844. endif
  845. OBJS += src/crypto/crypto_gnutls.c
  846. OBJS_p += src/crypto/crypto_gnutls.c
  847. ifdef NEED_FIPS186_2_PRF
  848. OBJS += src/crypto/fips_prf_internal.c
  849. OBJS += src/crypto/sha1-internal.c
  850. endif
  851. LIBS += -lgcrypt
  852. LIBS_p += -lgcrypt
  853. CONFIG_INTERNAL_SHA256=y
  854. CONFIG_INTERNAL_RC4=y
  855. CONFIG_INTERNAL_DH_GROUP5=y
  856. endif
  857. ifeq ($(CONFIG_TLS), internal)
  858. ifndef CONFIG_CRYPTO
  859. CONFIG_CRYPTO=internal
  860. endif
  861. ifdef TLS_FUNCS
  862. OBJS += src/crypto/crypto_internal-rsa.c
  863. OBJS += src/crypto/tls_internal.c
  864. OBJS += src/tls/tlsv1_common.c
  865. OBJS += src/tls/tlsv1_record.c
  866. OBJS += src/tls/tlsv1_cred.c
  867. OBJS += src/tls/tlsv1_client.c
  868. OBJS += src/tls/tlsv1_client_write.c
  869. OBJS += src/tls/tlsv1_client_read.c
  870. OBJS += src/tls/asn1.c
  871. OBJS += src/tls/rsa.c
  872. OBJS += src/tls/x509v3.c
  873. OBJS += src/tls/pkcs1.c
  874. OBJS += src/tls/pkcs5.c
  875. OBJS += src/tls/pkcs8.c
  876. NEED_SHA256=y
  877. NEED_BASE64=y
  878. NEED_TLS_PRF=y
  879. ifdef CONFIG_TLSV12
  880. NEED_TLS_PRF_SHA256=y
  881. endif
  882. NEED_MODEXP=y
  883. NEED_CIPHER=y
  884. L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  885. endif
  886. ifdef NEED_CIPHER
  887. NEED_DES=y
  888. OBJS += src/crypto/crypto_internal-cipher.c
  889. endif
  890. ifdef NEED_MODEXP
  891. OBJS += src/crypto/crypto_internal-modexp.c
  892. OBJS += src/tls/bignum.c
  893. endif
  894. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  895. OBJS += src/crypto/crypto_libtomcrypt.c
  896. OBJS_p += src/crypto/crypto_libtomcrypt.c
  897. LIBS += -ltomcrypt -ltfm
  898. LIBS_p += -ltomcrypt -ltfm
  899. CONFIG_INTERNAL_SHA256=y
  900. CONFIG_INTERNAL_RC4=y
  901. CONFIG_INTERNAL_DH_GROUP5=y
  902. endif
  903. ifeq ($(CONFIG_CRYPTO), internal)
  904. OBJS += src/crypto/crypto_internal.c
  905. OBJS_p += src/crypto/crypto_internal.c
  906. NEED_AES_ENC=y
  907. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  908. ifdef CONFIG_INTERNAL_LIBTOMMATH
  909. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  910. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  911. L_CFLAGS += -DLTM_FAST
  912. endif
  913. else
  914. LIBS += -ltommath
  915. LIBS_p += -ltommath
  916. endif
  917. CONFIG_INTERNAL_AES=y
  918. CONFIG_INTERNAL_DES=y
  919. CONFIG_INTERNAL_SHA1=y
  920. CONFIG_INTERNAL_MD4=y
  921. CONFIG_INTERNAL_MD5=y
  922. CONFIG_INTERNAL_SHA256=y
  923. CONFIG_INTERNAL_SHA384=y
  924. CONFIG_INTERNAL_SHA512=y
  925. CONFIG_INTERNAL_RC4=y
  926. CONFIG_INTERNAL_DH_GROUP5=y
  927. endif
  928. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  929. OBJS += src/crypto/crypto_cryptoapi.c
  930. OBJS_p += src/crypto/crypto_cryptoapi.c
  931. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  932. CONFIG_INTERNAL_SHA256=y
  933. CONFIG_INTERNAL_RC4=y
  934. endif
  935. endif
  936. ifeq ($(CONFIG_TLS), none)
  937. ifdef TLS_FUNCS
  938. OBJS += src/crypto/tls_none.c
  939. L_CFLAGS += -DEAP_TLS_NONE
  940. CONFIG_INTERNAL_AES=y
  941. CONFIG_INTERNAL_SHA1=y
  942. CONFIG_INTERNAL_MD5=y
  943. endif
  944. OBJS += src/crypto/crypto_none.c
  945. OBJS_p += src/crypto/crypto_none.c
  946. CONFIG_INTERNAL_SHA256=y
  947. CONFIG_INTERNAL_RC4=y
  948. endif
  949. ifdef TLS_FUNCS
  950. ifdef CONFIG_SMARTCARD
  951. ifndef CONFIG_NATIVE_WINDOWS
  952. ifneq ($(CONFIG_L2_PACKET), freebsd)
  953. LIBS += -ldl
  954. endif
  955. endif
  956. endif
  957. endif
  958. ifndef TLS_FUNCS
  959. OBJS += src/crypto/tls_none.c
  960. ifeq ($(CONFIG_TLS), internal)
  961. CONFIG_INTERNAL_AES=y
  962. CONFIG_INTERNAL_SHA1=y
  963. CONFIG_INTERNAL_MD5=y
  964. CONFIG_INTERNAL_RC4=y
  965. endif
  966. endif
  967. AESOBJS = # none so far (see below)
  968. ifdef CONFIG_INTERNAL_AES
  969. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c
  970. endif
  971. ifneq ($(CONFIG_TLS), openssl)
  972. NEED_INTERNAL_AES_WRAP=y
  973. endif
  974. ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
  975. # Seems to be needed at least with BoringSSL
  976. NEED_INTERNAL_AES_WRAP=y
  977. L_CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
  978. endif
  979. ifdef CONFIG_FIPS
  980. # Have to use internal AES key wrap routines to use OpenSSL EVP since the
  981. # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
  982. NEED_INTERNAL_AES_WRAP=y
  983. endif
  984. ifdef NEED_INTERNAL_AES_WRAP
  985. AESOBJS += src/crypto/aes-unwrap.c
  986. endif
  987. ifdef NEED_AES_EAX
  988. AESOBJS += src/crypto/aes-eax.c
  989. NEED_AES_CTR=y
  990. endif
  991. ifdef NEED_AES_CTR
  992. AESOBJS += src/crypto/aes-ctr.c
  993. endif
  994. ifdef NEED_AES_ENCBLOCK
  995. AESOBJS += src/crypto/aes-encblock.c
  996. endif
  997. ifdef NEED_AES_OMAC1
  998. NEED_AES_ENC=y
  999. ifdef CONFIG_OPENSSL_CMAC
  1000. L_CFLAGS += -DCONFIG_OPENSSL_CMAC
  1001. else
  1002. AESOBJS += src/crypto/aes-omac1.c
  1003. endif
  1004. endif
  1005. ifdef NEED_AES_WRAP
  1006. NEED_AES_ENC=y
  1007. ifdef NEED_INTERNAL_AES_WRAP
  1008. AESOBJS += src/crypto/aes-wrap.c
  1009. endif
  1010. endif
  1011. ifdef NEED_AES_CBC
  1012. NEED_AES_ENC=y
  1013. ifneq ($(CONFIG_TLS), openssl)
  1014. AESOBJS += src/crypto/aes-cbc.c
  1015. endif
  1016. endif
  1017. ifdef NEED_AES_ENC
  1018. ifdef CONFIG_INTERNAL_AES
  1019. AESOBJS += src/crypto/aes-internal-enc.c
  1020. endif
  1021. endif
  1022. ifdef NEED_AES_SIV
  1023. AESOBJS += src/crypto/aes-siv.c
  1024. endif
  1025. ifdef NEED_AES
  1026. OBJS += $(AESOBJS)
  1027. endif
  1028. SHA1OBJS =
  1029. ifdef NEED_SHA1
  1030. ifneq ($(CONFIG_TLS), openssl)
  1031. SHA1OBJS += src/crypto/sha1.c
  1032. endif
  1033. SHA1OBJS += src/crypto/sha1-prf.c
  1034. ifdef CONFIG_INTERNAL_SHA1
  1035. SHA1OBJS += src/crypto/sha1-internal.c
  1036. ifdef NEED_FIPS186_2_PRF
  1037. SHA1OBJS += src/crypto/fips_prf_internal.c
  1038. endif
  1039. endif
  1040. ifdef CONFIG_NO_WPA_PASSPHRASE
  1041. L_CFLAGS += -DCONFIG_NO_PBKDF2
  1042. else
  1043. ifneq ($(CONFIG_TLS), openssl)
  1044. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  1045. endif
  1046. endif
  1047. ifdef NEED_T_PRF
  1048. SHA1OBJS += src/crypto/sha1-tprf.c
  1049. endif
  1050. ifdef NEED_TLS_PRF
  1051. SHA1OBJS += src/crypto/sha1-tlsprf.c
  1052. endif
  1053. endif
  1054. MD5OBJS =
  1055. ifndef CONFIG_FIPS
  1056. ifneq ($(CONFIG_TLS), openssl)
  1057. MD5OBJS += src/crypto/md5.c
  1058. endif
  1059. endif
  1060. ifdef NEED_MD5
  1061. ifdef CONFIG_INTERNAL_MD5
  1062. MD5OBJS += src/crypto/md5-internal.c
  1063. endif
  1064. OBJS += $(MD5OBJS)
  1065. OBJS_p += $(MD5OBJS)
  1066. endif
  1067. ifdef NEED_MD4
  1068. ifdef CONFIG_INTERNAL_MD4
  1069. OBJS += src/crypto/md4-internal.c
  1070. endif
  1071. endif
  1072. DESOBJS = # none needed when not internal
  1073. ifdef NEED_DES
  1074. ifdef CONFIG_INTERNAL_DES
  1075. DESOBJS += src/crypto/des-internal.c
  1076. endif
  1077. endif
  1078. ifdef CONFIG_NO_RC4
  1079. L_CFLAGS += -DCONFIG_NO_RC4
  1080. endif
  1081. ifdef NEED_RC4
  1082. ifdef CONFIG_INTERNAL_RC4
  1083. ifndef CONFIG_NO_RC4
  1084. OBJS += src/crypto/rc4.c
  1085. endif
  1086. endif
  1087. endif
  1088. SHA256OBJS = # none by default
  1089. ifdef NEED_SHA256
  1090. L_CFLAGS += -DCONFIG_SHA256
  1091. ifneq ($(CONFIG_TLS), openssl)
  1092. SHA256OBJS += src/crypto/sha256.c
  1093. endif
  1094. SHA256OBJS += src/crypto/sha256-prf.c
  1095. ifdef CONFIG_INTERNAL_SHA256
  1096. SHA256OBJS += src/crypto/sha256-internal.c
  1097. endif
  1098. ifdef CONFIG_INTERNAL_SHA384
  1099. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  1100. SHA256OBJS += src/crypto/sha384-internal.c
  1101. endif
  1102. ifdef CONFIG_INTERNAL_SHA512
  1103. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  1104. SHA256OBJS += src/crypto/sha512-internal.c
  1105. endif
  1106. ifdef NEED_TLS_PRF_SHA256
  1107. SHA256OBJS += src/crypto/sha256-tlsprf.c
  1108. endif
  1109. ifdef NEED_HMAC_SHA256_KDF
  1110. L_CFLAGS += -DCONFIG_HMAC_SHA256_KDF
  1111. SHA256OBJS += src/crypto/sha256-kdf.c
  1112. endif
  1113. OBJS += $(SHA256OBJS)
  1114. endif
  1115. ifdef NEED_SHA384
  1116. L_CFLAGS += -DCONFIG_SHA384
  1117. OBJS += src/crypto/sha384-prf.c
  1118. endif
  1119. ifdef NEED_DH_GROUPS
  1120. OBJS += src/crypto/dh_groups.c
  1121. endif
  1122. ifdef NEED_DH_GROUPS_ALL
  1123. L_CFLAGS += -DALL_DH_GROUPS
  1124. endif
  1125. ifdef CONFIG_INTERNAL_DH_GROUP5
  1126. ifdef NEED_DH_GROUPS
  1127. OBJS += src/crypto/dh_group5.c
  1128. endif
  1129. endif
  1130. ifdef NEED_ECC
  1131. L_CFLAGS += -DCONFIG_ECC
  1132. endif
  1133. ifdef CONFIG_NO_RANDOM_POOL
  1134. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1135. else
  1136. OBJS += src/crypto/random.c
  1137. endif
  1138. ifdef CONFIG_CTRL_IFACE
  1139. ifeq ($(CONFIG_CTRL_IFACE), y)
  1140. ifdef CONFIG_NATIVE_WINDOWS
  1141. CONFIG_CTRL_IFACE=named_pipe
  1142. else
  1143. CONFIG_CTRL_IFACE=unix
  1144. endif
  1145. endif
  1146. L_CFLAGS += -DCONFIG_CTRL_IFACE
  1147. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1148. L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1149. endif
  1150. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1151. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1152. endif
  1153. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1154. L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1155. endif
  1156. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1157. CONFIG_CTRL_IFACE=udp
  1158. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1159. L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1160. endif
  1161. OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
  1162. endif
  1163. ifdef CONFIG_CTRL_IFACE_DBUS
  1164. DBUS=y
  1165. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1166. DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c
  1167. ifdef CONFIG_WPS
  1168. DBUS_OBJS += dbus/dbus_old_handlers_wps.c
  1169. endif
  1170. DBUS_OBJS += dbus/dbus_dict_helpers.c
  1171. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1172. endif
  1173. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1174. DBUS=y
  1175. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1176. DBUS_OBJS ?= dbus/dbus_dict_helpers.c
  1177. DBUS_OBJS += dbus/dbus_new_helpers.c
  1178. DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
  1179. ifdef CONFIG_WPS
  1180. DBUS_OBJS += dbus/dbus_new_handlers_wps.c
  1181. endif
  1182. ifdef CONFIG_P2P
  1183. DBUS_OBJS += dbus/dbus_new_handlers_p2p.c
  1184. endif
  1185. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1186. DBUS_OBJS += dbus/dbus_new_introspect.c
  1187. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1188. endif
  1189. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1190. endif
  1191. ifdef DBUS
  1192. DBUS_CFLAGS += -DCONFIG_DBUS
  1193. DBUS_OBJS += dbus/dbus_common.c
  1194. endif
  1195. OBJS += $(DBUS_OBJS)
  1196. L_CFLAGS += $(DBUS_CFLAGS)
  1197. ifdef CONFIG_READLINE
  1198. OBJS_c += src/utils/edit_readline.c
  1199. LIBS_c += -lncurses -lreadline
  1200. else
  1201. ifdef CONFIG_WPA_CLI_EDIT
  1202. OBJS_c += src/utils/edit.c
  1203. else
  1204. OBJS_c += src/utils/edit_simple.c
  1205. endif
  1206. endif
  1207. ifdef CONFIG_NATIVE_WINDOWS
  1208. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1209. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1210. LIBS_c += -lws2_32
  1211. LIBS_p += -lws2_32 -lgdi32
  1212. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1213. LIBS_p += -lcrypt32
  1214. endif
  1215. endif
  1216. ifdef CONFIG_NO_STDOUT_DEBUG
  1217. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1218. ifndef CONFIG_CTRL_IFACE
  1219. L_CFLAGS += -DCONFIG_NO_WPA_MSG
  1220. endif
  1221. endif
  1222. ifdef CONFIG_ANDROID_LOG
  1223. L_CFLAGS += -DCONFIG_ANDROID_LOG
  1224. endif
  1225. ifdef CONFIG_IPV6
  1226. # for eapol_test only
  1227. L_CFLAGS += -DCONFIG_IPV6
  1228. endif
  1229. ifdef NEED_BASE64
  1230. OBJS += src/utils/base64.c
  1231. endif
  1232. ifdef NEED_SME
  1233. OBJS += sme.c
  1234. L_CFLAGS += -DCONFIG_SME
  1235. endif
  1236. OBJS += src/common/ieee802_11_common.c
  1237. OBJS += src/common/hw_features_common.c
  1238. ifdef NEED_EAP_COMMON
  1239. OBJS += src/eap_common/eap_common.c
  1240. endif
  1241. ifndef CONFIG_MAIN
  1242. CONFIG_MAIN=main
  1243. endif
  1244. ifdef CONFIG_DEBUG_SYSLOG
  1245. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1246. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1247. L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1248. endif
  1249. endif
  1250. ifdef CONFIG_DEBUG_LINUX_TRACING
  1251. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1252. endif
  1253. ifdef CONFIG_DEBUG_FILE
  1254. L_CFLAGS += -DCONFIG_DEBUG_FILE
  1255. endif
  1256. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1257. L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1258. endif
  1259. ifdef CONFIG_FIPS
  1260. L_CFLAGS += -DCONFIG_FIPS
  1261. endif
  1262. OBJS += $(SHA1OBJS) $(DESOBJS)
  1263. OBJS_p += $(SHA1OBJS)
  1264. OBJS_p += $(SHA256OBJS)
  1265. ifdef CONFIG_BGSCAN_SIMPLE
  1266. L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1267. OBJS += bgscan_simple.c
  1268. NEED_BGSCAN=y
  1269. endif
  1270. ifdef CONFIG_BGSCAN_LEARN
  1271. L_CFLAGS += -DCONFIG_BGSCAN_LEARN
  1272. OBJS += bgscan_learn.c
  1273. NEED_BGSCAN=y
  1274. endif
  1275. ifdef NEED_BGSCAN
  1276. L_CFLAGS += -DCONFIG_BGSCAN
  1277. OBJS += bgscan.c
  1278. endif
  1279. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1280. L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1281. OBJS += autoscan_exponential.c
  1282. NEED_AUTOSCAN=y
  1283. endif
  1284. ifdef CONFIG_AUTOSCAN_PERIODIC
  1285. L_CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1286. OBJS += autoscan_periodic.c
  1287. NEED_AUTOSCAN=y
  1288. endif
  1289. ifdef NEED_AUTOSCAN
  1290. L_CFLAGS += -DCONFIG_AUTOSCAN
  1291. OBJS += autoscan.c
  1292. endif
  1293. ifdef CONFIG_EXT_PASSWORD_TEST
  1294. OBJS += src/utils/ext_password_test.c
  1295. L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1296. NEED_EXT_PASSWORD=y
  1297. endif
  1298. ifdef NEED_EXT_PASSWORD
  1299. OBJS += src/utils/ext_password.c
  1300. L_CFLAGS += -DCONFIG_EXT_PASSWORD
  1301. endif
  1302. ifdef NEED_GAS
  1303. OBJS += src/common/gas.c
  1304. OBJS += gas_query.c
  1305. L_CFLAGS += -DCONFIG_GAS
  1306. NEED_OFFCHANNEL=y
  1307. endif
  1308. ifdef NEED_OFFCHANNEL
  1309. OBJS += offchannel.c
  1310. L_CFLAGS += -DCONFIG_OFFCHANNEL
  1311. endif
  1312. OBJS += src/drivers/driver_common.c
  1313. OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
  1314. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
  1315. OBJS_t += src/radius/radius_client.c
  1316. OBJS_t += src/radius/radius.c
  1317. ifndef CONFIG_AP
  1318. OBJS_t += src/utils/ip_addr.c
  1319. endif
  1320. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
  1321. OBJS += $(CONFIG_MAIN).c
  1322. ifdef CONFIG_PRIVSEP
  1323. OBJS_priv += $(OBJS_d) src/drivers/drivers.c
  1324. OBJS_priv += $(OBJS_l2)
  1325. OBJS_priv += src/utils/os_$(CONFIG_OS).c
  1326. OBJS_priv += src/utils/$(CONFIG_ELOOP).c
  1327. OBJS_priv += src/utils/common.c
  1328. OBJS_priv += src/utils/wpa_debug.c
  1329. OBJS_priv += src/utils/wpabuf.c
  1330. OBJS_priv += wpa_priv.c
  1331. ifdef CONFIG_DRIVER_NL80211
  1332. OBJS_priv += src/common/ieee802_11_common.c
  1333. endif
  1334. OBJS += src/l2_packet/l2_packet_privsep.c
  1335. OBJS += src/drivers/driver_privsep.c
  1336. EXTRA_progs += wpa_priv
  1337. else
  1338. OBJS += $(OBJS_d) src/drivers/drivers.c
  1339. OBJS += $(OBJS_l2)
  1340. endif
  1341. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1342. L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1343. OBJS += src/drivers/ndis_events.c
  1344. EXTRALIBS += -loleaut32 -lole32 -luuid
  1345. ifdef PLATFORMSDKLIB
  1346. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1347. else
  1348. EXTRALIBS += WbemUuid.Lib
  1349. endif
  1350. endif
  1351. ifndef LDO
  1352. LDO=$(CC)
  1353. endif
  1354. ########################
  1355. include $(CLEAR_VARS)
  1356. LOCAL_MODULE := wpa_cli
  1357. LOCAL_MODULE_TAGS := debug
  1358. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  1359. LOCAL_CFLAGS := $(L_CFLAGS)
  1360. LOCAL_SRC_FILES := $(OBJS_c)
  1361. LOCAL_C_INCLUDES := $(INCLUDES)
  1362. include $(BUILD_EXECUTABLE)
  1363. ########################
  1364. include $(CLEAR_VARS)
  1365. LOCAL_MODULE := wpa_supplicant
  1366. ifdef CONFIG_DRIVER_CUSTOM
  1367. LOCAL_STATIC_LIBRARIES := libCustomWifi
  1368. endif
  1369. ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
  1370. LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
  1371. endif
  1372. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  1373. ifdef CONFIG_EAP_PROXY
  1374. LOCAL_STATIC_LIBRARIES += $(LIB_STATIC_EAP_PROXY)
  1375. LOCAL_SHARED_LIBRARIES += $(LIB_SHARED_EAP_PROXY)
  1376. endif
  1377. ifeq ($(CONFIG_TLS), openssl)
  1378. LOCAL_SHARED_LIBRARIES += libcrypto libssl libkeystore_binder
  1379. endif
  1380. # With BoringSSL we need libkeystore-engine in order to provide access to
  1381. # keystore keys.
  1382. ifneq (,$(wildcard external/boringssl/flavor.mk))
  1383. LOCAL_SHARED_LIBRARIES += libkeystore-engine
  1384. endif
  1385. ifdef CONFIG_DRIVER_NL80211
  1386. ifneq ($(wildcard external/libnl),)
  1387. LOCAL_SHARED_LIBRARIES += libnl
  1388. else
  1389. LOCAL_STATIC_LIBRARIES += libnl_2
  1390. endif
  1391. endif
  1392. LOCAL_CFLAGS := $(L_CFLAGS)
  1393. LOCAL_SRC_FILES := $(OBJS)
  1394. LOCAL_C_INCLUDES := $(INCLUDES)
  1395. ifeq ($(DBUS), y)
  1396. LOCAL_SHARED_LIBRARIES += libdbus
  1397. endif
  1398. include $(BUILD_EXECUTABLE)
  1399. ########################
  1400. #
  1401. #include $(CLEAR_VARS)
  1402. #LOCAL_MODULE := eapol_test
  1403. #ifdef CONFIG_DRIVER_CUSTOM
  1404. #LOCAL_STATIC_LIBRARIES := libCustomWifi
  1405. #endif
  1406. #LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
  1407. #LOCAL_CFLAGS := $(L_CFLAGS)
  1408. #LOCAL_SRC_FILES := $(OBJS_t)
  1409. #LOCAL_C_INCLUDES := $(INCLUDES)
  1410. #include $(BUILD_EXECUTABLE)
  1411. #
  1412. ########################
  1413. #
  1414. #local_target_dir := $(TARGET_OUT)/etc/wifi
  1415. #
  1416. #include $(CLEAR_VARS)
  1417. #LOCAL_MODULE := wpa_supplicant.conf
  1418. #LOCAL_MODULE_CLASS := ETC
  1419. #LOCAL_MODULE_PATH := $(local_target_dir)
  1420. #LOCAL_SRC_FILES := $(LOCAL_MODULE)
  1421. #include $(BUILD_PREBUILT)
  1422. #
  1423. ########################
  1424. include $(CLEAR_VARS)
  1425. LOCAL_MODULE = libwpa_client
  1426. LOCAL_CFLAGS = $(L_CFLAGS)
  1427. LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
  1428. LOCAL_C_INCLUDES = $(INCLUDES)
  1429. LOCAL_SHARED_LIBRARIES := libcutils liblog
  1430. LOCAL_COPY_HEADERS_TO := libwpa_client
  1431. LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
  1432. LOCAL_COPY_HEADERS += src/common/qca-vendor.h
  1433. include $(BUILD_SHARED_LIBRARY)