Makefile 42 KB

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