Makefile 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050
  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=+ --tags)
  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. ifeq ($(CONFIG_TLS), wolfssl)
  624. CFLAGS += -DCONFIG_ECC
  625. endif
  626. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  627. CONFIG_IEEE8021X_EAPOL=y
  628. NEED_SHA256=y
  629. NEED_ECC=y
  630. endif
  631. ifdef CONFIG_EAP_EKE
  632. # EAP-EKE
  633. ifeq ($(CONFIG_EAP_EKE), dyn)
  634. CFLAGS += -DEAP_EKE_DYNAMIC
  635. EAPDYN += ../src/eap_peer/eap_eke.so
  636. else
  637. CFLAGS += -DEAP_EKE
  638. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  639. endif
  640. CONFIG_IEEE8021X_EAPOL=y
  641. NEED_DH_GROUPS=y
  642. NEED_DH_GROUPS_ALL=y
  643. NEED_SHA256=y
  644. NEED_AES_CBC=y
  645. endif
  646. ifdef CONFIG_WPS
  647. # EAP-WSC
  648. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  649. OBJS += wps_supplicant.o
  650. OBJS += ../src/utils/uuid.o
  651. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  652. OBJS += ../src/wps/wps.o
  653. OBJS += ../src/wps/wps_common.o
  654. OBJS += ../src/wps/wps_attr_parse.o
  655. OBJS += ../src/wps/wps_attr_build.o
  656. OBJS += ../src/wps/wps_attr_process.o
  657. OBJS += ../src/wps/wps_dev_attr.o
  658. OBJS += ../src/wps/wps_enrollee.o
  659. OBJS += ../src/wps/wps_registrar.o
  660. CONFIG_IEEE8021X_EAPOL=y
  661. NEED_DH_GROUPS=y
  662. NEED_SHA256=y
  663. NEED_BASE64=y
  664. NEED_AES_CBC=y
  665. NEED_MODEXP=y
  666. ifdef CONFIG_WPS_NFC
  667. CFLAGS += -DCONFIG_WPS_NFC
  668. OBJS += ../src/wps/ndef.o
  669. NEED_WPS_OOB=y
  670. endif
  671. ifdef NEED_WPS_OOB
  672. CFLAGS += -DCONFIG_WPS_OOB
  673. endif
  674. ifdef CONFIG_WPS_ER
  675. CONFIG_WPS_UPNP=y
  676. CFLAGS += -DCONFIG_WPS_ER
  677. OBJS += ../src/wps/wps_er.o
  678. OBJS += ../src/wps/wps_er_ssdp.o
  679. endif
  680. ifdef CONFIG_WPS_UPNP
  681. CFLAGS += -DCONFIG_WPS_UPNP
  682. OBJS += ../src/wps/wps_upnp.o
  683. OBJS += ../src/wps/wps_upnp_ssdp.o
  684. OBJS += ../src/wps/wps_upnp_web.o
  685. OBJS += ../src/wps/wps_upnp_event.o
  686. OBJS += ../src/wps/wps_upnp_ap.o
  687. OBJS += ../src/wps/upnp_xml.o
  688. OBJS += ../src/wps/httpread.o
  689. OBJS += ../src/wps/http_client.o
  690. OBJS += ../src/wps/http_server.o
  691. endif
  692. ifdef CONFIG_WPS_STRICT
  693. CFLAGS += -DCONFIG_WPS_STRICT
  694. OBJS += ../src/wps/wps_validate.o
  695. endif
  696. ifdef CONFIG_WPS_TESTING
  697. CFLAGS += -DCONFIG_WPS_TESTING
  698. endif
  699. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  700. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  701. endif
  702. endif
  703. ifdef CONFIG_EAP_IKEV2
  704. # EAP-IKEv2
  705. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  706. CFLAGS += -DEAP_IKEV2_DYNAMIC
  707. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  708. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  709. else
  710. CFLAGS += -DEAP_IKEV2
  711. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  712. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  713. endif
  714. CONFIG_IEEE8021X_EAPOL=y
  715. NEED_DH_GROUPS=y
  716. NEED_DH_GROUPS_ALL=y
  717. NEED_MODEXP=y
  718. NEED_CIPHER=y
  719. endif
  720. ifdef CONFIG_EAP_VENDOR_TEST
  721. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  722. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  723. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  724. else
  725. CFLAGS += -DEAP_VENDOR_TEST
  726. OBJS += ../src/eap_peer/eap_vendor_test.o
  727. endif
  728. CONFIG_IEEE8021X_EAPOL=y
  729. endif
  730. ifdef CONFIG_EAP_TNC
  731. # EAP-TNC
  732. CFLAGS += -DEAP_TNC
  733. OBJS += ../src/eap_peer/eap_tnc.o
  734. OBJS += ../src/eap_peer/tncc.o
  735. NEED_BASE64=y
  736. ifndef CONFIG_NATIVE_WINDOWS
  737. ifndef CONFIG_DRIVER_BSD
  738. LIBS += -ldl
  739. endif
  740. endif
  741. endif
  742. ifdef CONFIG_MACSEC
  743. CFLAGS += -DCONFIG_MACSEC
  744. CONFIG_IEEE8021X_EAPOL=y
  745. NEED_AES_ENCBLOCK=y
  746. NEED_AES_UNWRAP=y
  747. NEED_AES_WRAP=y
  748. NEED_AES_OMAC1=y
  749. OBJS += wpas_kay.o
  750. OBJS += ../src/pae/ieee802_1x_cp.o
  751. OBJS += ../src/pae/ieee802_1x_kay.o
  752. OBJS += ../src/pae/ieee802_1x_key.o
  753. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  754. endif
  755. ifdef CONFIG_IEEE8021X_EAPOL
  756. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  757. CFLAGS += -DIEEE8021X_EAPOL
  758. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  759. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  760. NEED_EAP_COMMON=y
  761. ifdef CONFIG_DYNAMIC_EAP_METHODS
  762. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  763. LIBS += -ldl -rdynamic
  764. endif
  765. endif
  766. ifdef CONFIG_AP
  767. NEED_EAP_COMMON=y
  768. NEED_RSN_AUTHENTICATOR=y
  769. CFLAGS += -DCONFIG_AP
  770. OBJS += ap.o
  771. CFLAGS += -DCONFIG_NO_RADIUS
  772. CFLAGS += -DCONFIG_NO_ACCOUNTING
  773. CFLAGS += -DCONFIG_NO_VLAN
  774. OBJS += ../src/ap/hostapd.o
  775. OBJS += ../src/ap/wpa_auth_glue.o
  776. OBJS += ../src/ap/utils.o
  777. OBJS += ../src/ap/authsrv.o
  778. OBJS += ../src/ap/ap_config.o
  779. OBJS += ../src/utils/ip_addr.o
  780. OBJS += ../src/ap/sta_info.o
  781. OBJS += ../src/ap/tkip_countermeasures.o
  782. OBJS += ../src/ap/ap_mlme.o
  783. OBJS += ../src/ap/ieee802_1x.o
  784. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  785. OBJS += ../src/ap/ieee802_11_auth.o
  786. OBJS += ../src/ap/ieee802_11_shared.o
  787. OBJS += ../src/ap/drv_callbacks.o
  788. OBJS += ../src/ap/ap_drv_ops.o
  789. OBJS += ../src/ap/beacon.o
  790. OBJS += ../src/ap/bss_load.o
  791. OBJS += ../src/ap/eap_user_db.o
  792. OBJS += ../src/ap/neighbor_db.o
  793. OBJS += ../src/ap/rrm.o
  794. ifdef CONFIG_IEEE80211N
  795. OBJS += ../src/ap/ieee802_11_ht.o
  796. ifdef CONFIG_IEEE80211AC
  797. OBJS += ../src/ap/ieee802_11_vht.o
  798. endif
  799. ifdef CONFIG_IEEE80211AX
  800. OBJS += ../src/ap/ieee802_11_he.o
  801. endif
  802. endif
  803. ifdef CONFIG_WNM_AP
  804. CFLAGS += -DCONFIG_WNM_AP
  805. OBJS += ../src/ap/wnm_ap.o
  806. endif
  807. ifdef CONFIG_MBO
  808. OBJS += ../src/ap/mbo_ap.o
  809. endif
  810. ifdef CONFIG_FILS
  811. OBJS += ../src/ap/fils_hlp.o
  812. endif
  813. ifdef CONFIG_CTRL_IFACE
  814. OBJS += ../src/ap/ctrl_iface_ap.o
  815. endif
  816. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  817. OBJS += ../src/eap_server/eap_server.o
  818. OBJS += ../src/eap_server/eap_server_identity.o
  819. OBJS += ../src/eap_server/eap_server_methods.o
  820. ifdef CONFIG_IEEE80211N
  821. CFLAGS += -DCONFIG_IEEE80211N
  822. ifdef CONFIG_IEEE80211AC
  823. CFLAGS += -DCONFIG_IEEE80211AC
  824. endif
  825. ifdef CONFIG_IEEE80211AX
  826. CFLAGS += -DCONFIG_IEEE80211AX
  827. endif
  828. endif
  829. ifdef NEED_AP_MLME
  830. OBJS += ../src/ap/wmm.o
  831. OBJS += ../src/ap/ap_list.o
  832. OBJS += ../src/ap/ieee802_11.o
  833. OBJS += ../src/ap/hw_features.o
  834. OBJS += ../src/ap/dfs.o
  835. CFLAGS += -DNEED_AP_MLME
  836. endif
  837. ifdef CONFIG_WPS
  838. CFLAGS += -DEAP_SERVER_WSC
  839. OBJS += ../src/ap/wps_hostapd.o
  840. OBJS += ../src/eap_server/eap_server_wsc.o
  841. endif
  842. ifdef CONFIG_DPP
  843. OBJS += ../src/ap/dpp_hostapd.o
  844. OBJS += ../src/ap/gas_query_ap.o
  845. endif
  846. ifdef CONFIG_INTERWORKING
  847. OBJS += ../src/ap/gas_serv.o
  848. endif
  849. ifdef CONFIG_HS20
  850. OBJS += ../src/ap/hs20.o
  851. endif
  852. endif
  853. ifdef CONFIG_MBO
  854. OBJS += mbo.o
  855. CFLAGS += -DCONFIG_MBO
  856. endif
  857. ifdef NEED_RSN_AUTHENTICATOR
  858. CFLAGS += -DCONFIG_NO_RADIUS
  859. NEED_AES_WRAP=y
  860. OBJS += ../src/ap/wpa_auth.o
  861. OBJS += ../src/ap/wpa_auth_ie.o
  862. OBJS += ../src/ap/pmksa_cache_auth.o
  863. ifdef CONFIG_IEEE80211R_AP
  864. CFLAGS += -DCONFIG_IEEE80211R_AP
  865. OBJS += ../src/ap/wpa_auth_ft.o
  866. endif
  867. endif
  868. ifdef CONFIG_ACS
  869. CFLAGS += -DCONFIG_ACS
  870. OBJS += ../src/ap/acs.o
  871. LIBS += -lm
  872. endif
  873. ifdef CONFIG_PCSC
  874. # PC/SC interface for smartcards (USIM, GSM SIM)
  875. CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
  876. OBJS += ../src/utils/pcsc_funcs.o
  877. # -lpthread may not be needed depending on how pcsc-lite was configured
  878. ifdef CONFIG_NATIVE_WINDOWS
  879. #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
  880. #dynamic symbol loading that is now used in pcsc_funcs.c
  881. #LIBS += -lwinscard
  882. else
  883. ifdef CONFIG_OSX
  884. LIBS += -framework PCSC
  885. else
  886. LIBS += -lpcsclite -lpthread
  887. endif
  888. endif
  889. endif
  890. ifdef CONFIG_SIM_SIMULATOR
  891. CFLAGS += -DCONFIG_SIM_SIMULATOR
  892. NEED_MILENAGE=y
  893. endif
  894. ifdef CONFIG_USIM_SIMULATOR
  895. CFLAGS += -DCONFIG_USIM_SIMULATOR
  896. NEED_MILENAGE=y
  897. endif
  898. ifdef NEED_MILENAGE
  899. OBJS += ../src/crypto/milenage.o
  900. NEED_AES_ENCBLOCK=y
  901. endif
  902. ifdef CONFIG_PKCS12
  903. CFLAGS += -DPKCS12_FUNCS
  904. endif
  905. ifdef CONFIG_SMARTCARD
  906. CFLAGS += -DCONFIG_SMARTCARD
  907. endif
  908. ifdef MS_FUNCS
  909. OBJS += ../src/crypto/ms_funcs.o
  910. NEED_DES=y
  911. NEED_MD4=y
  912. endif
  913. ifdef CHAP
  914. OBJS += ../src/eap_common/chap.o
  915. endif
  916. ifdef TLS_FUNCS
  917. NEED_DES=y
  918. # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
  919. OBJS += ../src/eap_peer/eap_tls_common.o
  920. ifndef CONFIG_FIPS
  921. NEED_TLS_PRF=y
  922. NEED_SHA1=y
  923. NEED_MD5=y
  924. endif
  925. endif
  926. ifndef CONFIG_TLS
  927. CONFIG_TLS=openssl
  928. endif
  929. ifdef CONFIG_TLSV11
  930. CFLAGS += -DCONFIG_TLSV11
  931. endif
  932. ifdef CONFIG_TLSV12
  933. CFLAGS += -DCONFIG_TLSV12
  934. NEED_SHA256=y
  935. endif
  936. ifeq ($(CONFIG_TLS), wolfssl)
  937. ifdef TLS_FUNCS
  938. CFLAGS += -DWOLFSSL_DER_LOAD -I/usr/local/include/wolfssl
  939. OBJS += ../src/crypto/tls_wolfssl.o
  940. endif
  941. OBJS += ../src/crypto/crypto_wolfssl.o
  942. OBJS_p += ../src/crypto/crypto_wolfssl.o
  943. ifdef NEED_FIPS186_2_PRF
  944. OBJS += ../src/crypto/fips_prf_wolfssl.o
  945. endif
  946. LIBS += -lwolfssl -lm
  947. LIBS_p += -lwolfssl -lm
  948. endif
  949. ifeq ($(CONFIG_TLS), openssl)
  950. ifdef TLS_FUNCS
  951. CFLAGS += -DEAP_TLS_OPENSSL
  952. OBJS += ../src/crypto/tls_openssl.o
  953. OBJS += ../src/crypto/tls_openssl_ocsp.o
  954. LIBS += -lssl
  955. endif
  956. OBJS += ../src/crypto/crypto_openssl.o
  957. OBJS_p += ../src/crypto/crypto_openssl.o
  958. OBJS_priv += ../src/crypto/crypto_openssl.o
  959. ifdef NEED_FIPS186_2_PRF
  960. OBJS += ../src/crypto/fips_prf_openssl.o
  961. endif
  962. NEED_SHA256=y
  963. NEED_TLS_PRF_SHA256=y
  964. LIBS += -lcrypto
  965. LIBS_p += -lcrypto
  966. ifdef CONFIG_TLS_ADD_DL
  967. LIBS += -ldl
  968. LIBS_p += -ldl
  969. endif
  970. ifndef CONFIG_TLS_DEFAULT_CIPHERS
  971. CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
  972. endif
  973. CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
  974. endif
  975. ifeq ($(CONFIG_TLS), gnutls)
  976. ifndef CONFIG_CRYPTO
  977. # default to libgcrypt
  978. CONFIG_CRYPTO=gnutls
  979. endif
  980. ifdef TLS_FUNCS
  981. OBJS += ../src/crypto/tls_gnutls.o
  982. LIBS += -lgnutls -lgpg-error
  983. endif
  984. OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  985. OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  986. OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
  987. ifdef NEED_FIPS186_2_PRF
  988. OBJS += ../src/crypto/fips_prf_internal.o
  989. SHA1OBJS += ../src/crypto/sha1-internal.o
  990. endif
  991. ifeq ($(CONFIG_CRYPTO), gnutls)
  992. LIBS += -lgcrypt
  993. LIBS_p += -lgcrypt
  994. CONFIG_INTERNAL_RC4=y
  995. CONFIG_INTERNAL_DH_GROUP5=y
  996. endif
  997. ifeq ($(CONFIG_CRYPTO), nettle)
  998. LIBS += -lnettle -lgmp
  999. LIBS_p += -lnettle -lgmp
  1000. CONFIG_INTERNAL_RC4=y
  1001. CONFIG_INTERNAL_DH_GROUP5=y
  1002. endif
  1003. endif
  1004. ifeq ($(CONFIG_TLS), internal)
  1005. ifndef CONFIG_CRYPTO
  1006. CONFIG_CRYPTO=internal
  1007. endif
  1008. ifdef TLS_FUNCS
  1009. OBJS += ../src/crypto/crypto_internal-rsa.o
  1010. OBJS += ../src/crypto/tls_internal.o
  1011. OBJS += ../src/tls/tlsv1_common.o
  1012. OBJS += ../src/tls/tlsv1_record.o
  1013. OBJS += ../src/tls/tlsv1_cred.o
  1014. OBJS += ../src/tls/tlsv1_client.o
  1015. OBJS += ../src/tls/tlsv1_client_write.o
  1016. OBJS += ../src/tls/tlsv1_client_read.o
  1017. OBJS += ../src/tls/tlsv1_client_ocsp.o
  1018. OBJS += ../src/tls/asn1.o
  1019. OBJS += ../src/tls/rsa.o
  1020. OBJS += ../src/tls/x509v3.o
  1021. OBJS += ../src/tls/pkcs1.o
  1022. OBJS += ../src/tls/pkcs5.o
  1023. OBJS += ../src/tls/pkcs8.o
  1024. NEED_SHA256=y
  1025. NEED_BASE64=y
  1026. NEED_TLS_PRF=y
  1027. ifdef CONFIG_TLSV12
  1028. NEED_TLS_PRF_SHA256=y
  1029. endif
  1030. NEED_MODEXP=y
  1031. NEED_CIPHER=y
  1032. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  1033. endif
  1034. ifdef NEED_CIPHER
  1035. NEED_DES=y
  1036. OBJS += ../src/crypto/crypto_internal-cipher.o
  1037. endif
  1038. ifdef NEED_MODEXP
  1039. OBJS += ../src/crypto/crypto_internal-modexp.o
  1040. OBJS += ../src/tls/bignum.o
  1041. endif
  1042. ifeq ($(CONFIG_CRYPTO), libtomcrypt)
  1043. OBJS += ../src/crypto/crypto_libtomcrypt.o
  1044. OBJS_p += ../src/crypto/crypto_libtomcrypt.o
  1045. LIBS += -ltomcrypt -ltfm
  1046. LIBS_p += -ltomcrypt -ltfm
  1047. CONFIG_INTERNAL_SHA256=y
  1048. CONFIG_INTERNAL_RC4=y
  1049. CONFIG_INTERNAL_DH_GROUP5=y
  1050. endif
  1051. ifeq ($(CONFIG_CRYPTO), internal)
  1052. OBJS += ../src/crypto/crypto_internal.o
  1053. OBJS_p += ../src/crypto/crypto_internal.o
  1054. NEED_AES_ENC=y
  1055. CFLAGS += -DCONFIG_CRYPTO_INTERNAL
  1056. ifdef CONFIG_INTERNAL_LIBTOMMATH
  1057. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1058. ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
  1059. CFLAGS += -DLTM_FAST
  1060. endif
  1061. else
  1062. LIBS += -ltommath
  1063. LIBS_p += -ltommath
  1064. endif
  1065. CONFIG_INTERNAL_AES=y
  1066. CONFIG_INTERNAL_DES=y
  1067. CONFIG_INTERNAL_SHA1=y
  1068. CONFIG_INTERNAL_MD4=y
  1069. CONFIG_INTERNAL_MD5=y
  1070. CONFIG_INTERNAL_SHA256=y
  1071. CONFIG_INTERNAL_SHA384=y
  1072. CONFIG_INTERNAL_SHA512=y
  1073. CONFIG_INTERNAL_RC4=y
  1074. CONFIG_INTERNAL_DH_GROUP5=y
  1075. endif
  1076. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1077. OBJS += ../src/crypto/crypto_cryptoapi.o
  1078. OBJS_p += ../src/crypto/crypto_cryptoapi.o
  1079. CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
  1080. CONFIG_INTERNAL_SHA256=y
  1081. CONFIG_INTERNAL_RC4=y
  1082. endif
  1083. endif
  1084. ifeq ($(CONFIG_TLS), linux)
  1085. OBJS += ../src/crypto/crypto_linux.o
  1086. OBJS_p += ../src/crypto/crypto_linux.o
  1087. ifdef TLS_FUNCS
  1088. OBJS += ../src/crypto/crypto_internal-rsa.o
  1089. OBJS += ../src/crypto/tls_internal.o
  1090. OBJS += ../src/tls/tlsv1_common.o
  1091. OBJS += ../src/tls/tlsv1_record.o
  1092. OBJS += ../src/tls/tlsv1_cred.o
  1093. OBJS += ../src/tls/tlsv1_client.o
  1094. OBJS += ../src/tls/tlsv1_client_write.o
  1095. OBJS += ../src/tls/tlsv1_client_read.o
  1096. OBJS += ../src/tls/tlsv1_client_ocsp.o
  1097. OBJS += ../src/tls/asn1.o
  1098. OBJS += ../src/tls/rsa.o
  1099. OBJS += ../src/tls/x509v3.o
  1100. OBJS += ../src/tls/pkcs1.o
  1101. OBJS += ../src/tls/pkcs5.o
  1102. OBJS += ../src/tls/pkcs8.o
  1103. NEED_SHA256=y
  1104. NEED_BASE64=y
  1105. NEED_TLS_PRF=y
  1106. ifdef CONFIG_TLSV12
  1107. NEED_TLS_PRF_SHA256=y
  1108. endif
  1109. NEED_MODEXP=y
  1110. NEED_CIPHER=y
  1111. CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
  1112. endif
  1113. ifdef NEED_MODEXP
  1114. OBJS += ../src/crypto/crypto_internal-modexp.o
  1115. OBJS += ../src/tls/bignum.o
  1116. CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
  1117. CFLAGS += -DLTM_FAST
  1118. endif
  1119. CONFIG_INTERNAL_DH_GROUP5=y
  1120. ifdef NEED_FIPS186_2_PRF
  1121. OBJS += ../src/crypto/fips_prf_internal.o
  1122. OBJS += ../src/crypto/sha1-internal.o
  1123. endif
  1124. endif
  1125. ifeq ($(CONFIG_TLS), none)
  1126. ifdef TLS_FUNCS
  1127. OBJS += ../src/crypto/tls_none.o
  1128. CFLAGS += -DEAP_TLS_NONE
  1129. CONFIG_INTERNAL_AES=y
  1130. CONFIG_INTERNAL_SHA1=y
  1131. CONFIG_INTERNAL_MD5=y
  1132. endif
  1133. OBJS += ../src/crypto/crypto_none.o
  1134. OBJS_p += ../src/crypto/crypto_none.o
  1135. CONFIG_INTERNAL_SHA256=y
  1136. CONFIG_INTERNAL_RC4=y
  1137. endif
  1138. ifdef TLS_FUNCS
  1139. ifdef CONFIG_SMARTCARD
  1140. ifndef CONFIG_NATIVE_WINDOWS
  1141. ifneq ($(CONFIG_L2_PACKET), freebsd)
  1142. LIBS += -ldl
  1143. endif
  1144. endif
  1145. endif
  1146. endif
  1147. ifndef TLS_FUNCS
  1148. OBJS += ../src/crypto/tls_none.o
  1149. ifeq ($(CONFIG_TLS), internal)
  1150. CONFIG_INTERNAL_AES=y
  1151. CONFIG_INTERNAL_SHA1=y
  1152. CONFIG_INTERNAL_MD5=y
  1153. CONFIG_INTERNAL_RC4=y
  1154. endif
  1155. endif
  1156. AESOBJS = # none so far (see below)
  1157. ifdef CONFIG_INTERNAL_AES
  1158. AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
  1159. endif
  1160. ifneq ($(CONFIG_TLS), openssl)
  1161. ifneq ($(CONFIG_TLS), wolfssl)
  1162. NEED_INTERNAL_AES_WRAP=y
  1163. endif
  1164. endif
  1165. ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
  1166. # Seems to be needed at least with BoringSSL
  1167. NEED_INTERNAL_AES_WRAP=y
  1168. CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
  1169. endif
  1170. ifdef CONFIG_FIPS
  1171. # Have to use internal AES key wrap routines to use OpenSSL EVP since the
  1172. # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
  1173. NEED_INTERNAL_AES_WRAP=y
  1174. endif
  1175. ifdef NEED_INTERNAL_AES_WRAP
  1176. ifneq ($(CONFIG_TLS), linux)
  1177. AESOBJS += ../src/crypto/aes-unwrap.o
  1178. endif
  1179. endif
  1180. ifdef NEED_AES_EAX
  1181. AESOBJS += ../src/crypto/aes-eax.o
  1182. NEED_AES_CTR=y
  1183. NEED_AES_OMAC1=y
  1184. endif
  1185. ifdef NEED_AES_SIV
  1186. AESOBJS += ../src/crypto/aes-siv.o
  1187. NEED_AES_CTR=y
  1188. NEED_AES_OMAC1=y
  1189. endif
  1190. ifdef NEED_AES_CTR
  1191. AESOBJS += ../src/crypto/aes-ctr.o
  1192. endif
  1193. ifdef NEED_AES_ENCBLOCK
  1194. AESOBJS += ../src/crypto/aes-encblock.o
  1195. endif
  1196. ifdef NEED_AES_OMAC1
  1197. NEED_AES_ENC=y
  1198. ifdef CONFIG_OPENSSL_CMAC
  1199. CFLAGS += -DCONFIG_OPENSSL_CMAC
  1200. else
  1201. ifneq ($(CONFIG_TLS), linux)
  1202. ifneq ($(CONFIG_TLS), wolfssl)
  1203. AESOBJS += ../src/crypto/aes-omac1.o
  1204. endif
  1205. endif
  1206. endif
  1207. endif
  1208. ifdef NEED_AES_WRAP
  1209. NEED_AES_ENC=y
  1210. ifdef NEED_INTERNAL_AES_WRAP
  1211. AESOBJS += ../src/crypto/aes-wrap.o
  1212. endif
  1213. endif
  1214. ifdef NEED_AES_CBC
  1215. NEED_AES_ENC=y
  1216. ifneq ($(CONFIG_TLS), openssl)
  1217. ifneq ($(CONFIG_TLS), linux)
  1218. ifneq ($(CONFIG_TLS), wolfssl)
  1219. AESOBJS += ../src/crypto/aes-cbc.o
  1220. endif
  1221. endif
  1222. endif
  1223. endif
  1224. ifdef NEED_AES_ENC
  1225. ifdef CONFIG_INTERNAL_AES
  1226. AESOBJS += ../src/crypto/aes-internal-enc.o
  1227. endif
  1228. endif
  1229. ifdef NEED_AES
  1230. OBJS += $(AESOBJS)
  1231. endif
  1232. ifdef NEED_SHA1
  1233. ifneq ($(CONFIG_TLS), openssl)
  1234. ifneq ($(CONFIG_TLS), linux)
  1235. ifneq ($(CONFIG_TLS), gnutls)
  1236. ifneq ($(CONFIG_TLS), wolfssl)
  1237. SHA1OBJS += ../src/crypto/sha1.o
  1238. endif
  1239. endif
  1240. endif
  1241. endif
  1242. SHA1OBJS += ../src/crypto/sha1-prf.o
  1243. ifdef CONFIG_INTERNAL_SHA1
  1244. SHA1OBJS += ../src/crypto/sha1-internal.o
  1245. ifdef NEED_FIPS186_2_PRF
  1246. SHA1OBJS += ../src/crypto/fips_prf_internal.o
  1247. endif
  1248. endif
  1249. ifdef CONFIG_NO_WPA_PASSPHRASE
  1250. CFLAGS += -DCONFIG_NO_PBKDF2
  1251. else
  1252. ifneq ($(CONFIG_TLS), openssl)
  1253. ifneq ($(CONFIG_TLS), wolfssl)
  1254. SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
  1255. endif
  1256. endif
  1257. endif
  1258. ifdef NEED_T_PRF
  1259. SHA1OBJS += ../src/crypto/sha1-tprf.o
  1260. endif
  1261. ifdef NEED_TLS_PRF
  1262. SHA1OBJS += ../src/crypto/sha1-tlsprf.o
  1263. endif
  1264. endif
  1265. ifndef CONFIG_FIPS
  1266. ifneq ($(CONFIG_TLS), openssl)
  1267. ifneq ($(CONFIG_TLS), linux)
  1268. ifneq ($(CONFIG_TLS), gnutls)
  1269. ifneq ($(CONFIG_TLS), wolfssl)
  1270. MD5OBJS += ../src/crypto/md5.o
  1271. endif
  1272. endif
  1273. endif
  1274. endif
  1275. endif
  1276. ifdef NEED_MD5
  1277. ifdef CONFIG_INTERNAL_MD5
  1278. MD5OBJS += ../src/crypto/md5-internal.o
  1279. endif
  1280. OBJS += $(MD5OBJS)
  1281. OBJS_p += $(MD5OBJS)
  1282. OBJS_priv += $(MD5OBJS)
  1283. endif
  1284. ifdef NEED_MD4
  1285. ifdef CONFIG_INTERNAL_MD4
  1286. OBJS += ../src/crypto/md4-internal.o
  1287. endif
  1288. endif
  1289. DESOBJS = # none needed when not internal
  1290. ifdef NEED_DES
  1291. ifndef CONFIG_FIPS
  1292. CFLAGS += -DCONFIG_DES
  1293. endif
  1294. ifdef CONFIG_INTERNAL_DES
  1295. DESOBJS += ../src/crypto/des-internal.o
  1296. endif
  1297. endif
  1298. ifdef CONFIG_NO_RC4
  1299. CFLAGS += -DCONFIG_NO_RC4
  1300. endif
  1301. ifdef NEED_RC4
  1302. ifdef CONFIG_INTERNAL_RC4
  1303. ifndef CONFIG_NO_RC4
  1304. OBJS += ../src/crypto/rc4.o
  1305. endif
  1306. endif
  1307. endif
  1308. SHA256OBJS = # none by default
  1309. ifdef NEED_SHA256
  1310. CFLAGS += -DCONFIG_SHA256
  1311. ifneq ($(CONFIG_TLS), openssl)
  1312. ifneq ($(CONFIG_TLS), linux)
  1313. ifneq ($(CONFIG_TLS), gnutls)
  1314. ifneq ($(CONFIG_TLS), wolfssl)
  1315. SHA256OBJS += ../src/crypto/sha256.o
  1316. endif
  1317. endif
  1318. endif
  1319. endif
  1320. SHA256OBJS += ../src/crypto/sha256-prf.o
  1321. ifdef CONFIG_INTERNAL_SHA256
  1322. SHA256OBJS += ../src/crypto/sha256-internal.o
  1323. endif
  1324. ifdef CONFIG_INTERNAL_SHA384
  1325. CFLAGS += -DCONFIG_INTERNAL_SHA384
  1326. SHA256OBJS += ../src/crypto/sha384-internal.o
  1327. endif
  1328. ifdef CONFIG_INTERNAL_SHA512
  1329. CFLAGS += -DCONFIG_INTERNAL_SHA512
  1330. SHA256OBJS += ../src/crypto/sha512-internal.o
  1331. endif
  1332. ifdef NEED_TLS_PRF_SHA256
  1333. SHA256OBJS += ../src/crypto/sha256-tlsprf.o
  1334. endif
  1335. ifdef NEED_HMAC_SHA256_KDF
  1336. CFLAGS += -DCONFIG_HMAC_SHA256_KDF
  1337. OBJS += ../src/crypto/sha256-kdf.o
  1338. endif
  1339. ifdef NEED_HMAC_SHA384_KDF
  1340. CFLAGS += -DCONFIG_HMAC_SHA384_KDF
  1341. OBJS += ../src/crypto/sha384-kdf.o
  1342. endif
  1343. ifdef NEED_HMAC_SHA512_KDF
  1344. CFLAGS += -DCONFIG_HMAC_SHA512_KDF
  1345. OBJS += ../src/crypto/sha512-kdf.o
  1346. endif
  1347. OBJS += $(SHA256OBJS)
  1348. endif
  1349. ifdef NEED_SHA384
  1350. ifneq ($(CONFIG_TLS), openssl)
  1351. ifneq ($(CONFIG_TLS), linux)
  1352. ifneq ($(CONFIG_TLS), gnutls)
  1353. ifneq ($(CONFIG_TLS), wolfssl)
  1354. OBJS += ../src/crypto/sha384.o
  1355. endif
  1356. endif
  1357. endif
  1358. endif
  1359. CFLAGS += -DCONFIG_SHA384
  1360. OBJS += ../src/crypto/sha384-prf.o
  1361. endif
  1362. ifdef NEED_SHA512
  1363. ifneq ($(CONFIG_TLS), openssl)
  1364. ifneq ($(CONFIG_TLS), linux)
  1365. ifneq ($(CONFIG_TLS), gnutls)
  1366. ifneq ($(CONFIG_TLS), wolfssl)
  1367. OBJS += ../src/crypto/sha512.o
  1368. endif
  1369. endif
  1370. endif
  1371. endif
  1372. CFLAGS += -DCONFIG_SHA512
  1373. OBJS += ../src/crypto/sha512-prf.o
  1374. endif
  1375. ifdef NEED_DH_GROUPS
  1376. OBJS += ../src/crypto/dh_groups.o
  1377. endif
  1378. ifdef NEED_DH_GROUPS_ALL
  1379. CFLAGS += -DALL_DH_GROUPS
  1380. endif
  1381. ifdef CONFIG_INTERNAL_DH_GROUP5
  1382. ifdef NEED_DH_GROUPS
  1383. OBJS += ../src/crypto/dh_group5.o
  1384. endif
  1385. endif
  1386. ifdef NEED_ECC
  1387. CFLAGS += -DCONFIG_ECC
  1388. endif
  1389. ifdef CONFIG_NO_RANDOM_POOL
  1390. CFLAGS += -DCONFIG_NO_RANDOM_POOL
  1391. else
  1392. OBJS += ../src/crypto/random.o
  1393. endif
  1394. ifdef CONFIG_CTRL_IFACE
  1395. ifeq ($(CONFIG_CTRL_IFACE), y)
  1396. ifdef CONFIG_NATIVE_WINDOWS
  1397. CONFIG_CTRL_IFACE=named_pipe
  1398. else
  1399. CONFIG_CTRL_IFACE=unix
  1400. endif
  1401. endif
  1402. CFLAGS += -DCONFIG_CTRL_IFACE
  1403. ifeq ($(CONFIG_CTRL_IFACE), unix)
  1404. CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
  1405. OBJS += ../src/common/ctrl_iface_common.o
  1406. endif
  1407. ifeq ($(CONFIG_CTRL_IFACE), udp)
  1408. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1409. endif
  1410. ifeq ($(CONFIG_CTRL_IFACE), udp6)
  1411. CONFIG_CTRL_IFACE=udp
  1412. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1413. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1414. endif
  1415. ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
  1416. CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
  1417. endif
  1418. ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
  1419. CONFIG_CTRL_IFACE=udp
  1420. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1421. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1422. endif
  1423. ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
  1424. CONFIG_CTRL_IFACE=udp
  1425. CFLAGS += -DCONFIG_CTRL_IFACE_UDP
  1426. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
  1427. CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
  1428. endif
  1429. OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
  1430. endif
  1431. ifdef CONFIG_CTRL_IFACE_DBUS
  1432. DBUS=y
  1433. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
  1434. DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
  1435. ifdef CONFIG_WPS
  1436. DBUS_OBJS += dbus/dbus_old_handlers_wps.o
  1437. endif
  1438. DBUS_OBJS += dbus/dbus_dict_helpers.o
  1439. ifndef DBUS_LIBS
  1440. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1441. endif
  1442. ifndef DBUS_INCLUDE
  1443. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1444. endif
  1445. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1446. DBUS_INTERFACE=fi.epitest.hostap.WPASupplicant
  1447. endif
  1448. ifdef CONFIG_CTRL_IFACE_DBUS_NEW
  1449. DBUS=y
  1450. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
  1451. DBUS_OBJS ?= dbus/dbus_dict_helpers.o
  1452. DBUS_OBJS += dbus/dbus_new_helpers.o
  1453. DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
  1454. ifdef CONFIG_WPS
  1455. DBUS_OBJS += dbus/dbus_new_handlers_wps.o
  1456. endif
  1457. ifdef CONFIG_P2P
  1458. DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
  1459. endif
  1460. ifndef DBUS_LIBS
  1461. DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
  1462. endif
  1463. ifndef DBUS_INCLUDE
  1464. DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
  1465. endif
  1466. ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
  1467. DBUS_OBJS += dbus/dbus_new_introspect.o
  1468. DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
  1469. endif
  1470. DBUS_CFLAGS += $(DBUS_INCLUDE)
  1471. DBUS_INTERFACE=fi.w1.wpa_supplicant1
  1472. endif
  1473. ifdef DBUS
  1474. DBUS_CFLAGS += -DCONFIG_DBUS
  1475. DBUS_OBJS += dbus/dbus_common.o
  1476. endif
  1477. OBJS += $(DBUS_OBJS)
  1478. CFLAGS += $(DBUS_CFLAGS)
  1479. LIBS += $(DBUS_LIBS)
  1480. ifdef CONFIG_READLINE
  1481. OBJS_c += ../src/utils/edit_readline.o
  1482. LIBS_c += -lreadline -lncurses
  1483. else
  1484. ifdef CONFIG_WPA_CLI_EDIT
  1485. OBJS_c += ../src/utils/edit.o
  1486. else
  1487. OBJS_c += ../src/utils/edit_simple.o
  1488. endif
  1489. endif
  1490. ifdef CONFIG_NATIVE_WINDOWS
  1491. CFLAGS += -DCONFIG_NATIVE_WINDOWS
  1492. LIBS += -lws2_32 -lgdi32 -lcrypt32
  1493. LIBS_c += -lws2_32
  1494. LIBS_p += -lws2_32 -lgdi32
  1495. ifeq ($(CONFIG_CRYPTO), cryptoapi)
  1496. LIBS_p += -lcrypt32
  1497. endif
  1498. endif
  1499. ifdef CONFIG_NO_STDOUT_DEBUG
  1500. CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
  1501. ifndef CONFIG_CTRL_IFACE
  1502. CFLAGS += -DCONFIG_NO_WPA_MSG
  1503. endif
  1504. endif
  1505. ifdef CONFIG_IPV6
  1506. # for eapol_test only
  1507. CFLAGS += -DCONFIG_IPV6
  1508. endif
  1509. ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1510. CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
  1511. endif
  1512. ifdef NEED_BASE64
  1513. OBJS += ../src/utils/base64.o
  1514. endif
  1515. ifdef NEED_SME
  1516. OBJS += sme.o
  1517. CFLAGS += -DCONFIG_SME
  1518. endif
  1519. OBJS += ../src/common/ieee802_11_common.o
  1520. OBJS += ../src/common/hw_features_common.o
  1521. ifdef NEED_EAP_COMMON
  1522. OBJS += ../src/eap_common/eap_common.o
  1523. endif
  1524. ifndef CONFIG_MAIN
  1525. CONFIG_MAIN=main
  1526. endif
  1527. ifdef CONFIG_DEBUG_SYSLOG
  1528. CFLAGS += -DCONFIG_DEBUG_SYSLOG
  1529. ifdef CONFIG_DEBUG_SYSLOG_FACILITY
  1530. CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
  1531. endif
  1532. endif
  1533. ifdef CONFIG_DEBUG_LINUX_TRACING
  1534. CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
  1535. endif
  1536. ifdef CONFIG_DEBUG_FILE
  1537. CFLAGS += -DCONFIG_DEBUG_FILE
  1538. endif
  1539. ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
  1540. CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
  1541. endif
  1542. ifdef CONFIG_FIPS
  1543. CFLAGS += -DCONFIG_FIPS
  1544. ifneq ($(CONFIG_TLS), openssl)
  1545. ifneq ($(CONFIG_TLS), wolfssl)
  1546. $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
  1547. endif
  1548. endif
  1549. endif
  1550. OBJS += $(SHA1OBJS) $(DESOBJS)
  1551. OBJS_p += $(SHA1OBJS)
  1552. OBJS_p += $(SHA256OBJS)
  1553. OBJS_priv += $(SHA1OBJS)
  1554. ifdef CONFIG_BGSCAN_SIMPLE
  1555. CFLAGS += -DCONFIG_BGSCAN_SIMPLE
  1556. OBJS += bgscan_simple.o
  1557. NEED_BGSCAN=y
  1558. endif
  1559. ifdef CONFIG_BGSCAN_LEARN
  1560. CFLAGS += -DCONFIG_BGSCAN_LEARN
  1561. OBJS += bgscan_learn.o
  1562. NEED_BGSCAN=y
  1563. endif
  1564. ifdef NEED_BGSCAN
  1565. CFLAGS += -DCONFIG_BGSCAN
  1566. OBJS += bgscan.o
  1567. endif
  1568. ifdef CONFIG_AUTOSCAN_EXPONENTIAL
  1569. CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
  1570. OBJS += autoscan_exponential.o
  1571. NEED_AUTOSCAN=y
  1572. endif
  1573. ifdef CONFIG_AUTOSCAN_PERIODIC
  1574. CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
  1575. OBJS += autoscan_periodic.o
  1576. NEED_AUTOSCAN=y
  1577. endif
  1578. ifdef NEED_AUTOSCAN
  1579. CFLAGS += -DCONFIG_AUTOSCAN
  1580. OBJS += autoscan.o
  1581. endif
  1582. ifdef CONFIG_EXT_PASSWORD_TEST
  1583. OBJS += ../src/utils/ext_password_test.o
  1584. CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
  1585. NEED_EXT_PASSWORD=y
  1586. endif
  1587. ifdef NEED_EXT_PASSWORD
  1588. OBJS += ../src/utils/ext_password.o
  1589. CFLAGS += -DCONFIG_EXT_PASSWORD
  1590. endif
  1591. ifdef NEED_GAS_SERVER
  1592. OBJS += ../src/common/gas_server.o
  1593. CFLAGS += -DCONFIG_GAS_SERVER
  1594. NEED_GAS=y
  1595. endif
  1596. ifdef NEED_GAS
  1597. OBJS += ../src/common/gas.o
  1598. OBJS += gas_query.o
  1599. CFLAGS += -DCONFIG_GAS
  1600. NEED_OFFCHANNEL=y
  1601. endif
  1602. ifdef NEED_OFFCHANNEL
  1603. OBJS += offchannel.o
  1604. CFLAGS += -DCONFIG_OFFCHANNEL
  1605. endif
  1606. ifdef NEED_JSON
  1607. OBJS += ../src/utils/json.o
  1608. CFLAGS += -DCONFIG_JSON
  1609. endif
  1610. ifdef CONFIG_MODULE_TESTS
  1611. CFLAGS += -DCONFIG_MODULE_TESTS
  1612. OBJS += wpas_module_tests.o
  1613. OBJS += ../src/utils/utils_module_tests.o
  1614. OBJS += ../src/common/common_module_tests.o
  1615. OBJS += ../src/crypto/crypto_module_tests.o
  1616. ifdef CONFIG_WPS
  1617. OBJS += ../src/wps/wps_module_tests.o
  1618. endif
  1619. endif
  1620. OBJS += ../src/drivers/driver_common.o
  1621. OBJS_priv += ../src/drivers/driver_common.o
  1622. OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
  1623. OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
  1624. OBJS_t += ../src/radius/radius_client.o
  1625. OBJS_t += ../src/radius/radius.o
  1626. ifndef CONFIG_AP
  1627. OBJS_t += ../src/utils/ip_addr.o
  1628. endif
  1629. OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
  1630. OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
  1631. OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
  1632. OBJS += $(CONFIG_MAIN).o
  1633. ifdef CONFIG_PRIVSEP
  1634. OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
  1635. OBJS_priv += $(OBJS_l2)
  1636. OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
  1637. OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
  1638. OBJS_priv += ../src/utils/common.o
  1639. OBJS_priv += ../src/utils/wpa_debug.o
  1640. OBJS_priv += ../src/utils/wpabuf.o
  1641. OBJS_priv += wpa_priv.o
  1642. ifdef CONFIG_DRIVER_NL80211
  1643. OBJS_priv += ../src/common/ieee802_11_common.o
  1644. endif
  1645. OBJS += ../src/l2_packet/l2_packet_privsep.o
  1646. OBJS += ../src/drivers/driver_privsep.o
  1647. EXTRA_progs += wpa_priv
  1648. else
  1649. OBJS += $(OBJS_d) ../src/drivers/drivers.o
  1650. OBJS += $(OBJS_l2)
  1651. endif
  1652. ifdef CONFIG_NDIS_EVENTS_INTEGRATED
  1653. CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
  1654. OBJS += ../src/drivers/ndis_events.o
  1655. EXTRALIBS += -loleaut32 -lole32 -luuid
  1656. ifdef PLATFORMSDKLIB
  1657. EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
  1658. else
  1659. EXTRALIBS += WbemUuid.Lib
  1660. endif
  1661. endif
  1662. ifdef CONFIG_FST
  1663. CFLAGS += -DCONFIG_FST
  1664. ifdef CONFIG_FST_TEST
  1665. CFLAGS += -DCONFIG_FST_TEST
  1666. endif
  1667. FST_OBJS += ../src/fst/fst.o
  1668. FST_OBJS += ../src/fst/fst_session.o
  1669. FST_OBJS += ../src/fst/fst_iface.o
  1670. FST_OBJS += ../src/fst/fst_group.o
  1671. FST_OBJS += ../src/fst/fst_ctrl_aux.o
  1672. ifdef CONFIG_CTRL_IFACE
  1673. FST_OBJS += ../src/fst/fst_ctrl_iface.o
  1674. endif
  1675. OBJS += $(FST_OBJS)
  1676. OBJS_t += $(FST_OBJS)
  1677. OBJS_t2 += $(FST_OBJS)
  1678. OBJS_nfc += $(FST_OBJS)
  1679. endif
  1680. ifndef LDO
  1681. LDO=$(CC)
  1682. endif
  1683. Q=@
  1684. E=echo
  1685. ifeq ($(V), 1)
  1686. Q=
  1687. E=true
  1688. endif
  1689. ifeq ($(QUIET), 1)
  1690. Q=@
  1691. E=true
  1692. endif
  1693. dynamic_eap_methods: $(EAPDYN)
  1694. ../src/drivers/build.wpa_supplicant:
  1695. @if [ -f ../src/drivers/build.hostapd ]; then \
  1696. $(MAKE) -C ../src/drivers clean; \
  1697. fi
  1698. @touch ../src/drivers/build.wpa_supplicant
  1699. BCHECK=../src/drivers/build.wpa_supplicant
  1700. wpa_priv: $(BCHECK) $(OBJS_priv)
  1701. $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
  1702. @$(E) " LD " $@
  1703. $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
  1704. wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
  1705. $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
  1706. @$(E) " LD " $@
  1707. eapol_test: $(OBJS_t)
  1708. $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
  1709. @$(E) " LD " $@
  1710. preauth_test: $(OBJS_t2)
  1711. $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
  1712. @$(E) " LD " $@
  1713. wpa_passphrase: $(OBJS_p)
  1714. $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
  1715. @$(E) " LD " $@
  1716. wpa_cli: $(OBJS_c)
  1717. $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
  1718. @$(E) " LD " $@
  1719. LIBCTRL += ../src/common/wpa_ctrl.o
  1720. LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
  1721. LIBCTRL += ../src/utils/common.o
  1722. LIBCTRL += ../src/utils/wpa_debug.o
  1723. LIBCTRLSO += ../src/common/wpa_ctrl.c
  1724. LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
  1725. LIBCTRLSO += ../src/utils/common.c
  1726. LIBCTRLSO += ../src/utils/wpa_debug.c
  1727. libwpa_client.a: $(LIBCTRL)
  1728. $(Q)rm -f $@
  1729. $(Q)$(AR) crs $@ $?
  1730. @$(E) " AR " $@
  1731. libwpa_client.so: $(LIBCTRLSO)
  1732. @$(E) " CC $@ ($^)"
  1733. $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
  1734. libwpa_test1: libwpa_test.o libwpa_client.a
  1735. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
  1736. @$(E) " LD " $@
  1737. libwpa_test2: libwpa_test.o libwpa_client.so
  1738. $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
  1739. @$(E) " LD " $@
  1740. nfc_pw_token: $(OBJS_nfc)
  1741. $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
  1742. @$(E) " LD " $@
  1743. win_if_list: win_if_list.c
  1744. $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
  1745. @$(E) " LD " $@
  1746. eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
  1747. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1748. -Deap_peer_psk_register=eap_peer_method_dynamic_init
  1749. eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
  1750. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1751. -Deap_peer_pax_register=eap_peer_method_dynamic_init
  1752. eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
  1753. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1754. -Deap_peer_sake_register=eap_peer_method_dynamic_init
  1755. eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
  1756. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1757. -Deap_peer_wsc_register=eap_peer_method_dynamic_init
  1758. 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
  1759. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1760. -Deap_peer_ikev2_register=eap_peer_method_dynamic_init
  1761. eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
  1762. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
  1763. -Deap_peer_eke_register=eap_peer_method_dynamic_init
  1764. %.so: %.c
  1765. $(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
  1766. -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
  1767. ifdef CONFIG_CODE_COVERAGE
  1768. %.o: %.c
  1769. @$(E) " CC " $<
  1770. $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
  1771. else
  1772. %.o: %.c
  1773. $(Q)$(CC) -c -o $@ $(CFLAGS) $<
  1774. @$(E) " CC " $<
  1775. endif
  1776. %.service: %.service.in
  1777. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1778. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1779. @$(E) " sed" $<
  1780. %@.service: %.service.arg.in
  1781. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
  1782. -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
  1783. @$(E) " sed" $<
  1784. wpa_supplicant.exe: wpa_supplicant
  1785. mv -f $< $@
  1786. wpa_cli.exe: wpa_cli
  1787. mv -f $< $@
  1788. wpa_passphrase.exe: wpa_passphrase
  1789. mv -f $< $@
  1790. win_if_list.exe: win_if_list
  1791. mv -f $< $@
  1792. eapol_test.exe: eapol_test
  1793. mv -f $< $@
  1794. WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
  1795. windows-bin: $(WINALL)
  1796. $(STRIP) $(WINALL)
  1797. wpa_gui:
  1798. @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
  1799. wpa_gui-qt4/Makefile:
  1800. qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
  1801. wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
  1802. lrelease wpa_gui-qt4/wpa_gui.pro
  1803. wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
  1804. $(MAKE) -C wpa_gui-qt4
  1805. FIPSDIR=/usr/local/ssl/fips-2.0
  1806. FIPSLD=$(FIPSDIR)/bin/fipsld
  1807. fips:
  1808. $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
  1809. lcov-html: wpa_supplicant.gcda
  1810. lcov -c -d .. > lcov.info
  1811. genhtml lcov.info --output-directory lcov-html
  1812. clean:
  1813. $(MAKE) -C ../src clean
  1814. $(MAKE) -C dbus clean
  1815. rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
  1816. rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
  1817. rm -f wpa_priv
  1818. rm -f nfc_pw_token
  1819. rm -f lcov.info
  1820. rm -rf lcov-html
  1821. rm -f libwpa_client.a
  1822. rm -f libwpa_client.so
  1823. rm -f libwpa_test1 libwpa_test2
  1824. -include $(OBJS:%.o=%.d)