Android.mk 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. # Copyright (C) 2008 The Android Open Source Project
  2. #
  3. # This software may be distributed under the terms of the BSD license.
  4. # See README for more details.
  5. #
  6. LOCAL_PATH := $(call my-dir)
  7. WPA_BUILD_HOSTAPD := false
  8. ifneq ($(BOARD_HOSTAPD_DRIVER),)
  9. WPA_BUILD_HOSTAPD := true
  10. CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
  11. endif
  12. ifeq ($(WPA_BUILD_HOSTAPD),true)
  13. include $(LOCAL_PATH)/android.config
  14. # To ignore possible wrong network configurations
  15. L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
  16. L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
  17. # Set Android log name
  18. L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
  19. # Disable unused parameter warnings
  20. L_CFLAGS += -Wno-unused-parameter
  21. # Set Android extended P2P functionality
  22. L_CFLAGS += -DANDROID_P2P
  23. ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  24. L_CFLAGS += -DANDROID_LIB_STUB
  25. endif
  26. # Use Android specific directory for control interface sockets
  27. L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
  28. L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/hostapd\"
  29. # Use Android specific directory for hostapd_cli command completion history
  30. L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/misc/wifi\"
  31. # To force sizeof(enum) = 4
  32. ifeq ($(TARGET_ARCH),arm)
  33. L_CFLAGS += -mabi=aapcs-linux
  34. endif
  35. INCLUDES = $(LOCAL_PATH)
  36. INCLUDES += $(LOCAL_PATH)/src
  37. INCLUDES += $(LOCAL_PATH)/src/utils
  38. INCLUDES += system/security/keystore/include
  39. ifdef CONFIG_DRIVER_NL80211
  40. ifneq ($(wildcard external/libnl),)
  41. INCLUDES += external/libnl/include
  42. else
  43. INCLUDES += external/libnl-headers
  44. endif
  45. endif
  46. ifndef CONFIG_OS
  47. ifdef CONFIG_NATIVE_WINDOWS
  48. CONFIG_OS=win32
  49. else
  50. CONFIG_OS=unix
  51. endif
  52. endif
  53. ifeq ($(CONFIG_OS), internal)
  54. L_CFLAGS += -DOS_NO_C_LIB_DEFINES
  55. endif
  56. ifdef CONFIG_NATIVE_WINDOWS
  57. L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
  58. LIBS += -lws2_32
  59. endif
  60. OBJS = main.c
  61. OBJS += config_file.c
  62. OBJS += src/ap/hostapd.c
  63. OBJS += src/ap/wpa_auth_glue.c
  64. OBJS += src/ap/drv_callbacks.c
  65. OBJS += src/ap/ap_drv_ops.c
  66. OBJS += src/ap/utils.c
  67. OBJS += src/ap/authsrv.c
  68. OBJS += src/ap/ieee802_1x.c
  69. OBJS += src/ap/ap_config.c
  70. OBJS += src/ap/eap_user_db.c
  71. OBJS += src/ap/ieee802_11_auth.c
  72. OBJS += src/ap/sta_info.c
  73. OBJS += src/ap/wpa_auth.c
  74. OBJS += src/ap/tkip_countermeasures.c
  75. OBJS += src/ap/ap_mlme.c
  76. OBJS += src/ap/wpa_auth_ie.c
  77. OBJS += src/ap/preauth_auth.c
  78. OBJS += src/ap/pmksa_cache_auth.c
  79. OBJS += src/ap/ieee802_11_shared.c
  80. OBJS += src/ap/beacon.c
  81. OBJS += src/ap/bss_load.c
  82. OBJS += src/ap/neighbor_db.c
  83. OBJS += src/ap/rrm.c
  84. OBJS_d =
  85. OBJS_p =
  86. LIBS =
  87. LIBS_c =
  88. HOBJS =
  89. LIBS_h =
  90. NEED_RC4=y
  91. NEED_AES=y
  92. NEED_MD5=y
  93. NEED_SHA1=y
  94. OBJS += src/drivers/drivers.c
  95. L_CFLAGS += -DHOSTAPD
  96. ifdef CONFIG_WPA_TRACE
  97. L_CFLAGS += -DWPA_TRACE
  98. OBJS += src/utils/trace.c
  99. HOBJS += src/utils/trace.c
  100. LDFLAGS += -rdynamic
  101. L_CFLAGS += -funwind-tables
  102. ifdef CONFIG_WPA_TRACE_BFD
  103. L_CFLAGS += -DWPA_TRACE_BFD
  104. LIBS += -lbfd
  105. LIBS_c += -lbfd
  106. LIBS_h += -lbfd
  107. endif
  108. endif
  109. OBJS += src/utils/eloop.c
  110. ifdef CONFIG_ELOOP_POLL
  111. L_CFLAGS += -DCONFIG_ELOOP_POLL
  112. endif
  113. ifdef CONFIG_ELOOP_EPOLL
  114. L_CFLAGS += -DCONFIG_ELOOP_EPOLL
  115. endif
  116. OBJS += src/utils/common.c
  117. OBJS += src/utils/wpa_debug.c
  118. OBJS += src/utils/wpabuf.c
  119. OBJS += src/utils/os_$(CONFIG_OS).c
  120. OBJS += src/utils/ip_addr.c
  121. OBJS += src/common/ieee802_11_common.c
  122. OBJS += src/common/wpa_common.c
  123. OBJS += src/common/hw_features_common.c
  124. OBJS += src/eapol_auth/eapol_auth_sm.c
  125. ifndef CONFIG_NO_DUMP_STATE
  126. # define HOSTAPD_DUMP_STATE to include support for dumping internal state
  127. # through control interface commands (undefine it, if you want to save in
  128. # binary size)
  129. L_CFLAGS += -DHOSTAPD_DUMP_STATE
  130. OBJS += src/eapol_auth/eapol_auth_dump.c
  131. endif
  132. ifdef CONFIG_NO_RADIUS
  133. L_CFLAGS += -DCONFIG_NO_RADIUS
  134. CONFIG_NO_ACCOUNTING=y
  135. else
  136. OBJS += src/radius/radius.c
  137. OBJS += src/radius/radius_client.c
  138. OBJS += src/radius/radius_das.c
  139. endif
  140. ifdef CONFIG_NO_ACCOUNTING
  141. L_CFLAGS += -DCONFIG_NO_ACCOUNTING
  142. else
  143. OBJS += src/ap/accounting.c
  144. endif
  145. ifdef CONFIG_NO_VLAN
  146. L_CFLAGS += -DCONFIG_NO_VLAN
  147. else
  148. OBJS += src/ap/vlan_init.c
  149. OBJS += src/ap/vlan_ifconfig.c
  150. OBJS += src/ap/vlan.c
  151. ifdef CONFIG_FULL_DYNAMIC_VLAN
  152. # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
  153. # and VLAN interfaces for the VLAN feature.
  154. L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
  155. OBJS += src/ap/vlan_full.c
  156. ifdef CONFIG_VLAN_NETLINK
  157. OBJS += src/ap/vlan_util.c
  158. else
  159. OBJS += src/ap/vlan_ioctl.c
  160. endif
  161. endif
  162. endif
  163. ifdef CONFIG_NO_CTRL_IFACE
  164. L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
  165. else
  166. OBJS += src/common/ctrl_iface_common.c
  167. OBJS += ctrl_iface.c
  168. OBJS += src/ap/ctrl_iface_ap.c
  169. endif
  170. L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
  171. ifdef CONFIG_IAPP
  172. L_CFLAGS += -DCONFIG_IAPP
  173. OBJS += src/ap/iapp.c
  174. endif
  175. ifdef CONFIG_RSN_PREAUTH
  176. L_CFLAGS += -DCONFIG_RSN_PREAUTH
  177. CONFIG_L2_PACKET=y
  178. endif
  179. ifdef CONFIG_HS20
  180. NEED_AES_OMAC1=y
  181. CONFIG_PROXYARP=y
  182. endif
  183. ifdef CONFIG_PROXYARP
  184. CONFIG_L2_PACKET=y
  185. endif
  186. ifdef CONFIG_SUITEB
  187. L_CFLAGS += -DCONFIG_SUITEB
  188. NEED_SHA256=y
  189. NEED_AES_OMAC1=y
  190. endif
  191. ifdef CONFIG_SUITEB192
  192. L_CFLAGS += -DCONFIG_SUITEB192
  193. NEED_SHA384=y
  194. endif
  195. ifdef CONFIG_IEEE80211W
  196. L_CFLAGS += -DCONFIG_IEEE80211W
  197. NEED_SHA256=y
  198. NEED_AES_OMAC1=y
  199. endif
  200. ifdef CONFIG_IEEE80211R
  201. L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
  202. OBJS += src/ap/wpa_auth_ft.c
  203. NEED_SHA256=y
  204. NEED_AES_OMAC1=y
  205. NEED_AES_UNWRAP=y
  206. NEED_AES_SIV=y
  207. NEED_ETH_P_OUI=y
  208. NEED_SHA256=y
  209. NEED_HMAC_SHA256_KDF=y
  210. endif
  211. ifdef NEED_ETH_P_OUI
  212. L_CFLAGS += -DCONFIG_ETH_P_OUI
  213. OBJS += src/ap/eth_p_oui.c
  214. endif
  215. ifdef CONFIG_SAE
  216. L_CFLAGS += -DCONFIG_SAE
  217. OBJS += src/common/sae.c
  218. NEED_ECC=y
  219. NEED_DH_GROUPS=y
  220. endif
  221. ifdef CONFIG_OWE
  222. L_CFLAGS += -DCONFIG_OWE
  223. NEED_ECC=y
  224. NEED_HMAC_SHA256_KDF=y
  225. NEED_HMAC_SHA384_KDF=y
  226. NEED_HMAC_SHA512_KDF=y
  227. NEED_SHA256=y
  228. NEED_SHA384=y
  229. NEED_SHA512=y
  230. endif
  231. ifdef CONFIG_FILS
  232. L_CFLAGS += -DCONFIG_FILS
  233. OBJS += src/ap/fils_hlp.c
  234. NEED_SHA384=y
  235. NEED_AES_SIV=y
  236. ifdef CONFIG_FILS_SK_PFS
  237. L_CFLAGS += -DCONFIG_FILS_SK_PFS
  238. NEED_ECC=y
  239. endif
  240. endif
  241. ifdef CONFIG_WNM
  242. L_CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
  243. OBJS += src/ap/wnm_ap.c
  244. endif
  245. ifdef CONFIG_IEEE80211N
  246. L_CFLAGS += -DCONFIG_IEEE80211N
  247. endif
  248. ifdef CONFIG_IEEE80211AC
  249. L_CFLAGS += -DCONFIG_IEEE80211AC
  250. endif
  251. ifdef CONFIG_IEEE80211AX
  252. L_CFLAGS += -DCONFIG_IEEE80211AX
  253. endif
  254. ifdef CONFIG_MBO
  255. L_CFLAGS += -DCONFIG_MBO
  256. OBJS += src/ap/mbo_ap.c
  257. endif
  258. ifdef CONFIG_FST
  259. L_CFLAGS += -DCONFIG_FST
  260. OBJS += src/fst/fst.c
  261. OBJS += src/fst/fst_group.c
  262. OBJS += src/fst/fst_iface.c
  263. OBJS += src/fst/fst_session.c
  264. OBJS += src/fst/fst_ctrl_aux.c
  265. ifdef CONFIG_FST_TEST
  266. L_CFLAGS += -DCONFIG_FST_TEST
  267. endif
  268. ifndef CONFIG_NO_CTRL_IFACE
  269. OBJS += src/fst/fst_ctrl_iface.c
  270. endif
  271. endif
  272. include $(LOCAL_PATH)/src/drivers/drivers.mk
  273. OBJS += $(DRV_AP_OBJS)
  274. L_CFLAGS += $(DRV_AP_CFLAGS)
  275. LDFLAGS += $(DRV_AP_LDFLAGS)
  276. LIBS += $(DRV_AP_LIBS)
  277. ifdef CONFIG_L2_PACKET
  278. ifdef CONFIG_DNET_PCAP
  279. ifdef CONFIG_L2_FREEBSD
  280. LIBS += -lpcap
  281. OBJS += src/l2_packet/l2_packet_freebsd.c
  282. else
  283. LIBS += -ldnet -lpcap
  284. OBJS += src/l2_packet/l2_packet_pcap.c
  285. endif
  286. else
  287. OBJS += src/l2_packet/l2_packet_linux.c
  288. endif
  289. else
  290. OBJS += src/l2_packet/l2_packet_none.c
  291. endif
  292. ifdef CONFIG_EAP_MD5
  293. L_CFLAGS += -DEAP_SERVER_MD5
  294. OBJS += src/eap_server/eap_server_md5.c
  295. CHAP=y
  296. endif
  297. ifdef CONFIG_EAP_TLS
  298. L_CFLAGS += -DEAP_SERVER_TLS
  299. OBJS += src/eap_server/eap_server_tls.c
  300. TLS_FUNCS=y
  301. endif
  302. ifdef CONFIG_EAP_UNAUTH_TLS
  303. L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
  304. ifndef CONFIG_EAP_TLS
  305. OBJS += src/eap_server/eap_server_tls.c
  306. TLS_FUNCS=y
  307. endif
  308. endif
  309. ifdef CONFIG_EAP_PEAP
  310. L_CFLAGS += -DEAP_SERVER_PEAP
  311. OBJS += src/eap_server/eap_server_peap.c
  312. OBJS += src/eap_common/eap_peap_common.c
  313. TLS_FUNCS=y
  314. CONFIG_EAP_MSCHAPV2=y
  315. endif
  316. ifdef CONFIG_EAP_TTLS
  317. L_CFLAGS += -DEAP_SERVER_TTLS
  318. OBJS += src/eap_server/eap_server_ttls.c
  319. TLS_FUNCS=y
  320. CHAP=y
  321. endif
  322. ifdef CONFIG_EAP_MSCHAPV2
  323. L_CFLAGS += -DEAP_SERVER_MSCHAPV2
  324. OBJS += src/eap_server/eap_server_mschapv2.c
  325. MS_FUNCS=y
  326. endif
  327. ifdef CONFIG_EAP_GTC
  328. L_CFLAGS += -DEAP_SERVER_GTC
  329. OBJS += src/eap_server/eap_server_gtc.c
  330. endif
  331. ifdef CONFIG_EAP_SIM
  332. L_CFLAGS += -DEAP_SERVER_SIM
  333. OBJS += src/eap_server/eap_server_sim.c
  334. CONFIG_EAP_SIM_COMMON=y
  335. NEED_AES_CBC=y
  336. endif
  337. ifdef CONFIG_EAP_AKA
  338. L_CFLAGS += -DEAP_SERVER_AKA
  339. OBJS += src/eap_server/eap_server_aka.c
  340. CONFIG_EAP_SIM_COMMON=y
  341. NEED_SHA256=y
  342. NEED_AES_CBC=y
  343. endif
  344. ifdef CONFIG_EAP_AKA_PRIME
  345. L_CFLAGS += -DEAP_SERVER_AKA_PRIME
  346. endif
  347. ifdef CONFIG_EAP_SIM_COMMON
  348. OBJS += src/eap_common/eap_sim_common.c
  349. # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
  350. # replaced with another file implementating the interface specified in
  351. # eap_sim_db.h.
  352. OBJS += src/eap_server/eap_sim_db.c
  353. NEED_FIPS186_2_PRF=y
  354. endif
  355. ifdef CONFIG_EAP_PAX
  356. L_CFLAGS += -DEAP_SERVER_PAX
  357. OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
  358. endif
  359. ifdef CONFIG_EAP_PSK
  360. L_CFLAGS += -DEAP_SERVER_PSK
  361. OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
  362. NEED_AES_OMAC1=y
  363. NEED_AES_ENCBLOCK=y
  364. NEED_AES_EAX=y
  365. endif
  366. ifdef CONFIG_EAP_SAKE
  367. L_CFLAGS += -DEAP_SERVER_SAKE
  368. OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
  369. endif
  370. ifdef CONFIG_EAP_GPSK
  371. L_CFLAGS += -DEAP_SERVER_GPSK
  372. OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
  373. ifdef CONFIG_EAP_GPSK_SHA256
  374. L_CFLAGS += -DEAP_GPSK_SHA256
  375. endif
  376. NEED_SHA256=y
  377. NEED_AES_OMAC1=y
  378. endif
  379. ifdef CONFIG_EAP_PWD
  380. L_CFLAGS += -DEAP_SERVER_PWD
  381. OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
  382. NEED_SHA256=y
  383. NEED_ECC=y
  384. endif
  385. ifdef CONFIG_EAP_EKE
  386. L_CFLAGS += -DEAP_SERVER_EKE
  387. OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
  388. NEED_DH_GROUPS=y
  389. NEED_DH_GROUPS_ALL=y
  390. endif
  391. ifdef CONFIG_EAP_VENDOR_TEST
  392. L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
  393. OBJS += src/eap_server/eap_server_vendor_test.c
  394. endif
  395. ifdef CONFIG_EAP_FAST
  396. L_CFLAGS += -DEAP_SERVER_FAST
  397. OBJS += src/eap_server/eap_server_fast.c
  398. OBJS += src/eap_common/eap_fast_common.c
  399. TLS_FUNCS=y
  400. NEED_T_PRF=y
  401. NEED_AES_UNWRAP=y
  402. endif
  403. ifdef CONFIG_WPS
  404. L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
  405. OBJS += src/utils/uuid.c
  406. OBJS += src/ap/wps_hostapd.c
  407. OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
  408. OBJS += src/wps/wps.c
  409. OBJS += src/wps/wps_common.c
  410. OBJS += src/wps/wps_attr_parse.c
  411. OBJS += src/wps/wps_attr_build.c
  412. OBJS += src/wps/wps_attr_process.c
  413. OBJS += src/wps/wps_dev_attr.c
  414. OBJS += src/wps/wps_enrollee.c
  415. OBJS += src/wps/wps_registrar.c
  416. NEED_DH_GROUPS=y
  417. NEED_SHA256=y
  418. NEED_BASE64=y
  419. NEED_AES_CBC=y
  420. NEED_MODEXP=y
  421. CONFIG_EAP=y
  422. ifdef CONFIG_WPS_NFC
  423. L_CFLAGS += -DCONFIG_WPS_NFC
  424. OBJS += src/wps/ndef.c
  425. NEED_WPS_OOB=y
  426. endif
  427. ifdef NEED_WPS_OOB
  428. L_CFLAGS += -DCONFIG_WPS_OOB
  429. endif
  430. ifdef CONFIG_WPS_UPNP
  431. L_CFLAGS += -DCONFIG_WPS_UPNP
  432. OBJS += src/wps/wps_upnp.c
  433. OBJS += src/wps/wps_upnp_ssdp.c
  434. OBJS += src/wps/wps_upnp_web.c
  435. OBJS += src/wps/wps_upnp_event.c
  436. OBJS += src/wps/wps_upnp_ap.c
  437. OBJS += src/wps/upnp_xml.c
  438. OBJS += src/wps/httpread.c
  439. OBJS += src/wps/http_client.c
  440. OBJS += src/wps/http_server.c
  441. endif
  442. ifdef CONFIG_WPS_STRICT
  443. L_CFLAGS += -DCONFIG_WPS_STRICT
  444. OBJS += src/wps/wps_validate.c
  445. endif
  446. ifdef CONFIG_WPS_TESTING
  447. L_CFLAGS += -DCONFIG_WPS_TESTING
  448. endif
  449. endif
  450. ifdef CONFIG_DPP
  451. L_CFLAGS += -DCONFIG_DPP
  452. OBJS += src/common/dpp.c
  453. OBJS += src/ap/dpp_hostapd.c
  454. OBJS += src/ap/gas_query_ap.c
  455. NEED_AES_SIV=y
  456. NEED_HMAC_SHA256_KDF=y
  457. NEED_HMAC_SHA384_KDF=y
  458. NEED_HMAC_SHA512_KDF=y
  459. NEED_SHA256=y
  460. NEED_SHA384=y
  461. NEED_SHA512=y
  462. NEED_JSON=y
  463. NEED_GAS=y
  464. NEED_BASE64=y
  465. endif
  466. ifdef CONFIG_EAP_IKEV2
  467. L_CFLAGS += -DEAP_SERVER_IKEV2
  468. OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
  469. OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
  470. NEED_DH_GROUPS=y
  471. NEED_DH_GROUPS_ALL=y
  472. NEED_MODEXP=y
  473. NEED_CIPHER=y
  474. endif
  475. ifdef CONFIG_EAP_TNC
  476. L_CFLAGS += -DEAP_SERVER_TNC
  477. OBJS += src/eap_server/eap_server_tnc.c
  478. OBJS += src/eap_server/tncs.c
  479. NEED_BASE64=y
  480. ifndef CONFIG_DRIVER_BSD
  481. LIBS += -ldl
  482. endif
  483. endif
  484. # Basic EAP functionality is needed for EAPOL
  485. OBJS += eap_register.c
  486. OBJS += src/eap_server/eap_server.c
  487. OBJS += src/eap_common/eap_common.c
  488. OBJS += src/eap_server/eap_server_methods.c
  489. OBJS += src/eap_server/eap_server_identity.c
  490. L_CFLAGS += -DEAP_SERVER_IDENTITY
  491. ifdef CONFIG_EAP
  492. L_CFLAGS += -DEAP_SERVER
  493. endif
  494. ifdef CONFIG_PKCS12
  495. L_CFLAGS += -DPKCS12_FUNCS
  496. endif
  497. ifdef MS_FUNCS
  498. OBJS += src/crypto/ms_funcs.c
  499. NEED_DES=y
  500. NEED_MD4=y
  501. endif
  502. ifdef CHAP
  503. OBJS += src/eap_common/chap.c
  504. endif
  505. ifdef TLS_FUNCS
  506. NEED_DES=y
  507. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
  508. L_CFLAGS += -DEAP_TLS_FUNCS
  509. OBJS += src/eap_server/eap_server_tls_common.c
  510. NEED_TLS_PRF=y
  511. endif
  512. ifndef CONFIG_TLS
  513. CONFIG_TLS=openssl
  514. endif
  515. ifdef CONFIG_TLSV11
  516. L_CFLAGS += -DCONFIG_TLSV11
  517. endif
  518. ifdef CONFIG_TLSV12
  519. L_CFLAGS += -DCONFIG_TLSV12
  520. NEED_SHA256=y
  521. endif
  522. ifeq ($(CONFIG_TLS), openssl)
  523. ifdef TLS_FUNCS
  524. OBJS += src/crypto/tls_openssl.c
  525. OBJS += src/crypto/tls_openssl_ocsp.c
  526. LIBS += -lssl
  527. endif
  528. OBJS += src/crypto/crypto_openssl.c
  529. HOBJS += src/crypto/crypto_openssl.c
  530. ifdef NEED_FIPS186_2_PRF
  531. OBJS += src/crypto/fips_prf_openssl.c
  532. endif
  533. NEED_SHA256=y
  534. NEED_TLS_PRF_SHA256=y
  535. LIBS += -lcrypto
  536. LIBS_h += -lcrypto
  537. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  538. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  539. endif
  540. L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  541. endif
  542. ifeq ($(CONFIG_TLS), gnutls)
  543. ifndef CONFIG_CRYPTO
  544. # default to libgcrypt
  545. CONFIG_CRYPTO=gnutls
  546. endif
  547. ifdef TLS_FUNCS
  548. OBJS += src/crypto/tls_gnutls.c
  549. LIBS += -lgnutls -lgpg-error
  550. endif
  551. OBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
  552. HOBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
  553. ifdef NEED_FIPS186_2_PRF
  554. OBJS += src/crypto/fips_prf_internal.c
  555. OBJS += src/crypto/sha1-internal.c
  556. endif
  557. ifeq ($(CONFIG_CRYPTO), gnutls)
  558. LIBS += -lgcrypt
  559. LIBS_h += -lgcrypt
  560. CONFIG_INTERNAL_RC4=y
  561. CONFIG_INTERNAL_DH_GROUP5=y
  562. endif
  563. ifeq ($(CONFIG_CRYPTO), nettle)
  564. LIBS += -lnettle -lgmp
  565. LIBS_p += -lnettle -lgmp
  566. CONFIG_INTERNAL_RC4=y
  567. CONFIG_INTERNAL_DH_GROUP5=y
  568. endif
  569. endif
  570. ifeq ($(CONFIG_TLS), internal)
  571. ifndef CONFIG_CRYPTO
  572. CONFIG_CRYPTO=internal
  573. endif
  574. ifdef TLS_FUNCS
  575. OBJS += src/crypto/crypto_internal-rsa.c
  576. OBJS += src/crypto/tls_internal.c
  577. OBJS += src/tls/tlsv1_common.c
  578. OBJS += src/tls/tlsv1_record.c
  579. OBJS += src/tls/tlsv1_cred.c
  580. OBJS += src/tls/tlsv1_server.c
  581. OBJS += src/tls/tlsv1_server_write.c
  582. OBJS += src/tls/tlsv1_server_read.c
  583. OBJS += src/tls/asn1.c
  584. OBJS += src/tls/rsa.c
  585. OBJS += src/tls/x509v3.c
  586. OBJS += src/tls/pkcs1.c
  587. OBJS += src/tls/pkcs5.c
  588. OBJS += src/tls/pkcs8.c
  589. NEED_SHA256=y
  590. NEED_BASE64=y
  591. NEED_TLS_PRF=y
  592. ifdef CONFIG_TLSV12
  593. NEED_TLS_PRF_SHA256=y
  594. endif
  595. NEED_MODEXP=y
  596. NEED_CIPHER=y
  597. L_CFLAGS += -DCONFIG_TLS_INTERNAL
  598. L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
  599. endif
  600. ifdef NEED_CIPHER
  601. NEED_DES=y
  602. OBJS += src/crypto/crypto_internal-cipher.c
  603. endif
  604. ifdef NEED_MODEXP
  605. OBJS += src/crypto/crypto_internal-modexp.c
  606. OBJS += src/tls/bignum.c
  607. endif
  608. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  609. OBJS += src/crypto/crypto_libtomcrypt.c
  610. LIBS += -ltomcrypt -ltfm
  611. LIBS_h += -ltomcrypt -ltfm
  612. CONFIG_INTERNAL_SHA256=y
  613. CONFIG_INTERNAL_RC4=y
  614. CONFIG_INTERNAL_DH_GROUP5=y
  615. endif
  616. ifeq ($(CONFIG_CRYPTO), internal)
  617. OBJS += src/crypto/crypto_internal.c
  618. NEED_AES_DEC=y
  619. L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  620. ifdef CONFIG_INTERNAL_LIBTOMMATH
  621. L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  622. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  623. L_CFLAGS += -DLTM_FAST
  624. endif
  625. else
  626. LIBS += -ltommath
  627. LIBS_h += -ltommath
  628. endif
  629. CONFIG_INTERNAL_AES=y
  630. CONFIG_INTERNAL_DES=y
  631. CONFIG_INTERNAL_SHA1=y
  632. CONFIG_INTERNAL_MD4=y
  633. CONFIG_INTERNAL_MD5=y
  634. CONFIG_INTERNAL_SHA256=y
  635. CONFIG_INTERNAL_SHA384=y
  636. CONFIG_INTERNAL_SHA512=y
  637. CONFIG_INTERNAL_RC4=y
  638. CONFIG_INTERNAL_DH_GROUP5=y
  639. endif
  640. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  641. OBJS += src/crypto/crypto_cryptoapi.c
  642. OBJS_p += src/crypto/crypto_cryptoapi.c
  643. L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  644. CONFIG_INTERNAL_SHA256=y
  645. CONFIG_INTERNAL_RC4=y
  646. endif
  647. endif
  648. ifeq ($(CONFIG_TLS), none)
  649. ifdef TLS_FUNCS
  650. OBJS += src/crypto/tls_none.c
  651. L_CFLAGS += -DEAP_TLS_NONE
  652. CONFIG_INTERNAL_AES=y
  653. CONFIG_INTERNAL_SHA1=y
  654. CONFIG_INTERNAL_MD5=y
  655. endif
  656. OBJS += src/crypto/crypto_none.c
  657. OBJS_p += src/crypto/crypto_none.c
  658. CONFIG_INTERNAL_SHA256=y
  659. CONFIG_INTERNAL_RC4=y
  660. endif
  661. ifndef TLS_FUNCS
  662. OBJS += src/crypto/tls_none.c
  663. ifeq ($(CONFIG_TLS), internal)
  664. CONFIG_INTERNAL_AES=y
  665. CONFIG_INTERNAL_SHA1=y
  666. CONFIG_INTERNAL_MD5=y
  667. CONFIG_INTERNAL_RC4=y
  668. endif
  669. endif
  670. AESOBJS = # none so far
  671. ifdef CONFIG_INTERNAL_AES
  672. AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
  673. endif
  674. ifneq ($(CONFIG_TLS), openssl)
  675. AESOBJS += src/crypto/aes-wrap.c
  676. endif
  677. ifdef NEED_AES_EAX
  678. AESOBJS += src/crypto/aes-eax.c
  679. NEED_AES_CTR=y
  680. NEED_AES_OMAC1=y
  681. endif
  682. ifdef NEED_AES_SIV
  683. AESOBJS += src/crypto/aes-siv.c
  684. NEED_AES_CTR=y
  685. NEED_AES_OMAC1=y
  686. endif
  687. ifdef NEED_AES_CTR
  688. AESOBJS += src/crypto/aes-ctr.c
  689. endif
  690. ifdef NEED_AES_ENCBLOCK
  691. AESOBJS += src/crypto/aes-encblock.c
  692. endif
  693. ifdef NEED_AES_OMAC1
  694. AESOBJS += src/crypto/aes-omac1.c
  695. endif
  696. ifdef NEED_AES_UNWRAP
  697. ifneq ($(CONFIG_TLS), openssl)
  698. NEED_AES_DEC=y
  699. AESOBJS += src/crypto/aes-unwrap.c
  700. endif
  701. endif
  702. ifdef NEED_AES_CBC
  703. NEED_AES_DEC=y
  704. ifneq ($(CONFIG_TLS), openssl)
  705. AESOBJS += src/crypto/aes-cbc.c
  706. endif
  707. endif
  708. ifdef NEED_AES_DEC
  709. ifdef CONFIG_INTERNAL_AES
  710. AESOBJS += src/crypto/aes-internal-dec.c
  711. endif
  712. endif
  713. ifdef NEED_AES
  714. OBJS += $(AESOBJS)
  715. endif
  716. SHA1OBJS =
  717. ifdef NEED_SHA1
  718. ifneq ($(CONFIG_TLS), openssl)
  719. ifneq ($(CONFIG_TLS), gnutls)
  720. SHA1OBJS += src/crypto/sha1.c
  721. endif
  722. endif
  723. SHA1OBJS += src/crypto/sha1-prf.c
  724. ifdef CONFIG_INTERNAL_SHA1
  725. SHA1OBJS += src/crypto/sha1-internal.c
  726. ifdef NEED_FIPS186_2_PRF
  727. SHA1OBJS += src/crypto/fips_prf_internal.c
  728. endif
  729. endif
  730. ifneq ($(CONFIG_TLS), openssl)
  731. SHA1OBJS += src/crypto/sha1-pbkdf2.c
  732. endif
  733. ifdef NEED_T_PRF
  734. SHA1OBJS += src/crypto/sha1-tprf.c
  735. endif
  736. ifdef NEED_TLS_PRF
  737. SHA1OBJS += src/crypto/sha1-tlsprf.c
  738. endif
  739. endif
  740. ifdef NEED_SHA1
  741. OBJS += $(SHA1OBJS)
  742. endif
  743. ifneq ($(CONFIG_TLS), openssl)
  744. ifneq ($(CONFIG_TLS), gnutls)
  745. OBJS += src/crypto/md5.c
  746. endif
  747. endif
  748. ifdef NEED_MD5
  749. ifdef CONFIG_INTERNAL_MD5
  750. OBJS += src/crypto/md5-internal.c
  751. HOBJS += src/crypto/md5-internal.c
  752. endif
  753. endif
  754. ifdef NEED_MD4
  755. ifdef CONFIG_INTERNAL_MD4
  756. OBJS += src/crypto/md4-internal.c
  757. endif
  758. endif
  759. ifdef NEED_DES
  760. ifdef CONFIG_INTERNAL_DES
  761. OBJS += src/crypto/des-internal.c
  762. endif
  763. endif
  764. ifdef CONFIG_NO_RC4
  765. L_CFLAGS += -DCONFIG_NO_RC4
  766. endif
  767. ifdef NEED_RC4
  768. ifdef CONFIG_INTERNAL_RC4
  769. ifndef CONFIG_NO_RC4
  770. OBJS += src/crypto/rc4.c
  771. endif
  772. endif
  773. endif
  774. ifdef NEED_SHA256
  775. L_CFLAGS += -DCONFIG_SHA256
  776. ifneq ($(CONFIG_TLS), openssl)
  777. ifneq ($(CONFIG_TLS), gnutls)
  778. OBJS += src/crypto/sha256.c
  779. endif
  780. endif
  781. OBJS += src/crypto/sha256-prf.c
  782. ifdef CONFIG_INTERNAL_SHA256
  783. OBJS += src/crypto/sha256-internal.c
  784. endif
  785. ifdef NEED_TLS_PRF_SHA256
  786. OBJS += src/crypto/sha256-tlsprf.c
  787. endif
  788. ifdef NEED_HMAC_SHA256_KDF
  789. OBJS += src/crypto/sha256-kdf.c
  790. endif
  791. ifdef NEED_HMAC_SHA384_KDF
  792. OBJS += src/crypto/sha384-kdf.c
  793. endif
  794. ifdef NEED_HMAC_SHA512_KDF
  795. OBJS += src/crypto/sha512-kdf.c
  796. endif
  797. endif
  798. ifdef NEED_SHA384
  799. L_CFLAGS += -DCONFIG_SHA384
  800. ifneq ($(CONFIG_TLS), openssl)
  801. ifneq ($(CONFIG_TLS), gnutls)
  802. OBJS += src/crypto/sha384.c
  803. endif
  804. endif
  805. OBJS += src/crypto/sha384-prf.c
  806. endif
  807. ifdef NEED_SHA512
  808. L_CFLAGS += -DCONFIG_SHA512
  809. ifneq ($(CONFIG_TLS), openssl)
  810. ifneq ($(CONFIG_TLS), linux)
  811. ifneq ($(CONFIG_TLS), gnutls)
  812. OBJS += src/crypto/sha512.c
  813. endif
  814. endif
  815. endif
  816. OBJS += src/crypto/sha512-prf.c
  817. endif
  818. ifdef CONFIG_INTERNAL_SHA384
  819. L_CFLAGS += -DCONFIG_INTERNAL_SHA384
  820. OBJS += src/crypto/sha384-internal.c
  821. endif
  822. ifdef CONFIG_INTERNAL_SHA512
  823. L_CFLAGS += -DCONFIG_INTERNAL_SHA512
  824. OBJS += src/crypto/sha512-internal.c
  825. endif
  826. ifdef NEED_DH_GROUPS
  827. OBJS += src/crypto/dh_groups.c
  828. endif
  829. ifdef NEED_DH_GROUPS_ALL
  830. L_CFLAGS += -DALL_DH_GROUPS
  831. endif
  832. ifdef CONFIG_INTERNAL_DH_GROUP5
  833. ifdef NEED_DH_GROUPS
  834. OBJS += src/crypto/dh_group5.c
  835. endif
  836. endif
  837. ifdef NEED_ECC
  838. L_CFLAGS += -DCONFIG_ECC
  839. endif
  840. ifdef CONFIG_NO_RANDOM_POOL
  841. L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
  842. else
  843. OBJS += src/crypto/random.c
  844. HOBJS += src/crypto/random.c
  845. HOBJS += src/utils/eloop.c
  846. HOBJS += $(SHA1OBJS)
  847. ifneq ($(CONFIG_TLS), openssl)
  848. HOBJS += src/crypto/md5.c
  849. endif
  850. endif
  851. ifdef CONFIG_RADIUS_SERVER
  852. L_CFLAGS += -DRADIUS_SERVER
  853. OBJS += src/radius/radius_server.c
  854. endif
  855. ifdef CONFIG_IPV6
  856. L_CFLAGS += -DCONFIG_IPV6
  857. endif
  858. ifdef CONFIG_DRIVER_RADIUS_ACL
  859. L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
  860. endif
  861. ifdef NEED_BASE64
  862. OBJS += src/utils/base64.c
  863. endif
  864. ifdef NEED_JSON
  865. OBJS += src/utils/json.c
  866. L_CFLAGS += -DCONFIG_JSON
  867. endif
  868. ifdef NEED_AP_MLME
  869. OBJS += src/ap/wmm.c
  870. OBJS += src/ap/ap_list.c
  871. OBJS += src/ap/ieee802_11.c
  872. OBJS += src/ap/hw_features.c
  873. OBJS += src/ap/dfs.c
  874. L_CFLAGS += -DNEED_AP_MLME
  875. endif
  876. ifdef CONFIG_IEEE80211N
  877. OBJS += src/ap/ieee802_11_ht.c
  878. endif
  879. ifdef CONFIG_IEEE80211AC
  880. OBJS += src/ap/ieee802_11_vht.c
  881. endif
  882. ifdef CONFIG_IEEE80211AX
  883. OBJS += src/ap/ieee802_11_he.c
  884. endif
  885. ifdef CONFIG_P2P_MANAGER
  886. L_CFLAGS += -DCONFIG_P2P_MANAGER
  887. OBJS += src/ap/p2p_hostapd.c
  888. endif
  889. ifdef CONFIG_HS20
  890. L_CFLAGS += -DCONFIG_HS20
  891. OBJS += src/ap/hs20.c
  892. CONFIG_INTERWORKING=y
  893. endif
  894. ifdef CONFIG_INTERWORKING
  895. L_CFLAGS += -DCONFIG_INTERWORKING
  896. NEED_GAS=y
  897. endif
  898. ifdef NEED_GAS
  899. OBJS += src/common/gas.c
  900. OBJS += src/ap/gas_serv.c
  901. endif
  902. ifdef CONFIG_PROXYARP
  903. L_CFLAGS += -DCONFIG_PROXYARP
  904. OBJS += src/ap/x_snoop.c
  905. OBJS += src/ap/dhcp_snoop.c
  906. ifdef CONFIG_IPV6
  907. OBJS += src/ap/ndisc_snoop.c
  908. endif
  909. endif
  910. OBJS += src/drivers/driver_common.c
  911. ifdef CONFIG_ACS
  912. L_CFLAGS += -DCONFIG_ACS
  913. OBJS += src/ap/acs.c
  914. LIBS += -lm
  915. endif
  916. ifdef CONFIG_NO_STDOUT_DEBUG
  917. L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  918. endif
  919. ifdef CONFIG_DEBUG_SYSLOG
  920. L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
  921. endif
  922. ifdef CONFIG_DEBUG_LINUX_TRACING
  923. L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  924. endif
  925. ifdef CONFIG_DEBUG_FILE
  926. L_CFLAGS += -DCONFIG_DEBUG_FILE
  927. endif
  928. ifdef CONFIG_ANDROID_LOG
  929. L_CFLAGS += -DCONFIG_ANDROID_LOG
  930. endif
  931. OBJS_c = hostapd_cli.c
  932. OBJS_c += src/common/wpa_ctrl.c
  933. OBJS_c += src/utils/os_$(CONFIG_OS).c
  934. OBJS_c += src/common/cli.c
  935. OBJS_c += src/utils/eloop.c
  936. OBJS_c += src/utils/common.c
  937. ifdef CONFIG_WPA_TRACE
  938. OBJS_c += src/utils/trace.c
  939. endif
  940. OBJS_c += src/utils/wpa_debug.c
  941. ifdef CONFIG_WPA_CLI_EDIT
  942. OBJS_c += src/utils/edit.c
  943. else
  944. OBJS_c += src/utils/edit_simple.c
  945. endif
  946. ########################
  947. include $(CLEAR_VARS)
  948. LOCAL_MODULE := hostapd_cli
  949. LOCAL_MODULE_TAGS := debug
  950. LOCAL_PROPRIETARY_MODULE := true
  951. LOCAL_SHARED_LIBRARIES := libc libcutils liblog
  952. LOCAL_CFLAGS := $(L_CFLAGS)
  953. LOCAL_SRC_FILES := $(OBJS_c)
  954. LOCAL_C_INCLUDES := $(INCLUDES)
  955. include $(BUILD_EXECUTABLE)
  956. ########################
  957. include $(CLEAR_VARS)
  958. LOCAL_MODULE := hostapd
  959. LOCAL_MODULE_TAGS := optional
  960. LOCAL_PROPRIETARY_MODULE := true
  961. ifdef CONFIG_DRIVER_CUSTOM
  962. LOCAL_STATIC_LIBRARIES := libCustomWifi
  963. endif
  964. ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
  965. LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
  966. endif
  967. LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
  968. ifdef CONFIG_DRIVER_NL80211
  969. ifneq ($(wildcard external/libnl),)
  970. LOCAL_SHARED_LIBRARIES += libnl
  971. else
  972. LOCAL_STATIC_LIBRARIES += libnl_2
  973. endif
  974. endif
  975. LOCAL_CFLAGS := $(L_CFLAGS)
  976. LOCAL_SRC_FILES := $(OBJS)
  977. LOCAL_C_INCLUDES := $(INCLUDES)
  978. LOCAL_INIT_RC := hostapd.android.rc
  979. include $(BUILD_EXECUTABLE)
  980. endif # ifeq ($(WPA_BUILD_HOSTAPD),true)