Android.mk 33 KB

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