Makefile 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
  10. ifndef LIBS_c
  11. LIBS_c := $(LIBS)
  12. endif
  13. ifndef LIBS_p
  14. LIBS_p := $(LIBS)
  15. endif
  16. endif
  17. export LIBDIR ?= /usr/local/lib/
  18. export INCDIR ?= /usr/local/include/
  19. export BINDIR ?= /usr/local/sbin/
  20. PKG_CONFIG ?= pkg-config
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. -include .config
  25. ifndef CONFIG_NO_GITVER
  26. # Add VERSION_STR postfix for builds from a git repository
  27. ifeq ($(wildcard ../.git),../.git)
  28. GITVER := $(shell git describe --dirty=+)
  29. ifneq ($(GITVER),)
  30. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  31. endif
  32. endif
  33. endif
  34. ifdef CONFIG_TESTING_OPTIONS
  35. CFLAGS += -DCONFIG_TESTING_OPTIONS
  36. CONFIG_WPS_TESTING=y
  37. CONFIG_TDLS_TESTING=y
  38. endif
  39. BINALL=wpa_supplicant wpa_cli
  40. ifndef CONFIG_NO_WPA_PASSPHRASE
  41. BINALL += wpa_passphrase
  42. endif
  43. ALL = $(BINALL)
  44. ALL += systemd/wpa_supplicant.service
  45. ALL += systemd/wpa_supplicant@.service
  46. ALL += systemd/wpa_supplicant-nl80211@.service
  47. ALL += systemd/wpa_supplicant-wired@.service
  48. ALL += dbus/fi.epitest.hostap.WPASupplicant.service
  49. ALL += dbus/fi.w1.wpa_supplicant1.service
  50. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  51. ALL += libwpa_client.so
  52. endif
  53. all: verify_config $(ALL) dynamic_eap_methods
  54. verify_config:
  55. @if [ ! -r .config ]; then \
  56. echo 'Building wpa_supplicant requires a configuration file'; \
  57. echo '(.config). See README for more instructions. You can'; \
  58. echo 'run "cp defconfig .config" to create an example'; \
  59. echo 'configuration.'; \
  60. exit 1; \
  61. fi
  62. mkconfig:
  63. @if [ -f .config ]; then \
  64. echo '.config exists - did not replace it'; \
  65. exit 1; \
  66. fi
  67. echo CONFIG_DRIVER_HOSTAP=y >> .config
  68. echo CONFIG_DRIVER_WEXT=y >> .config
  69. $(DESTDIR)$(BINDIR)/%: %
  70. install -D $(<) $(@)
  71. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
  72. $(MAKE) -C ../src install
  73. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  74. install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
  75. install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
  76. endif
  77. ifdef CONFIG_FIPS
  78. CONFIG_NO_RANDOM_POOL=
  79. CONFIG_OPENSSL_CMAC=y
  80. endif
  81. OBJS = config.o
  82. OBJS += notify.o
  83. OBJS += bss.o
  84. OBJS += eap_register.o
  85. OBJS += ../src/utils/common.o
  86. OBJS += ../src/utils/wpa_debug.o
  87. OBJS += ../src/utils/wpabuf.o
  88. OBJS += ../src/utils/bitfield.o
  89. OBJS += op_classes.o
  90. OBJS += rrm.o
  91. OBJS_p = wpa_passphrase.o
  92. OBJS_p += ../src/utils/common.o
  93. OBJS_p += ../src/utils/wpa_debug.o
  94. OBJS_p += ../src/utils/wpabuf.o
  95. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  96. OBJS_c += ../src/utils/wpa_debug.o
  97. OBJS_c += ../src/utils/common.o
  98. OBJS_c += ../src/common/cli.o
  99. OBJS += wmm_ac.o
  100. ifndef CONFIG_OS
  101. ifdef CONFIG_NATIVE_WINDOWS
  102. CONFIG_OS=win32
  103. else
  104. CONFIG_OS=unix
  105. endif
  106. endif
  107. ifeq ($(CONFIG_OS), internal)
  108. CFLAGS += -DOS_NO_C_LIB_DEFINES
  109. endif
  110. OBJS += ../src/utils/os_$(CONFIG_OS).o
  111. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  112. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  113. ifdef CONFIG_WPA_TRACE
  114. CFLAGS += -DWPA_TRACE
  115. OBJS += ../src/utils/trace.o
  116. OBJS_p += ../src/utils/trace.o
  117. OBJS_c += ../src/utils/trace.o
  118. OBJS_priv += ../src/utils/trace.o
  119. LIBCTRL += ../src/utils/trace.o
  120. LIBCTRLSO += ../src/utils/trace.c
  121. LDFLAGS += -rdynamic
  122. CFLAGS += -funwind-tables
  123. ifdef CONFIG_WPA_TRACE_BFD
  124. CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
  125. LIBS += -lbfd -ldl -liberty -lz
  126. LIBS_p += -lbfd -ldl -liberty -lz
  127. LIBS_c += -lbfd -ldl -liberty -lz
  128. endif
  129. endif
  130. ifndef CONFIG_ELOOP
  131. CONFIG_ELOOP=eloop
  132. endif
  133. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  134. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  135. ifndef CONFIG_OSX
  136. ifeq ($(CONFIG_ELOOP), eloop)
  137. # Using glibc < 2.17 requires -lrt for clock_gettime()
  138. # OS X has an alternate implementation
  139. LIBS += -lrt
  140. LIBS_c += -lrt
  141. LIBS_p += -lrt
  142. endif
  143. endif
  144. ifdef CONFIG_ELOOP_POLL
  145. CFLAGS += -DCONFIG_ELOOP_POLL
  146. endif
  147. ifdef CONFIG_ELOOP_EPOLL
  148. CFLAGS += -DCONFIG_ELOOP_EPOLL
  149. endif
  150. ifdef CONFIG_ELOOP_KQUEUE
  151. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  152. endif
  153. ifdef CONFIG_EAPOL_TEST
  154. CFLAGS += -Werror -DEAPOL_TEST
  155. endif
  156. ifdef CONFIG_CODE_COVERAGE
  157. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  158. LIBS += -lgcov
  159. LIBS_c += -lgcov
  160. LIBS_p += -lgcov
  161. endif
  162. ifdef CONFIG_HT_OVERRIDES
  163. CFLAGS += -DCONFIG_HT_OVERRIDES
  164. endif
  165. ifdef CONFIG_VHT_OVERRIDES
  166. CFLAGS += -DCONFIG_VHT_OVERRIDES
  167. endif
  168. ifndef CONFIG_BACKEND
  169. CONFIG_BACKEND=file
  170. endif
  171. ifeq ($(CONFIG_BACKEND), file)
  172. OBJS += config_file.o
  173. ifndef CONFIG_NO_CONFIG_BLOBS
  174. NEED_BASE64=y
  175. endif
  176. CFLAGS += -DCONFIG_BACKEND_FILE
  177. endif
  178. ifeq ($(CONFIG_BACKEND), winreg)
  179. OBJS += config_winreg.o
  180. endif
  181. ifeq ($(CONFIG_BACKEND), none)
  182. OBJS += config_none.o
  183. endif
  184. ifdef CONFIG_NO_CONFIG_WRITE
  185. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  186. endif
  187. ifdef CONFIG_NO_CONFIG_BLOBS
  188. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  189. endif
  190. ifdef CONFIG_NO_SCAN_PROCESSING
  191. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  192. endif
  193. ifdef CONFIG_SUITEB
  194. CFLAGS += -DCONFIG_SUITEB
  195. NEED_SHA256=y
  196. NEED_AES_OMAC1=y
  197. endif
  198. ifdef CONFIG_SUITEB192
  199. CFLAGS += -DCONFIG_SUITEB192
  200. NEED_SHA384=y
  201. endif
  202. ifdef CONFIG_IEEE80211W
  203. CFLAGS += -DCONFIG_IEEE80211W
  204. NEED_SHA256=y
  205. NEED_AES_OMAC1=y
  206. endif
  207. ifdef CONFIG_IEEE80211R_AP
  208. CONFIG_IEEE80211R=y
  209. endif
  210. ifdef CONFIG_IEEE80211R
  211. CFLAGS += -DCONFIG_IEEE80211R
  212. OBJS += ../src/rsn_supp/wpa_ft.o
  213. NEED_SHA256=y
  214. NEED_AES_OMAC1=y
  215. endif
  216. ifdef CONFIG_MESH
  217. NEED_80211_COMMON=y
  218. NEED_SHA256=y
  219. NEED_AES_SIV=y
  220. CONFIG_SAE=y
  221. CONFIG_AP=y
  222. CFLAGS += -DCONFIG_MESH
  223. OBJS += mesh.o
  224. OBJS += mesh_mpm.o
  225. OBJS += mesh_rsn.o
  226. endif
  227. ifdef CONFIG_SAE
  228. CFLAGS += -DCONFIG_SAE
  229. OBJS += ../src/common/sae.o
  230. NEED_ECC=y
  231. NEED_DH_GROUPS=y
  232. endif
  233. ifdef CONFIG_OWE
  234. CFLAGS += -DCONFIG_OWE
  235. NEED_ECC=y
  236. NEED_HMAC_SHA256_KDF=y
  237. endif
  238. ifdef CONFIG_FILS
  239. CFLAGS += -DCONFIG_FILS
  240. NEED_SHA384=y
  241. NEED_AES_SIV=y
  242. endif
  243. ifdef CONFIG_WNM
  244. CFLAGS += -DCONFIG_WNM
  245. OBJS += wnm_sta.o
  246. endif
  247. ifdef CONFIG_TDLS
  248. CFLAGS += -DCONFIG_TDLS
  249. OBJS += ../src/rsn_supp/tdls.o
  250. NEED_SHA256=y
  251. NEED_AES_OMAC1=y
  252. endif
  253. ifdef CONFIG_TDLS_TESTING
  254. CFLAGS += -DCONFIG_TDLS_TESTING
  255. endif
  256. ifdef CONFIG_PEERKEY
  257. CFLAGS += -DCONFIG_PEERKEY
  258. endif
  259. ifdef CONFIG_PMKSA_CACHE_EXTERNAL
  260. CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
  261. endif
  262. ifndef CONFIG_NO_WPA
  263. OBJS += ../src/rsn_supp/wpa.o
  264. OBJS += ../src/rsn_supp/preauth.o
  265. OBJS += ../src/rsn_supp/pmksa_cache.o
  266. OBJS += ../src/rsn_supp/peerkey.o
  267. OBJS += ../src/rsn_supp/wpa_ie.o
  268. OBJS += ../src/common/wpa_common.o
  269. NEED_AES=y
  270. NEED_SHA1=y
  271. NEED_MD5=y
  272. NEED_RC4=y
  273. else
  274. CFLAGS += -DCONFIG_NO_WPA
  275. ifeq ($(CONFIG_TLS), internal)
  276. NEED_SHA1=y
  277. NEED_MD5=y
  278. endif
  279. endif
  280. ifdef CONFIG_IBSS_RSN
  281. NEED_RSN_AUTHENTICATOR=y
  282. CFLAGS += -DCONFIG_IBSS_RSN
  283. CFLAGS += -DCONFIG_NO_VLAN
  284. OBJS += ibss_rsn.o
  285. endif
  286. ifdef CONFIG_MATCH_IFACE
  287. CFLAGS += -DCONFIG_MATCH_IFACE
  288. endif
  289. ifdef CONFIG_P2P
  290. OBJS += p2p_supplicant.o
  291. OBJS += p2p_supplicant_sd.o
  292. OBJS += ../src/p2p/p2p.o
  293. OBJS += ../src/p2p/p2p_utils.o
  294. OBJS += ../src/p2p/p2p_parse.o
  295. OBJS += ../src/p2p/p2p_build.o
  296. OBJS += ../src/p2p/p2p_go_neg.o
  297. OBJS += ../src/p2p/p2p_sd.o
  298. OBJS += ../src/p2p/p2p_pd.o
  299. OBJS += ../src/p2p/p2p_invitation.o
  300. OBJS += ../src/p2p/p2p_dev_disc.o
  301. OBJS += ../src/p2p/p2p_group.o
  302. OBJS += ../src/ap/p2p_hostapd.o
  303. CFLAGS += -DCONFIG_P2P
  304. NEED_GAS=y
  305. NEED_OFFCHANNEL=y
  306. CONFIG_WPS=y
  307. CONFIG_AP=y
  308. ifdef CONFIG_P2P_STRICT
  309. CFLAGS += -DCONFIG_P2P_STRICT
  310. endif
  311. endif
  312. ifdef CONFIG_WIFI_DISPLAY
  313. CFLAGS += -DCONFIG_WIFI_DISPLAY
  314. OBJS += wifi_display.o
  315. endif
  316. ifdef CONFIG_HS20
  317. OBJS += hs20_supplicant.o
  318. CFLAGS += -DCONFIG_HS20
  319. CONFIG_INTERWORKING=y
  320. NEED_AES_OMAC1=y
  321. endif
  322. ifdef CONFIG_INTERWORKING
  323. OBJS += interworking.o
  324. CFLAGS += -DCONFIG_INTERWORKING
  325. NEED_GAS=y
  326. endif
  327. ifdef CONFIG_NO_ROAMING
  328. CFLAGS += -DCONFIG_NO_ROAMING
  329. endif
  330. include ../src/drivers/drivers.mak
  331. ifdef CONFIG_AP
  332. OBJS_d += $(DRV_BOTH_OBJS)
  333. CFLAGS += $(DRV_BOTH_CFLAGS)
  334. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  335. LIBS += $(DRV_BOTH_LIBS)
  336. else
  337. NEED_AP_MLME=
  338. OBJS_d += $(DRV_WPA_OBJS)
  339. CFLAGS += $(DRV_WPA_CFLAGS)
  340. LDFLAGS += $(DRV_WPA_LDFLAGS)
  341. LIBS += $(DRV_WPA_LIBS)
  342. endif
  343. ifndef CONFIG_L2_PACKET
  344. CONFIG_L2_PACKET=linux
  345. endif
  346. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  347. ifeq ($(CONFIG_L2_PACKET), pcap)
  348. ifdef CONFIG_WINPCAP
  349. CFLAGS += -DCONFIG_WINPCAP
  350. LIBS += -lwpcap -lpacket
  351. LIBS_w += -lwpcap
  352. else
  353. LIBS += -ldnet -lpcap
  354. endif
  355. endif
  356. ifeq ($(CONFIG_L2_PACKET), winpcap)
  357. LIBS += -lwpcap -lpacket
  358. LIBS_w += -lwpcap
  359. endif
  360. ifeq ($(CONFIG_L2_PACKET), freebsd)
  361. LIBS += -lpcap
  362. endif
  363. ifdef CONFIG_ERP
  364. CFLAGS += -DCONFIG_ERP
  365. NEED_SHA256=y
  366. NEED_HMAC_SHA256_KDF=y
  367. endif
  368. ifdef CONFIG_EAP_TLS
  369. # EAP-TLS
  370. ifeq ($(CONFIG_EAP_TLS), dyn)
  371. CFLAGS += -DEAP_TLS_DYNAMIC
  372. EAPDYN += ../src/eap_peer/eap_tls.so
  373. else
  374. CFLAGS += -DEAP_TLS
  375. OBJS += ../src/eap_peer/eap_tls.o
  376. endif
  377. TLS_FUNCS=y
  378. CONFIG_IEEE8021X_EAPOL=y
  379. endif
  380. ifdef CONFIG_EAP_UNAUTH_TLS
  381. # EAP-UNAUTH-TLS
  382. CFLAGS += -DEAP_UNAUTH_TLS
  383. ifndef CONFIG_EAP_TLS
  384. OBJS += ../src/eap_peer/eap_tls.o
  385. TLS_FUNCS=y
  386. endif
  387. CONFIG_IEEE8021X_EAPOL=y
  388. endif
  389. ifdef CONFIG_EAP_PEAP
  390. # EAP-PEAP
  391. ifeq ($(CONFIG_EAP_PEAP), dyn)
  392. CFLAGS += -DEAP_PEAP_DYNAMIC
  393. EAPDYN += ../src/eap_peer/eap_peap.so
  394. else
  395. CFLAGS += -DEAP_PEAP
  396. OBJS += ../src/eap_peer/eap_peap.o
  397. OBJS += ../src/eap_common/eap_peap_common.o
  398. endif
  399. TLS_FUNCS=y
  400. CONFIG_IEEE8021X_EAPOL=y
  401. endif
  402. ifdef CONFIG_EAP_TTLS
  403. # EAP-TTLS
  404. ifeq ($(CONFIG_EAP_TTLS), dyn)
  405. CFLAGS += -DEAP_TTLS_DYNAMIC
  406. EAPDYN += ../src/eap_peer/eap_ttls.so
  407. else
  408. CFLAGS += -DEAP_TTLS
  409. OBJS += ../src/eap_peer/eap_ttls.o
  410. endif
  411. TLS_FUNCS=y
  412. ifndef CONFIG_FIPS
  413. MS_FUNCS=y
  414. CHAP=y
  415. endif
  416. CONFIG_IEEE8021X_EAPOL=y
  417. endif
  418. ifdef CONFIG_EAP_MD5
  419. # EAP-MD5
  420. ifeq ($(CONFIG_EAP_MD5), dyn)
  421. CFLAGS += -DEAP_MD5_DYNAMIC
  422. EAPDYN += ../src/eap_peer/eap_md5.so
  423. else
  424. CFLAGS += -DEAP_MD5
  425. OBJS += ../src/eap_peer/eap_md5.o
  426. endif
  427. CHAP=y
  428. CONFIG_IEEE8021X_EAPOL=y
  429. endif
  430. # backwards compatibility for old spelling
  431. ifdef CONFIG_MSCHAPV2
  432. ifndef CONFIG_EAP_MSCHAPV2
  433. CONFIG_EAP_MSCHAPV2=y
  434. endif
  435. endif
  436. ifdef CONFIG_EAP_MSCHAPV2
  437. # EAP-MSCHAPv2
  438. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  439. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  440. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  441. EAPDYN += ../src/eap_peer/mschapv2.so
  442. else
  443. CFLAGS += -DEAP_MSCHAPv2
  444. OBJS += ../src/eap_peer/eap_mschapv2.o
  445. OBJS += ../src/eap_peer/mschapv2.o
  446. endif
  447. MS_FUNCS=y
  448. CONFIG_IEEE8021X_EAPOL=y
  449. endif
  450. ifdef CONFIG_EAP_GTC
  451. # EAP-GTC
  452. ifeq ($(CONFIG_EAP_GTC), dyn)
  453. CFLAGS += -DEAP_GTC_DYNAMIC
  454. EAPDYN += ../src/eap_peer/eap_gtc.so
  455. else
  456. CFLAGS += -DEAP_GTC
  457. OBJS += ../src/eap_peer/eap_gtc.o
  458. endif
  459. CONFIG_IEEE8021X_EAPOL=y
  460. endif
  461. ifdef CONFIG_EAP_OTP
  462. # EAP-OTP
  463. ifeq ($(CONFIG_EAP_OTP), dyn)
  464. CFLAGS += -DEAP_OTP_DYNAMIC
  465. EAPDYN += ../src/eap_peer/eap_otp.so
  466. else
  467. CFLAGS += -DEAP_OTP
  468. OBJS += ../src/eap_peer/eap_otp.o
  469. endif
  470. CONFIG_IEEE8021X_EAPOL=y
  471. endif
  472. ifdef CONFIG_EAP_SIM
  473. # EAP-SIM
  474. ifeq ($(CONFIG_EAP_SIM), dyn)
  475. CFLAGS += -DEAP_SIM_DYNAMIC
  476. EAPDYN += ../src/eap_peer/eap_sim.so
  477. else
  478. CFLAGS += -DEAP_SIM
  479. OBJS += ../src/eap_peer/eap_sim.o
  480. endif
  481. CONFIG_IEEE8021X_EAPOL=y
  482. CONFIG_EAP_SIM_COMMON=y
  483. NEED_AES_CBC=y
  484. endif
  485. ifdef CONFIG_EAP_LEAP
  486. # EAP-LEAP
  487. ifeq ($(CONFIG_EAP_LEAP), dyn)
  488. CFLAGS += -DEAP_LEAP_DYNAMIC
  489. EAPDYN += ../src/eap_peer/eap_leap.so
  490. else
  491. CFLAGS += -DEAP_LEAP
  492. OBJS += ../src/eap_peer/eap_leap.o
  493. endif
  494. MS_FUNCS=y
  495. CONFIG_IEEE8021X_EAPOL=y
  496. endif
  497. ifdef CONFIG_EAP_PSK
  498. # EAP-PSK
  499. ifeq ($(CONFIG_EAP_PSK), dyn)
  500. CFLAGS += -DEAP_PSK_DYNAMIC
  501. EAPDYN += ../src/eap_peer/eap_psk.so
  502. else
  503. CFLAGS += -DEAP_PSK
  504. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  505. endif
  506. CONFIG_IEEE8021X_EAPOL=y
  507. NEED_AES=y
  508. NEED_AES_OMAC1=y
  509. NEED_AES_ENCBLOCK=y
  510. NEED_AES_EAX=y
  511. endif
  512. ifdef CONFIG_EAP_AKA
  513. # EAP-AKA
  514. ifeq ($(CONFIG_EAP_AKA), dyn)
  515. CFLAGS += -DEAP_AKA_DYNAMIC
  516. EAPDYN += ../src/eap_peer/eap_aka.so
  517. else
  518. CFLAGS += -DEAP_AKA
  519. OBJS += ../src/eap_peer/eap_aka.o
  520. endif
  521. CONFIG_IEEE8021X_EAPOL=y
  522. CONFIG_EAP_SIM_COMMON=y
  523. NEED_AES_CBC=y
  524. endif
  525. ifdef CONFIG_EAP_PROXY
  526. CFLAGS += -DCONFIG_EAP_PROXY
  527. OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
  528. include eap_proxy_$(CONFIG_EAP_PROXY).mak
  529. CONFIG_IEEE8021X_EAPOL=y
  530. endif
  531. ifdef CONFIG_EAP_AKA_PRIME
  532. # EAP-AKA'
  533. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  534. CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  535. else
  536. CFLAGS += -DEAP_AKA_PRIME
  537. endif
  538. NEED_SHA256=y
  539. endif
  540. ifdef CONFIG_EAP_SIM_COMMON
  541. OBJS += ../src/eap_common/eap_sim_common.o
  542. NEED_AES=y
  543. NEED_FIPS186_2_PRF=y
  544. endif
  545. ifdef CONFIG_EAP_FAST
  546. # EAP-FAST
  547. ifeq ($(CONFIG_EAP_FAST), dyn)
  548. CFLAGS += -DEAP_FAST_DYNAMIC
  549. EAPDYN += ../src/eap_peer/eap_fast.so
  550. EAPDYN += ../src/eap_common/eap_fast_common.o
  551. else
  552. CFLAGS += -DEAP_FAST
  553. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  554. OBJS += ../src/eap_common/eap_fast_common.o
  555. endif
  556. TLS_FUNCS=y
  557. CONFIG_IEEE8021X_EAPOL=y
  558. NEED_T_PRF=y
  559. endif
  560. ifdef CONFIG_EAP_PAX
  561. # EAP-PAX
  562. ifeq ($(CONFIG_EAP_PAX), dyn)
  563. CFLAGS += -DEAP_PAX_DYNAMIC
  564. EAPDYN += ../src/eap_peer/eap_pax.so
  565. else
  566. CFLAGS += -DEAP_PAX
  567. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  568. endif
  569. CONFIG_IEEE8021X_EAPOL=y
  570. endif
  571. ifdef CONFIG_EAP_SAKE
  572. # EAP-SAKE
  573. ifeq ($(CONFIG_EAP_SAKE), dyn)
  574. CFLAGS += -DEAP_SAKE_DYNAMIC
  575. EAPDYN += ../src/eap_peer/eap_sake.so
  576. else
  577. CFLAGS += -DEAP_SAKE
  578. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  579. endif
  580. CONFIG_IEEE8021X_EAPOL=y
  581. endif
  582. ifdef CONFIG_EAP_GPSK
  583. # EAP-GPSK
  584. ifeq ($(CONFIG_EAP_GPSK), dyn)
  585. CFLAGS += -DEAP_GPSK_DYNAMIC
  586. EAPDYN += ../src/eap_peer/eap_gpsk.so
  587. else
  588. CFLAGS += -DEAP_GPSK
  589. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  590. endif
  591. CONFIG_IEEE8021X_EAPOL=y
  592. ifdef CONFIG_EAP_GPSK_SHA256
  593. CFLAGS += -DEAP_GPSK_SHA256
  594. endif
  595. NEED_SHA256=y
  596. NEED_AES_OMAC1=y
  597. endif
  598. ifdef CONFIG_EAP_PWD
  599. CFLAGS += -DEAP_PWD
  600. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  601. CONFIG_IEEE8021X_EAPOL=y
  602. NEED_SHA256=y
  603. endif
  604. ifdef CONFIG_EAP_EKE
  605. # EAP-EKE
  606. ifeq ($(CONFIG_EAP_EKE), dyn)
  607. CFLAGS += -DEAP_EKE_DYNAMIC
  608. EAPDYN += ../src/eap_peer/eap_eke.so
  609. else
  610. CFLAGS += -DEAP_EKE
  611. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  612. endif
  613. CONFIG_IEEE8021X_EAPOL=y
  614. NEED_DH_GROUPS=y
  615. NEED_DH_GROUPS_ALL=y
  616. NEED_SHA256=y
  617. NEED_AES_CBC=y
  618. endif
  619. ifdef CONFIG_WPS
  620. # EAP-WSC
  621. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  622. OBJS += wps_supplicant.o
  623. OBJS += ../src/utils/uuid.o
  624. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  625. OBJS += ../src/wps/wps.o
  626. OBJS += ../src/wps/wps_common.o
  627. OBJS += ../src/wps/wps_attr_parse.o
  628. OBJS += ../src/wps/wps_attr_build.o
  629. OBJS += ../src/wps/wps_attr_process.o
  630. OBJS += ../src/wps/wps_dev_attr.o
  631. OBJS += ../src/wps/wps_enrollee.o
  632. OBJS += ../src/wps/wps_registrar.o
  633. CONFIG_IEEE8021X_EAPOL=y
  634. NEED_DH_GROUPS=y
  635. NEED_SHA256=y
  636. NEED_BASE64=y
  637. NEED_AES_CBC=y
  638. NEED_MODEXP=y
  639. ifdef CONFIG_WPS_NFC
  640. CFLAGS += -DCONFIG_WPS_NFC
  641. OBJS += ../src/wps/ndef.o
  642. NEED_WPS_OOB=y
  643. endif
  644. ifdef NEED_WPS_OOB
  645. CFLAGS += -DCONFIG_WPS_OOB
  646. endif
  647. ifdef CONFIG_WPS_ER
  648. CONFIG_WPS_UPNP=y
  649. CFLAGS += -DCONFIG_WPS_ER
  650. OBJS += ../src/wps/wps_er.o
  651. OBJS += ../src/wps/wps_er_ssdp.o
  652. endif
  653. ifdef CONFIG_WPS_UPNP
  654. CFLAGS += -DCONFIG_WPS_UPNP
  655. OBJS += ../src/wps/wps_upnp.o
  656. OBJS += ../src/wps/wps_upnp_ssdp.o
  657. OBJS += ../src/wps/wps_upnp_web.o
  658. OBJS += ../src/wps/wps_upnp_event.o
  659. OBJS += ../src/wps/wps_upnp_ap.o
  660. OBJS += ../src/wps/upnp_xml.o
  661. OBJS += ../src/wps/httpread.o
  662. OBJS += ../src/wps/http_client.o
  663. OBJS += ../src/wps/http_server.o
  664. endif
  665. ifdef CONFIG_WPS_STRICT
  666. CFLAGS += -DCONFIG_WPS_STRICT
  667. OBJS += ../src/wps/wps_validate.o
  668. endif
  669. ifdef CONFIG_WPS_TESTING
  670. CFLAGS += -DCONFIG_WPS_TESTING
  671. endif
  672. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  673. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  674. endif
  675. endif
  676. ifdef CONFIG_EAP_IKEV2
  677. # EAP-IKEv2
  678. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  679. CFLAGS += -DEAP_IKEV2_DYNAMIC
  680. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  681. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  682. else
  683. CFLAGS += -DEAP_IKEV2
  684. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  685. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  686. endif
  687. CONFIG_IEEE8021X_EAPOL=y
  688. NEED_DH_GROUPS=y
  689. NEED_DH_GROUPS_ALL=y
  690. NEED_MODEXP=y
  691. NEED_CIPHER=y
  692. endif
  693. ifdef CONFIG_EAP_VENDOR_TEST
  694. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  695. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  696. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  697. else
  698. CFLAGS += -DEAP_VENDOR_TEST
  699. OBJS += ../src/eap_peer/eap_vendor_test.o
  700. endif
  701. CONFIG_IEEE8021X_EAPOL=y
  702. endif
  703. ifdef CONFIG_EAP_TNC
  704. # EAP-TNC
  705. CFLAGS += -DEAP_TNC
  706. OBJS += ../src/eap_peer/eap_tnc.o
  707. OBJS += ../src/eap_peer/tncc.o
  708. NEED_BASE64=y
  709. ifndef CONFIG_NATIVE_WINDOWS
  710. ifndef CONFIG_DRIVER_BSD
  711. LIBS += -ldl
  712. endif
  713. endif
  714. endif
  715. ifdef CONFIG_IEEE8021X_EAPOL
  716. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  717. CFLAGS += -DIEEE8021X_EAPOL
  718. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  719. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  720. NEED_EAP_COMMON=y
  721. ifdef CONFIG_DYNAMIC_EAP_METHODS
  722. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  723. LIBS += -ldl -rdynamic
  724. endif
  725. endif
  726. ifdef CONFIG_MACSEC
  727. CFLAGS += -DCONFIG_MACSEC
  728. NEED_AES_ENCBLOCK=y
  729. NEED_AES_UNWRAP=y
  730. NEED_AES_WRAP=y
  731. NEED_AES_OMAC1=y
  732. OBJS += wpas_kay.o
  733. OBJS += ../src/pae/ieee802_1x_cp.o
  734. OBJS += ../src/pae/ieee802_1x_kay.o
  735. OBJS += ../src/pae/ieee802_1x_key.o
  736. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  737. endif
  738. ifdef CONFIG_AP
  739. NEED_EAP_COMMON=y
  740. NEED_RSN_AUTHENTICATOR=y
  741. CFLAGS += -DCONFIG_AP
  742. OBJS += ap.o
  743. CFLAGS += -DCONFIG_NO_RADIUS
  744. CFLAGS += -DCONFIG_NO_ACCOUNTING
  745. CFLAGS += -DCONFIG_NO_VLAN
  746. OBJS += ../src/ap/hostapd.o
  747. OBJS += ../src/ap/wpa_auth_glue.o
  748. OBJS += ../src/ap/utils.o
  749. OBJS += ../src/ap/authsrv.o
  750. OBJS += ../src/ap/ap_config.o
  751. OBJS += ../src/utils/ip_addr.o
  752. OBJS += ../src/ap/sta_info.o
  753. OBJS += ../src/ap/tkip_countermeasures.o
  754. OBJS += ../src/ap/ap_mlme.o
  755. OBJS += ../src/ap/ieee802_1x.o
  756. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  757. OBJS += ../src/ap/ieee802_11_auth.o
  758. OBJS += ../src/ap/ieee802_11_shared.o
  759. OBJS += ../src/ap/drv_callbacks.o
  760. OBJS += ../src/ap/ap_drv_ops.o
  761. OBJS += ../src/ap/beacon.o
  762. OBJS += ../src/ap/bss_load.o
  763. OBJS += ../src/ap/eap_user_db.o
  764. OBJS += ../src/ap/neighbor_db.o
  765. OBJS += ../src/ap/rrm.o
  766. ifdef CONFIG_IEEE80211N
  767. OBJS += ../src/ap/ieee802_11_ht.o
  768. ifdef CONFIG_IEEE80211AC
  769. OBJS += ../src/ap/ieee802_11_vht.o
  770. endif
  771. ifdef CONFIG_IEEE80211AX
  772. OBJS += ../src/ap/ieee802_11_he.o
  773. endif
  774. endif
  775. ifdef CONFIG_WNM
  776. OBJS += ../src/ap/wnm_ap.o
  777. endif
  778. ifdef CONFIG_MBO
  779. OBJS += ../src/ap/mbo_ap.o
  780. endif
  781. ifdef CONFIG_FILS
  782. OBJS += ../src/ap/fils_hlp.o
  783. endif
  784. ifdef CONFIG_CTRL_IFACE
  785. OBJS += ../src/ap/ctrl_iface_ap.o
  786. endif
  787. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  788. OBJS += ../src/eap_server/eap_server.o
  789. OBJS += ../src/eap_server/eap_server_identity.o
  790. OBJS += ../src/eap_server/eap_server_methods.o
  791. ifdef CONFIG_IEEE80211N
  792. CFLAGS += -DCONFIG_IEEE80211N
  793. ifdef CONFIG_IEEE80211AC
  794. CFLAGS += -DCONFIG_IEEE80211AC
  795. endif
  796. ifdef CONFIG_IEEE80211AX
  797. CFLAGS += -DCONFIG_IEEE80211AX
  798. endif
  799. endif
  800. ifdef NEED_AP_MLME
  801. OBJS += ../src/ap/wmm.o
  802. OBJS += ../src/ap/ap_list.o
  803. OBJS += ../src/ap/ieee802_11.o
  804. OBJS += ../src/ap/hw_features.o
  805. OBJS += ../src/ap/dfs.o
  806. CFLAGS += -DNEED_AP_MLME
  807. endif
  808. ifdef CONFIG_WPS
  809. CFLAGS += -DEAP_SERVER_WSC
  810. OBJS += ../src/ap/wps_hostapd.o
  811. OBJS += ../src/eap_server/eap_server_wsc.o
  812. endif
  813. ifdef CONFIG_INTERWORKING
  814. OBJS += ../src/ap/gas_serv.o
  815. endif
  816. ifdef CONFIG_HS20
  817. OBJS += ../src/ap/hs20.o
  818. endif
  819. endif
  820. ifdef CONFIG_MBO
  821. OBJS += mbo.o
  822. CFLAGS += -DCONFIG_MBO
  823. endif
  824. ifdef NEED_RSN_AUTHENTICATOR
  825. CFLAGS += -DCONFIG_NO_RADIUS
  826. NEED_AES_WRAP=y
  827. OBJS += ../src/ap/wpa_auth.o
  828. OBJS += ../src/ap/wpa_auth_ie.o
  829. OBJS += ../src/ap/pmksa_cache_auth.o
  830. ifdef CONFIG_IEEE80211R_AP
  831. CFLAGS += -DCONFIG_IEEE80211R_AP
  832. OBJS += ../src/ap/wpa_auth_ft.o
  833. endif
  834. ifdef CONFIG_PEERKEY
  835. OBJS += ../src/ap/peerkey_auth.o
  836. endif
  837. endif
  838. ifdef CONFIG_ACS
  839. CFLAGS += -DCONFIG_ACS
  840. OBJS += ../src/ap/acs.o
  841. LIBS += -lm
  842. endif
  843. ifdef CONFIG_PCSC
  844. # PC/SC interface for smartcards (USIM, GSM SIM)
  845. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  846. OBJS += ../src/utils/pcsc_funcs.o
  847. # -lpthread may not be needed depending on how pcsc-lite was configured
  848. ifdef CONFIG_NATIVE_WINDOWS
  849. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  850. #dynamic symbol loading that is now used in pcsc_funcs.c
  851. #LIBS += -lwinscard
  852. else
  853. ifdef CONFIG_OSX
  854. LIBS += -framework PCSC
  855. else
  856. LIBS += -lpcsclite -lpthread
  857. endif
  858. endif
  859. endif
  860. ifdef CONFIG_SIM_SIMULATOR
  861. CFLAGS += -DCONFIG_SIM_SIMULATOR
  862. NEED_MILENAGE=y
  863. endif
  864. ifdef CONFIG_USIM_SIMULATOR
  865. CFLAGS += -DCONFIG_USIM_SIMULATOR
  866. NEED_MILENAGE=y
  867. endif
  868. ifdef NEED_MILENAGE
  869. OBJS += ../src/crypto/milenage.o
  870. NEED_AES_ENCBLOCK=y
  871. endif
  872. ifdef CONFIG_PKCS12
  873. CFLAGS += -DPKCS12_FUNCS
  874. endif
  875. ifdef CONFIG_SMARTCARD
  876. CFLAGS += -DCONFIG_SMARTCARD
  877. endif
  878. ifdef MS_FUNCS
  879. OBJS += ../src/crypto/ms_funcs.o
  880. NEED_DES=y
  881. NEED_MD4=y
  882. endif
  883. ifdef CHAP
  884. OBJS += ../src/eap_common/chap.o
  885. endif
  886. ifdef TLS_FUNCS
  887. NEED_DES=y
  888. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  889. OBJS += ../src/eap_peer/eap_tls_common.o
  890. ifndef CONFIG_FIPS
  891. NEED_TLS_PRF=y
  892. NEED_SHA1=y
  893. NEED_MD5=y
  894. endif
  895. endif
  896. ifndef CONFIG_TLS
  897. CONFIG_TLS=openssl
  898. endif
  899. ifdef CONFIG_TLSV11
  900. CFLAGS += -DCONFIG_TLSV11
  901. endif
  902. ifdef CONFIG_TLSV12
  903. CFLAGS += -DCONFIG_TLSV12
  904. NEED_SHA256=y
  905. endif
  906. ifeq ($(CONFIG_TLS), openssl)
  907. ifdef TLS_FUNCS
  908. CFLAGS += -DEAP_TLS_OPENSSL
  909. OBJS += ../src/crypto/tls_openssl.o
  910. OBJS += ../src/crypto/tls_openssl_ocsp.o
  911. LIBS += -lssl
  912. endif
  913. OBJS += ../src/crypto/crypto_openssl.o
  914. OBJS_p += ../src/crypto/crypto_openssl.o
  915. OBJS_priv += ../src/crypto/crypto_openssl.o
  916. ifdef NEED_FIPS186_2_PRF
  917. OBJS += ../src/crypto/fips_prf_openssl.o
  918. endif
  919. NEED_SHA256=y
  920. NEED_TLS_PRF_SHA256=y
  921. LIBS += -lcrypto
  922. LIBS_p += -lcrypto
  923. ifdef CONFIG_TLS_ADD_DL
  924. LIBS += -ldl
  925. LIBS_p += -ldl
  926. endif
  927. endif
  928. ifeq ($(CONFIG_TLS), gnutls)
  929. ifdef TLS_FUNCS
  930. OBJS += ../src/crypto/tls_gnutls.o
  931. LIBS += -lgnutls -lgpg-error
  932. endif
  933. OBJS += ../src/crypto/crypto_gnutls.o
  934. OBJS_p += ../src/crypto/crypto_gnutls.o
  935. OBJS_priv += ../src/crypto/crypto_gnutls.o
  936. ifdef NEED_FIPS186_2_PRF
  937. OBJS += ../src/crypto/fips_prf_internal.o
  938. SHA1OBJS += ../src/crypto/sha1-internal.o
  939. endif
  940. LIBS += -lgcrypt
  941. LIBS_p += -lgcrypt
  942. CONFIG_INTERNAL_SHA256=y
  943. CONFIG_INTERNAL_RC4=y
  944. CONFIG_INTERNAL_DH_GROUP5=y
  945. endif
  946. ifeq ($(CONFIG_TLS), internal)
  947. ifndef CONFIG_CRYPTO
  948. CONFIG_CRYPTO=internal
  949. endif
  950. ifdef TLS_FUNCS
  951. OBJS += ../src/crypto/crypto_internal-rsa.o
  952. OBJS += ../src/crypto/tls_internal.o
  953. OBJS += ../src/tls/tlsv1_common.o
  954. OBJS += ../src/tls/tlsv1_record.o
  955. OBJS += ../src/tls/tlsv1_cred.o
  956. OBJS += ../src/tls/tlsv1_client.o
  957. OBJS += ../src/tls/tlsv1_client_write.o
  958. OBJS += ../src/tls/tlsv1_client_read.o
  959. OBJS += ../src/tls/tlsv1_client_ocsp.o
  960. OBJS += ../src/tls/asn1.o
  961. OBJS += ../src/tls/rsa.o
  962. OBJS += ../src/tls/x509v3.o
  963. OBJS += ../src/tls/pkcs1.o
  964. OBJS += ../src/tls/pkcs5.o
  965. OBJS += ../src/tls/pkcs8.o
  966. NEED_SHA256=y
  967. NEED_BASE64=y
  968. NEED_TLS_PRF=y
  969. ifdef CONFIG_TLSV12
  970. NEED_TLS_PRF_SHA256=y
  971. endif
  972. NEED_MODEXP=y
  973. NEED_CIPHER=y
  974. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  975. endif
  976. ifdef NEED_CIPHER
  977. NEED_DES=y
  978. OBJS += ../src/crypto/crypto_internal-cipher.o
  979. endif
  980. ifdef NEED_MODEXP
  981. OBJS += ../src/crypto/crypto_internal-modexp.o
  982. OBJS += ../src/tls/bignum.o
  983. endif
  984. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  985. OBJS += ../src/crypto/crypto_libtomcrypt.o
  986. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  987. LIBS += -ltomcrypt -ltfm
  988. LIBS_p += -ltomcrypt -ltfm
  989. CONFIG_INTERNAL_SHA256=y
  990. CONFIG_INTERNAL_RC4=y
  991. CONFIG_INTERNAL_DH_GROUP5=y
  992. endif
  993. ifeq ($(CONFIG_CRYPTO), internal)
  994. OBJS += ../src/crypto/crypto_internal.o
  995. OBJS_p += ../src/crypto/crypto_internal.o
  996. NEED_AES_ENC=y
  997. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  998. ifdef CONFIG_INTERNAL_LIBTOMMATH
  999. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1000. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  1001. CFLAGS += -DLTM_FAST
  1002. endif
  1003. else
  1004. LIBS += -ltommath
  1005. LIBS_p += -ltommath
  1006. endif
  1007. CONFIG_INTERNAL_AES=y
  1008. CONFIG_INTERNAL_DES=y
  1009. CONFIG_INTERNAL_SHA1=y
  1010. CONFIG_INTERNAL_MD4=y
  1011. CONFIG_INTERNAL_MD5=y
  1012. CONFIG_INTERNAL_SHA256=y
  1013. CONFIG_INTERNAL_SHA384=y
  1014. CONFIG_INTERNAL_SHA512=y
  1015. CONFIG_INTERNAL_RC4=y
  1016. CONFIG_INTERNAL_DH_GROUP5=y
  1017. endif
  1018. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1019. OBJS += ../src/crypto/crypto_cryptoapi.o
  1020. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  1021. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  1022. CONFIG_INTERNAL_SHA256=y
  1023. CONFIG_INTERNAL_RC4=y
  1024. endif
  1025. endif
  1026. ifeq ($(CONFIG_TLS), linux)
  1027. OBJS += ../src/crypto/crypto_linux.o
  1028. OBJS_p += ../src/crypto/crypto_linux.o
  1029. ifdef TLS_FUNCS
  1030. OBJS += ../src/crypto/crypto_internal-rsa.o
  1031. OBJS += ../src/crypto/tls_internal.o
  1032. OBJS += ../src/tls/tlsv1_common.o
  1033. OBJS += ../src/tls/tlsv1_record.o
  1034. OBJS += ../src/tls/tlsv1_cred.o
  1035. OBJS += ../src/tls/tlsv1_client.o
  1036. OBJS += ../src/tls/tlsv1_client_write.o
  1037. OBJS += ../src/tls/tlsv1_client_read.o
  1038. OBJS += ../src/tls/tlsv1_client_ocsp.o
  1039. OBJS += ../src/tls/asn1.o
  1040. OBJS += ../src/tls/rsa.o
  1041. OBJS += ../src/tls/x509v3.o
  1042. OBJS += ../src/tls/pkcs1.o
  1043. OBJS += ../src/tls/pkcs5.o
  1044. OBJS += ../src/tls/pkcs8.o
  1045. NEED_SHA256=y
  1046. NEED_BASE64=y
  1047. NEED_TLS_PRF=y
  1048. ifdef CONFIG_TLSV12
  1049. NEED_TLS_PRF_SHA256=y
  1050. endif
  1051. NEED_MODEXP=y
  1052. NEED_CIPHER=y
  1053. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  1054. endif
  1055. ifdef NEED_MODEXP
  1056. OBJS += ../src/crypto/crypto_internal-modexp.o
  1057. OBJS += ../src/tls/bignum.o
  1058. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1059. CFLAGS += -DLTM_FAST
  1060. endif
  1061. CONFIG_INTERNAL_DH_GROUP5=y
  1062. ifdef NEED_FIPS186_2_PRF
  1063. OBJS += ../src/crypto/fips_prf_internal.o
  1064. OBJS += ../src/crypto/sha1-internal.o
  1065. endif
  1066. endif
  1067. ifeq ($(CONFIG_TLS), none)
  1068. ifdef TLS_FUNCS
  1069. OBJS += ../src/crypto/tls_none.o
  1070. CFLAGS += -DEAP_TLS_NONE
  1071. CONFIG_INTERNAL_AES=y
  1072. CONFIG_INTERNAL_SHA1=y
  1073. CONFIG_INTERNAL_MD5=y
  1074. endif
  1075. OBJS += ../src/crypto/crypto_none.o
  1076. OBJS_p += ../src/crypto/crypto_none.o
  1077. CONFIG_INTERNAL_SHA256=y
  1078. CONFIG_INTERNAL_RC4=y
  1079. endif
  1080. ifdef TLS_FUNCS
  1081. ifdef CONFIG_SMARTCARD
  1082. ifndef CONFIG_NATIVE_WINDOWS
  1083. ifneq ($(CONFIG_L2_PACKET), freebsd)
  1084. LIBS += -ldl
  1085. endif
  1086. endif
  1087. endif
  1088. endif
  1089. ifndef TLS_FUNCS
  1090. OBJS += ../src/crypto/tls_none.o
  1091. ifeq ($(CONFIG_TLS), internal)
  1092. CONFIG_INTERNAL_AES=y
  1093. CONFIG_INTERNAL_SHA1=y
  1094. CONFIG_INTERNAL_MD5=y
  1095. CONFIG_INTERNAL_RC4=y
  1096. endif
  1097. endif
  1098. AESOBJS = # none so far (see below)
  1099. ifdef CONFIG_INTERNAL_AES
  1100. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  1101. endif
  1102. ifneq ($(CONFIG_TLS), openssl)
  1103. NEED_INTERNAL_AES_WRAP=y
  1104. endif
  1105. ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
  1106. # Seems to be needed at least with BoringSSL
  1107. NEED_INTERNAL_AES_WRAP=y
  1108. CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
  1109. endif
  1110. ifdef CONFIG_FIPS
  1111. # Have to use internal AES key wrap routines to use OpenSSL EVP since the
  1112. # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
  1113. NEED_INTERNAL_AES_WRAP=y
  1114. endif
  1115. ifdef NEED_INTERNAL_AES_WRAP
  1116. ifneq ($(CONFIG_TLS), linux)
  1117. AESOBJS += ../src/crypto/aes-unwrap.o
  1118. endif
  1119. endif
  1120. ifdef NEED_AES_EAX
  1121. AESOBJS += ../src/crypto/aes-eax.o
  1122. NEED_AES_CTR=y
  1123. NEED_AES_OMAC1=y
  1124. endif
  1125. ifdef NEED_AES_SIV
  1126. AESOBJS += ../src/crypto/aes-siv.o
  1127. NEED_AES_CTR=y
  1128. NEED_AES_OMAC1=y
  1129. endif
  1130. ifdef NEED_AES_CTR
  1131. AESOBJS += ../src/crypto/aes-ctr.o
  1132. endif
  1133. ifdef NEED_AES_ENCBLOCK
  1134. AESOBJS += ../src/crypto/aes-encblock.o
  1135. endif
  1136. ifdef NEED_AES_OMAC1
  1137. NEED_AES_ENC=y
  1138. ifdef CONFIG_OPENSSL_CMAC
  1139. CFLAGS += -DCONFIG_OPENSSL_CMAC
  1140. else
  1141. ifneq ($(CONFIG_TLS), linux)
  1142. AESOBJS += ../src/crypto/aes-omac1.o
  1143. endif
  1144. endif
  1145. endif
  1146. ifdef NEED_AES_WRAP
  1147. NEED_AES_ENC=y
  1148. ifdef NEED_INTERNAL_AES_WRAP
  1149. AESOBJS += ../src/crypto/aes-wrap.o
  1150. endif
  1151. endif
  1152. ifdef NEED_AES_CBC
  1153. NEED_AES_ENC=y
  1154. ifneq ($(CONFIG_TLS), openssl)
  1155. ifneq ($(CONFIG_TLS), linux)
  1156. AESOBJS += ../src/crypto/aes-cbc.o
  1157. endif
  1158. endif
  1159. endif
  1160. ifdef NEED_AES_ENC
  1161. ifdef CONFIG_INTERNAL_AES
  1162. AESOBJS += ../src/crypto/aes-internal-enc.o
  1163. endif
  1164. endif
  1165. ifdef NEED_AES
  1166. OBJS += $(AESOBJS)
  1167. endif
  1168. ifdef NEED_SHA1
  1169. ifneq ($(CONFIG_TLS), openssl)
  1170. ifneq ($(CONFIG_TLS), linux)
  1171. SHA1OBJS += ../src/crypto/sha1.o
  1172. endif
  1173. endif
  1174. SHA1OBJS += ../src/crypto/sha1-prf.o
  1175. ifdef CONFIG_INTERNAL_SHA1
  1176. SHA1OBJS += ../src/crypto/sha1-internal.o
  1177. ifdef NEED_FIPS186_2_PRF
  1178. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  1179. endif
  1180. endif
  1181. ifdef CONFIG_NO_WPA_PASSPHRASE
  1182. CFLAGS += -DCONFIG_NO_PBKDF2
  1183. else
  1184. ifneq ($(CONFIG_TLS), openssl)
  1185. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  1186. endif
  1187. endif
  1188. ifdef NEED_T_PRF
  1189. SHA1OBJS += ../src/crypto/sha1-tprf.o
  1190. endif
  1191. ifdef NEED_TLS_PRF
  1192. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  1193. endif
  1194. endif
  1195. ifndef CONFIG_FIPS
  1196. ifneq ($(CONFIG_TLS), openssl)
  1197. ifneq ($(CONFIG_TLS), linux)
  1198. MD5OBJS += ../src/crypto/md5.o
  1199. endif
  1200. endif
  1201. endif
  1202. ifdef NEED_MD5
  1203. ifdef CONFIG_INTERNAL_MD5
  1204. MD5OBJS += ../src/crypto/md5-internal.o
  1205. endif
  1206. OBJS += $(MD5OBJS)
  1207. OBJS_p += $(MD5OBJS)
  1208. OBJS_priv += $(MD5OBJS)
  1209. endif
  1210. ifdef NEED_MD4
  1211. ifdef CONFIG_INTERNAL_MD4
  1212. OBJS += ../src/crypto/md4-internal.o
  1213. endif
  1214. endif
  1215. DESOBJS = # none needed when not internal
  1216. ifdef NEED_DES
  1217. ifdef CONFIG_INTERNAL_DES
  1218. DESOBJS += ../src/crypto/des-internal.o
  1219. endif
  1220. endif
  1221. ifdef CONFIG_NO_RC4
  1222. CFLAGS += -DCONFIG_NO_RC4
  1223. endif
  1224. ifdef NEED_RC4
  1225. ifdef CONFIG_INTERNAL_RC4
  1226. ifndef CONFIG_NO_RC4
  1227. OBJS += ../src/crypto/rc4.o
  1228. endif
  1229. endif
  1230. endif
  1231. SHA256OBJS = # none by default
  1232. ifdef NEED_SHA256
  1233. CFLAGS += -DCONFIG_SHA256
  1234. ifneq ($(CONFIG_TLS), openssl)
  1235. ifneq ($(CONFIG_TLS), linux)
  1236. SHA256OBJS += ../src/crypto/sha256.o
  1237. endif
  1238. endif
  1239. SHA256OBJS += ../src/crypto/sha256-prf.o
  1240. ifdef CONFIG_INTERNAL_SHA256
  1241. SHA256OBJS += ../src/crypto/sha256-internal.o
  1242. endif
  1243. ifdef CONFIG_INTERNAL_SHA384
  1244. CFLAGS += -DCONFIG_INTERNAL_SHA384
  1245. SHA256OBJS += ../src/crypto/sha384-internal.o
  1246. endif
  1247. ifdef CONFIG_INTERNAL_SHA512
  1248. CFLAGS += -DCONFIG_INTERNAL_SHA512
  1249. SHA256OBJS += ../src/crypto/sha512-internal.o
  1250. endif
  1251. ifdef NEED_TLS_PRF_SHA256
  1252. SHA256OBJS += ../src/crypto/sha256-tlsprf.o
  1253. endif
  1254. ifdef NEED_HMAC_SHA256_KDF
  1255. CFLAGS += -DCONFIG_HMAC_SHA256_KDF
  1256. OBJS += ../src/crypto/sha256-kdf.o
  1257. endif
  1258. OBJS += $(SHA256OBJS)
  1259. endif
  1260. ifdef NEED_SHA384
  1261. ifneq ($(CONFIG_TLS), openssl)
  1262. ifneq ($(CONFIG_TLS), linux)
  1263. OBJS += ../src/crypto/sha384.o
  1264. endif
  1265. endif
  1266. CFLAGS += -DCONFIG_SHA384
  1267. OBJS += ../src/crypto/sha384-prf.o
  1268. endif
  1269. ifdef NEED_DH_GROUPS
  1270. OBJS += ../src/crypto/dh_groups.o
  1271. endif
  1272. ifdef NEED_DH_GROUPS_ALL
  1273. CFLAGS += -DALL_DH_GROUPS
  1274. endif
  1275. ifdef CONFIG_INTERNAL_DH_GROUP5
  1276. ifdef NEED_DH_GROUPS
  1277. OBJS += ../src/crypto/dh_group5.o
  1278. endif
  1279. endif
  1280. ifdef NEED_ECC
  1281. CFLAGS += -DCONFIG_ECC
  1282. endif
  1283. ifdef CONFIG_NO_RANDOM_POOL
  1284. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1285. else
  1286. OBJS += ../src/crypto/random.o
  1287. endif
  1288. ifdef CONFIG_CTRL_IFACE
  1289. ifeq ($(CONFIG_CTRL_IFACE), y)
  1290. ifdef CONFIG_NATIVE_WINDOWS
  1291. CONFIG_CTRL_IFACE=named_pipe
  1292. else
  1293. CONFIG_CTRL_IFACE=unix
  1294. endif
  1295. endif
  1296. CFLAGS += -DCONFIG_CTRL_IFACE
  1297. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1298. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1299. OBJS += ../src/common/ctrl_iface_common.o
  1300. endif
  1301. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1302. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1303. endif
  1304. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  1305. CONFIG_CTRL_IFACE=udp
  1306. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1307. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1308. endif
  1309. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1310. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1311. endif
  1312. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1313. CONFIG_CTRL_IFACE=udp
  1314. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1315. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1316. endif
  1317. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  1318. CONFIG_CTRL_IFACE=udp
  1319. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1320. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1321. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1322. endif
  1323. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  1324. endif
  1325. ifdef CONFIG_CTRL_IFACE_DBUS
  1326. DBUS=y
  1327. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1328. DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
  1329. ifdef CONFIG_WPS
  1330. DBUS_OBJS += dbus/dbus_old_handlers_wps.o
  1331. endif
  1332. DBUS_OBJS += dbus/dbus_dict_helpers.o
  1333. ifndef DBUS_LIBS
  1334. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1335. endif
  1336. ifndef DBUS_INCLUDE
  1337. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1338. endif
  1339. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1340. DBUS_INTERFACE=fi.epitest.hostap.WPASupplicant
  1341. endif
  1342. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1343. DBUS=y
  1344. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1345. DBUS_OBJS ?= dbus/dbus_dict_helpers.o
  1346. DBUS_OBJS += dbus/dbus_new_helpers.o
  1347. DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
  1348. ifdef CONFIG_WPS
  1349. DBUS_OBJS += dbus/dbus_new_handlers_wps.o
  1350. endif
  1351. ifdef CONFIG_P2P
  1352. DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
  1353. endif
  1354. ifndef DBUS_LIBS
  1355. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1356. endif
  1357. ifndef DBUS_INCLUDE
  1358. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1359. endif
  1360. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1361. DBUS_OBJS += dbus/dbus_new_introspect.o
  1362. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1363. endif
  1364. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1365. DBUS_INTERFACE=fi.w1.wpa_supplicant1
  1366. endif
  1367. ifdef DBUS
  1368. DBUS_CFLAGS += -DCONFIG_DBUS
  1369. DBUS_OBJS += dbus/dbus_common.o
  1370. endif
  1371. OBJS += $(DBUS_OBJS)
  1372. CFLAGS += $(DBUS_CFLAGS)
  1373. LIBS += $(DBUS_LIBS)
  1374. ifdef CONFIG_READLINE
  1375. OBJS_c += ../src/utils/edit_readline.o
  1376. LIBS_c += -lreadline -lncurses
  1377. else
  1378. ifdef CONFIG_WPA_CLI_EDIT
  1379. OBJS_c += ../src/utils/edit.o
  1380. else
  1381. OBJS_c += ../src/utils/edit_simple.o
  1382. endif
  1383. endif
  1384. ifdef CONFIG_NATIVE_WINDOWS
  1385. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1386. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1387. LIBS_c += -lws2_32
  1388. LIBS_p += -lws2_32 -lgdi32
  1389. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1390. LIBS_p += -lcrypt32
  1391. endif
  1392. endif
  1393. ifdef CONFIG_NO_STDOUT_DEBUG
  1394. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1395. ifndef CONFIG_CTRL_IFACE
  1396. CFLAGS += -DCONFIG_NO_WPA_MSG
  1397. endif
  1398. endif
  1399. ifdef CONFIG_IPV6
  1400. # for eapol_test only
  1401. CFLAGS += -DCONFIG_IPV6
  1402. endif
  1403. ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1404. CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1405. endif
  1406. ifdef NEED_BASE64
  1407. OBJS += ../src/utils/base64.o
  1408. endif
  1409. ifdef NEED_SME
  1410. OBJS += sme.o
  1411. CFLAGS += -DCONFIG_SME
  1412. endif
  1413. OBJS += ../src/common/ieee802_11_common.o
  1414. OBJS += ../src/common/hw_features_common.o
  1415. ifdef NEED_EAP_COMMON
  1416. OBJS += ../src/eap_common/eap_common.o
  1417. endif
  1418. ifndef CONFIG_MAIN
  1419. CONFIG_MAIN=main
  1420. endif
  1421. ifdef CONFIG_DEBUG_SYSLOG
  1422. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1423. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1424. CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1425. endif
  1426. endif
  1427. ifdef CONFIG_DEBUG_LINUX_TRACING
  1428. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1429. endif
  1430. ifdef CONFIG_DEBUG_FILE
  1431. CFLAGS += -DCONFIG_DEBUG_FILE
  1432. endif
  1433. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1434. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1435. endif
  1436. ifdef CONFIG_FIPS
  1437. CFLAGS += -DCONFIG_FIPS
  1438. ifneq ($(CONFIG_TLS), openssl)
  1439. $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
  1440. endif
  1441. endif
  1442. OBJS += $(SHA1OBJS) $(DESOBJS)
  1443. OBJS_p += $(SHA1OBJS)
  1444. OBJS_p += $(SHA256OBJS)
  1445. OBJS_priv += $(SHA1OBJS)
  1446. ifdef CONFIG_BGSCAN_SIMPLE
  1447. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1448. OBJS += bgscan_simple.o
  1449. NEED_BGSCAN=y
  1450. endif
  1451. ifdef CONFIG_BGSCAN_LEARN
  1452. CFLAGS += -DCONFIG_BGSCAN_LEARN
  1453. OBJS += bgscan_learn.o
  1454. NEED_BGSCAN=y
  1455. endif
  1456. ifdef NEED_BGSCAN
  1457. CFLAGS += -DCONFIG_BGSCAN
  1458. OBJS += bgscan.o
  1459. endif
  1460. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1461. CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1462. OBJS += autoscan_exponential.o
  1463. NEED_AUTOSCAN=y
  1464. endif
  1465. ifdef CONFIG_AUTOSCAN_PERIODIC
  1466. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1467. OBJS += autoscan_periodic.o
  1468. NEED_AUTOSCAN=y
  1469. endif
  1470. ifdef NEED_AUTOSCAN
  1471. CFLAGS += -DCONFIG_AUTOSCAN
  1472. OBJS += autoscan.o
  1473. endif
  1474. ifdef CONFIG_EXT_PASSWORD_TEST
  1475. OBJS += ../src/utils/ext_password_test.o
  1476. CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1477. NEED_EXT_PASSWORD=y
  1478. endif
  1479. ifdef NEED_EXT_PASSWORD
  1480. OBJS += ../src/utils/ext_password.o
  1481. CFLAGS += -DCONFIG_EXT_PASSWORD
  1482. endif
  1483. ifdef NEED_GAS
  1484. OBJS += ../src/common/gas.o
  1485. OBJS += gas_query.o
  1486. CFLAGS += -DCONFIG_GAS
  1487. NEED_OFFCHANNEL=y
  1488. endif
  1489. ifdef NEED_OFFCHANNEL
  1490. OBJS += offchannel.o
  1491. CFLAGS += -DCONFIG_OFFCHANNEL
  1492. endif
  1493. ifdef CONFIG_MODULE_TESTS
  1494. CFLAGS += -DCONFIG_MODULE_TESTS
  1495. OBJS += wpas_module_tests.o
  1496. OBJS += ../src/utils/utils_module_tests.o
  1497. OBJS += ../src/common/common_module_tests.o
  1498. OBJS += ../src/crypto/crypto_module_tests.o
  1499. ifdef CONFIG_WPS
  1500. OBJS += ../src/wps/wps_module_tests.o
  1501. endif
  1502. endif
  1503. OBJS += ../src/drivers/driver_common.o
  1504. OBJS_priv += ../src/drivers/driver_common.o
  1505. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1506. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
  1507. OBJS_t += ../src/radius/radius_client.o
  1508. OBJS_t += ../src/radius/radius.o
  1509. ifndef CONFIG_AP
  1510. OBJS_t += ../src/utils/ip_addr.o
  1511. endif
  1512. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1513. OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
  1514. OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
  1515. OBJS += $(CONFIG_MAIN).o
  1516. ifdef CONFIG_PRIVSEP
  1517. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
  1518. OBJS_priv += $(OBJS_l2)
  1519. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1520. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1521. OBJS_priv += ../src/utils/common.o
  1522. OBJS_priv += ../src/utils/wpa_debug.o
  1523. OBJS_priv += ../src/utils/wpabuf.o
  1524. OBJS_priv += wpa_priv.o
  1525. ifdef CONFIG_DRIVER_NL80211
  1526. OBJS_priv += ../src/common/ieee802_11_common.o
  1527. endif
  1528. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1529. OBJS += ../src/drivers/driver_privsep.o
  1530. EXTRA_progs += wpa_priv
  1531. else
  1532. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1533. OBJS += $(OBJS_l2)
  1534. endif
  1535. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1536. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1537. OBJS += ../src/drivers/ndis_events.o
  1538. EXTRALIBS += -loleaut32 -lole32 -luuid
  1539. ifdef PLATFORMSDKLIB
  1540. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1541. else
  1542. EXTRALIBS += WbemUuid.Lib
  1543. endif
  1544. endif
  1545. ifdef CONFIG_FST
  1546. CFLAGS += -DCONFIG_FST
  1547. ifdef CONFIG_FST_TEST
  1548. CFLAGS += -DCONFIG_FST_TEST
  1549. endif
  1550. FST_OBJS += ../src/fst/fst.o
  1551. FST_OBJS += ../src/fst/fst_session.o
  1552. FST_OBJS += ../src/fst/fst_iface.o
  1553. FST_OBJS += ../src/fst/fst_group.o
  1554. FST_OBJS += ../src/fst/fst_ctrl_aux.o
  1555. ifdef CONFIG_CTRL_IFACE
  1556. FST_OBJS += ../src/fst/fst_ctrl_iface.o
  1557. endif
  1558. OBJS += $(FST_OBJS)
  1559. OBJS_t += $(FST_OBJS)
  1560. OBJS_t2 += $(FST_OBJS)
  1561. OBJS_nfc += $(FST_OBJS)
  1562. endif
  1563. ifndef LDO
  1564. LDO=$(CC)
  1565. endif
  1566. Q=@
  1567. E=echo
  1568. ifeq ($(V), 1)
  1569. Q=
  1570. E=true
  1571. endif
  1572. ifeq ($(QUIET), 1)
  1573. Q=@
  1574. E=true
  1575. endif
  1576. dynamic_eap_methods: $(EAPDYN)
  1577. ../src/drivers/build.wpa_supplicant:
  1578. @if [ -f ../src/drivers/build.hostapd ]; then \
  1579. $(MAKE) -C ../src/drivers clean; \
  1580. fi
  1581. @touch ../src/drivers/build.wpa_supplicant
  1582. BCHECK=../src/drivers/build.wpa_supplicant
  1583. wpa_priv: $(BCHECK) $(OBJS_priv)
  1584. $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1585. @$(E) " LD " $@
  1586. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  1587. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  1588. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1589. @$(E) " LD " $@
  1590. eapol_test: $(OBJS_t)
  1591. $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1592. @$(E) " LD " $@
  1593. preauth_test: $(OBJS_t2)
  1594. $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1595. @$(E) " LD " $@
  1596. wpa_passphrase: $(OBJS_p)
  1597. $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
  1598. @$(E) " LD " $@
  1599. wpa_cli: $(OBJS_c)
  1600. $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1601. @$(E) " LD " $@
  1602. LIBCTRL += ../src/common/wpa_ctrl.o
  1603. LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
  1604. LIBCTRL += ../src/utils/common.o
  1605. LIBCTRL += ../src/utils/wpa_debug.o
  1606. LIBCTRLSO += ../src/common/wpa_ctrl.c
  1607. LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
  1608. LIBCTRLSO += ../src/utils/common.c
  1609. LIBCTRLSO += ../src/utils/wpa_debug.c
  1610. libwpa_client.a: $(LIBCTRL)
  1611. $(Q)rm -f $@
  1612. $(Q)$(AR) crs $@ $?
  1613. @$(E) " AR " $@
  1614. libwpa_client.so: $(LIBCTRLSO)
  1615. @$(E) " CC $@ ($^)"
  1616. $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
  1617. libwpa_test1: libwpa_test.o libwpa_client.a
  1618. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
  1619. @$(E) " LD " $@
  1620. libwpa_test2: libwpa_test.o libwpa_client.so
  1621. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
  1622. @$(E) " LD " $@
  1623. nfc_pw_token: $(OBJS_nfc)
  1624. $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
  1625. @$(E) " LD " $@
  1626. win_if_list: win_if_list.c
  1627. $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1628. @$(E) " LD " $@
  1629. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1630. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1631. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1632. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1633. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1634. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1635. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1636. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1637. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1638. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1639. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1640. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1641. 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
  1642. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1643. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1644. eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
  1645. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1646. -Deap_peer_eke_register=eap_peer_method_dynamic_init
  1647. %.so: %.c
  1648. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1649. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1650. ifdef CONFIG_CODE_COVERAGE
  1651. %.o: %.c
  1652. @$(E) " CC " $<
  1653. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1654. else
  1655. %.o: %.c
  1656. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1657. @$(E) " CC " $<
  1658. endif
  1659. %.service: %.service.in
  1660. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1661. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1662. @$(E) " sed" $<
  1663. %@.service: %.service.arg.in
  1664. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1665. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1666. @$(E) " sed" $<
  1667. wpa_supplicant.exe: wpa_supplicant
  1668. mv -f $< $@
  1669. wpa_cli.exe: wpa_cli
  1670. mv -f $< $@
  1671. wpa_passphrase.exe: wpa_passphrase
  1672. mv -f $< $@
  1673. win_if_list.exe: win_if_list
  1674. mv -f $< $@
  1675. eapol_test.exe: eapol_test
  1676. mv -f $< $@
  1677. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1678. windows-bin: $(WINALL)
  1679. $(STRIP) $(WINALL)
  1680. wpa_gui:
  1681. @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
  1682. wpa_gui-qt4/Makefile:
  1683. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1684. wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
  1685. lrelease wpa_gui-qt4/wpa_gui.pro
  1686. wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
  1687. $(MAKE) -C wpa_gui-qt4
  1688. FIPSDIR=/usr/local/ssl/fips-2.0
  1689. FIPSLD=$(FIPSDIR)/bin/fipsld
  1690. fips:
  1691. $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
  1692. lcov-html: wpa_supplicant.gcda
  1693. lcov -c -d .. > lcov.info
  1694. genhtml lcov.info --output-directory lcov-html
  1695. clean:
  1696. $(MAKE) -C ../src clean
  1697. $(MAKE) -C dbus clean
  1698. rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
  1699. rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1700. rm -f wpa_priv
  1701. rm -f nfc_pw_token
  1702. rm -f lcov.info
  1703. rm -rf lcov-html
  1704. rm -f libwpa_client.a
  1705. rm -f libwpa_client.so
  1706. rm -f libwpa_test1 libwpa_test2
  1707. -include $(OBJS:%.o=%.d)