Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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