Makefile 41 KB

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