Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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