Makefile 42 KB

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