Makefile 33 KB

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