Android.mk 32 KB

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