Makefile 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988
  1. ifndef CC
  2. CC=gcc
  3. endif
  4. ifndef CFLAGS
  5. CFLAGS = -MMD -O2 -Wall -g
  6. endif
  7. ifdef LIBS
  8. # If LIBS is set with some global build system defaults, clone those for
  9. # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
  10. ifndef LIBS_c
  11. LIBS_c := $(LIBS)
  12. endif
  13. ifndef LIBS_p
  14. LIBS_p := $(LIBS)
  15. endif
  16. endif
  17. export LIBDIR ?= /usr/local/lib/
  18. export INCDIR ?= /usr/local/include/
  19. export BINDIR ?= /usr/local/sbin/
  20. PKG_CONFIG ?= pkg-config
  21. CFLAGS += $(EXTRA_CFLAGS)
  22. CFLAGS += -I$(abspath ../src)
  23. CFLAGS += -I$(abspath ../src/utils)
  24. -include .config
  25. ifndef CONFIG_NO_GITVER
  26. # Add VERSION_STR postfix for builds from a git repository
  27. ifeq ($(wildcard ../.git),../.git)
  28. GITVER := $(shell git describe --dirty=+)
  29. ifneq ($(GITVER),)
  30. CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
  31. endif
  32. endif
  33. endif
  34. ifdef CONFIG_TESTING_OPTIONS
  35. CFLAGS += -DCONFIG_TESTING_OPTIONS
  36. CONFIG_WPS_TESTING=y
  37. CONFIG_TDLS_TESTING=y
  38. endif
  39. BINALL=wpa_supplicant wpa_cli
  40. ifndef CONFIG_NO_WPA_PASSPHRASE
  41. BINALL += wpa_passphrase
  42. endif
  43. ALL = $(BINALL)
  44. ALL += systemd/wpa_supplicant.service
  45. ALL += systemd/wpa_supplicant@.service
  46. ALL += systemd/wpa_supplicant-nl80211@.service
  47. ALL += systemd/wpa_supplicant-wired@.service
  48. ALL += dbus/fi.epitest.hostap.WPASupplicant.service
  49. ALL += dbus/fi.w1.wpa_supplicant1.service
  50. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  51. ALL += libwpa_client.so
  52. endif
  53. all: verify_config $(ALL) dynamic_eap_methods
  54. verify_config:
  55. @if [ ! -r .config ]; then \
  56. echo 'Building wpa_supplicant requires a configuration file'; \
  57. echo '(.config). See README for more instructions. You can'; \
  58. echo 'run "cp defconfig .config" to create an example'; \
  59. echo 'configuration.'; \
  60. exit 1; \
  61. fi
  62. mkconfig:
  63. @if [ -f .config ]; then \
  64. echo '.config exists - did not replace it'; \
  65. exit 1; \
  66. fi
  67. echo CONFIG_DRIVER_HOSTAP=y >> .config
  68. echo CONFIG_DRIVER_WEXT=y >> .config
  69. $(DESTDIR)$(BINDIR)/%: %
  70. install -D $(<) $(@)
  71. install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
  72. $(MAKE) -C ../src install
  73. ifdef CONFIG_BUILD_WPA_CLIENT_SO
  74. install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
  75. install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
  76. endif
  77. ifdef CONFIG_FIPS
  78. CONFIG_NO_RANDOM_POOL=
  79. CONFIG_OPENSSL_CMAC=y
  80. endif
  81. OBJS = config.o
  82. OBJS += notify.o
  83. OBJS += bss.o
  84. OBJS += eap_register.o
  85. OBJS += ../src/utils/common.o
  86. OBJS += ../src/utils/wpa_debug.o
  87. OBJS += ../src/utils/wpabuf.o
  88. OBJS += ../src/utils/bitfield.o
  89. OBJS += op_classes.o
  90. OBJS += rrm.o
  91. OBJS_p = wpa_passphrase.o
  92. OBJS_p += ../src/utils/common.o
  93. OBJS_p += ../src/utils/wpa_debug.o
  94. OBJS_p += ../src/utils/wpabuf.o
  95. OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
  96. OBJS_c += ../src/utils/wpa_debug.o
  97. OBJS_c += ../src/utils/common.o
  98. OBJS_c += ../src/common/cli.o
  99. OBJS += wmm_ac.o
  100. ifndef CONFIG_OS
  101. ifdef CONFIG_NATIVE_WINDOWS
  102. CONFIG_OS=win32
  103. else
  104. CONFIG_OS=unix
  105. endif
  106. endif
  107. ifeq ($(CONFIG_OS), internal)
  108. CFLAGS += -DOS_NO_C_LIB_DEFINES
  109. endif
  110. OBJS += ../src/utils/os_$(CONFIG_OS).o
  111. OBJS_p += ../src/utils/os_$(CONFIG_OS).o
  112. OBJS_c += ../src/utils/os_$(CONFIG_OS).o
  113. ifdef CONFIG_WPA_TRACE
  114. CFLAGS += -DWPA_TRACE
  115. OBJS += ../src/utils/trace.o
  116. OBJS_p += ../src/utils/trace.o
  117. OBJS_c += ../src/utils/trace.o
  118. OBJS_priv += ../src/utils/trace.o
  119. LIBCTRL += ../src/utils/trace.o
  120. LIBCTRLSO += ../src/utils/trace.c
  121. LDFLAGS += -rdynamic
  122. CFLAGS += -funwind-tables
  123. ifdef CONFIG_WPA_TRACE_BFD
  124. CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
  125. LIBS += -lbfd -ldl -liberty -lz
  126. LIBS_p += -lbfd -ldl -liberty -lz
  127. LIBS_c += -lbfd -ldl -liberty -lz
  128. endif
  129. endif
  130. ifndef CONFIG_ELOOP
  131. CONFIG_ELOOP=eloop
  132. endif
  133. OBJS += ../src/utils/$(CONFIG_ELOOP).o
  134. OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
  135. ifndef CONFIG_OSX
  136. ifeq ($(CONFIG_ELOOP), eloop)
  137. # Using glibc < 2.17 requires -lrt for clock_gettime()
  138. # OS X has an alternate implementation
  139. LIBS += -lrt
  140. LIBS_c += -lrt
  141. LIBS_p += -lrt
  142. endif
  143. endif
  144. ifdef CONFIG_ELOOP_POLL
  145. CFLAGS += -DCONFIG_ELOOP_POLL
  146. endif
  147. ifdef CONFIG_ELOOP_EPOLL
  148. CFLAGS += -DCONFIG_ELOOP_EPOLL
  149. endif
  150. ifdef CONFIG_ELOOP_KQUEUE
  151. CFLAGS += -DCONFIG_ELOOP_KQUEUE
  152. endif
  153. ifdef CONFIG_EAPOL_TEST
  154. CFLAGS += -Werror -DEAPOL_TEST
  155. endif
  156. ifdef CONFIG_CODE_COVERAGE
  157. CFLAGS += -O0 -fprofile-arcs -ftest-coverage
  158. LIBS += -lgcov
  159. LIBS_c += -lgcov
  160. LIBS_p += -lgcov
  161. endif
  162. ifdef CONFIG_HT_OVERRIDES
  163. CFLAGS += -DCONFIG_HT_OVERRIDES
  164. endif
  165. ifdef CONFIG_VHT_OVERRIDES
  166. CFLAGS += -DCONFIG_VHT_OVERRIDES
  167. endif
  168. ifndef CONFIG_BACKEND
  169. CONFIG_BACKEND=file
  170. endif
  171. ifeq ($(CONFIG_BACKEND), file)
  172. OBJS += config_file.o
  173. ifndef CONFIG_NO_CONFIG_BLOBS
  174. NEED_BASE64=y
  175. endif
  176. CFLAGS += -DCONFIG_BACKEND_FILE
  177. endif
  178. ifeq ($(CONFIG_BACKEND), winreg)
  179. OBJS += config_winreg.o
  180. endif
  181. ifeq ($(CONFIG_BACKEND), none)
  182. OBJS += config_none.o
  183. endif
  184. ifdef CONFIG_NO_CONFIG_WRITE
  185. CFLAGS += -DCONFIG_NO_CONFIG_WRITE
  186. endif
  187. ifdef CONFIG_NO_CONFIG_BLOBS
  188. CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
  189. endif
  190. ifdef CONFIG_NO_SCAN_PROCESSING
  191. CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
  192. endif
  193. ifdef CONFIG_SUITEB
  194. CFLAGS += -DCONFIG_SUITEB
  195. NEED_SHA256=y
  196. NEED_AES_OMAC1=y
  197. endif
  198. ifdef CONFIG_SUITEB192
  199. CFLAGS += -DCONFIG_SUITEB192
  200. NEED_SHA384=y
  201. endif
  202. ifdef CONFIG_IEEE80211W
  203. CFLAGS += -DCONFIG_IEEE80211W
  204. NEED_SHA256=y
  205. NEED_AES_OMAC1=y
  206. endif
  207. ifdef CONFIG_IEEE80211R_AP
  208. CONFIG_IEEE80211R=y
  209. endif
  210. ifdef CONFIG_IEEE80211R
  211. CFLAGS += -DCONFIG_IEEE80211R
  212. OBJS += ../src/rsn_supp/wpa_ft.o
  213. NEED_SHA256=y
  214. NEED_AES_OMAC1=y
  215. endif
  216. ifdef CONFIG_MESH
  217. NEED_80211_COMMON=y
  218. NEED_SHA256=y
  219. NEED_AES_SIV=y
  220. CONFIG_SAE=y
  221. CONFIG_AP=y
  222. CFLAGS += -DCONFIG_MESH
  223. OBJS += mesh.o
  224. OBJS += mesh_mpm.o
  225. OBJS += mesh_rsn.o
  226. endif
  227. ifdef CONFIG_SAE
  228. CFLAGS += -DCONFIG_SAE
  229. OBJS += ../src/common/sae.o
  230. NEED_ECC=y
  231. NEED_DH_GROUPS=y
  232. endif
  233. ifdef CONFIG_DPP
  234. CFLAGS += -DCONFIG_DPP
  235. OBJS += ../src/common/dpp.o
  236. OBJS += dpp_supplicant.o
  237. NEED_AES_SIV=y
  238. NEED_HMAC_SHA256_KDF=y
  239. NEED_HMAC_SHA384_KDF=y
  240. NEED_HMAC_SHA512_KDF=y
  241. NEED_SHA256=y
  242. NEED_SHA384=y
  243. NEED_SHA512=y
  244. NEED_JSON=y
  245. NEED_GAS_SERVER=y
  246. NEED_BASE64=y
  247. endif
  248. ifdef CONFIG_OWE
  249. CFLAGS += -DCONFIG_OWE
  250. NEED_ECC=y
  251. NEED_HMAC_SHA256_KDF=y
  252. NEED_HMAC_SHA384_KDF=y
  253. NEED_HMAC_SHA512_KDF=y
  254. NEED_SHA256=y
  255. NEED_SHA384=y
  256. NEED_SHA512=y
  257. endif
  258. ifdef CONFIG_FILS
  259. CFLAGS += -DCONFIG_FILS
  260. NEED_SHA384=y
  261. NEED_AES_SIV=y
  262. ifdef CONFIG_FILS_SK_PFS
  263. CFLAGS += -DCONFIG_FILS_SK_PFS
  264. NEED_ECC=y
  265. endif
  266. endif
  267. ifdef CONFIG_MBO
  268. CONFIG_WNM=y
  269. endif
  270. ifdef CONFIG_WNM
  271. CFLAGS += -DCONFIG_WNM
  272. OBJS += wnm_sta.o
  273. endif
  274. ifdef CONFIG_TDLS
  275. CFLAGS += -DCONFIG_TDLS
  276. OBJS += ../src/rsn_supp/tdls.o
  277. NEED_SHA256=y
  278. NEED_AES_OMAC1=y
  279. endif
  280. ifdef CONFIG_TDLS_TESTING
  281. CFLAGS += -DCONFIG_TDLS_TESTING
  282. endif
  283. ifdef CONFIG_PMKSA_CACHE_EXTERNAL
  284. CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
  285. endif
  286. ifndef CONFIG_NO_WPA
  287. OBJS += ../src/rsn_supp/wpa.o
  288. OBJS += ../src/rsn_supp/preauth.o
  289. OBJS += ../src/rsn_supp/pmksa_cache.o
  290. OBJS += ../src/rsn_supp/wpa_ie.o
  291. OBJS += ../src/common/wpa_common.o
  292. NEED_AES=y
  293. NEED_SHA1=y
  294. NEED_MD5=y
  295. NEED_RC4=y
  296. else
  297. CFLAGS += -DCONFIG_NO_WPA
  298. ifeq ($(CONFIG_TLS), internal)
  299. NEED_SHA1=y
  300. NEED_MD5=y
  301. endif
  302. endif
  303. ifdef CONFIG_IBSS_RSN
  304. NEED_RSN_AUTHENTICATOR=y
  305. CFLAGS += -DCONFIG_IBSS_RSN
  306. CFLAGS += -DCONFIG_NO_VLAN
  307. OBJS += ibss_rsn.o
  308. endif
  309. ifdef CONFIG_MATCH_IFACE
  310. CFLAGS += -DCONFIG_MATCH_IFACE
  311. endif
  312. ifdef CONFIG_P2P
  313. OBJS += p2p_supplicant.o
  314. OBJS += p2p_supplicant_sd.o
  315. OBJS += ../src/p2p/p2p.o
  316. OBJS += ../src/p2p/p2p_utils.o
  317. OBJS += ../src/p2p/p2p_parse.o
  318. OBJS += ../src/p2p/p2p_build.o
  319. OBJS += ../src/p2p/p2p_go_neg.o
  320. OBJS += ../src/p2p/p2p_sd.o
  321. OBJS += ../src/p2p/p2p_pd.o
  322. OBJS += ../src/p2p/p2p_invitation.o
  323. OBJS += ../src/p2p/p2p_dev_disc.o
  324. OBJS += ../src/p2p/p2p_group.o
  325. OBJS += ../src/ap/p2p_hostapd.o
  326. CFLAGS += -DCONFIG_P2P
  327. NEED_GAS=y
  328. NEED_OFFCHANNEL=y
  329. CONFIG_WPS=y
  330. CONFIG_AP=y
  331. ifdef CONFIG_P2P_STRICT
  332. CFLAGS += -DCONFIG_P2P_STRICT
  333. endif
  334. endif
  335. ifdef CONFIG_WIFI_DISPLAY
  336. CFLAGS += -DCONFIG_WIFI_DISPLAY
  337. OBJS += wifi_display.o
  338. endif
  339. ifdef CONFIG_HS20
  340. OBJS += hs20_supplicant.o
  341. CFLAGS += -DCONFIG_HS20
  342. CONFIG_INTERWORKING=y
  343. NEED_AES_OMAC1=y
  344. endif
  345. ifdef CONFIG_INTERWORKING
  346. OBJS += interworking.o
  347. CFLAGS += -DCONFIG_INTERWORKING
  348. NEED_GAS=y
  349. endif
  350. ifdef CONFIG_NO_ROAMING
  351. CFLAGS += -DCONFIG_NO_ROAMING
  352. endif
  353. include ../src/drivers/drivers.mak
  354. ifdef CONFIG_AP
  355. OBJS_d += $(DRV_BOTH_OBJS)
  356. CFLAGS += $(DRV_BOTH_CFLAGS)
  357. LDFLAGS += $(DRV_BOTH_LDFLAGS)
  358. LIBS += $(DRV_BOTH_LIBS)
  359. else
  360. NEED_AP_MLME=
  361. OBJS_d += $(DRV_WPA_OBJS)
  362. CFLAGS += $(DRV_WPA_CFLAGS)
  363. LDFLAGS += $(DRV_WPA_LDFLAGS)
  364. LIBS += $(DRV_WPA_LIBS)
  365. endif
  366. ifndef CONFIG_L2_PACKET
  367. CONFIG_L2_PACKET=linux
  368. endif
  369. OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
  370. ifeq ($(CONFIG_L2_PACKET), pcap)
  371. ifdef CONFIG_WINPCAP
  372. CFLAGS += -DCONFIG_WINPCAP
  373. LIBS += -lwpcap -lpacket
  374. LIBS_w += -lwpcap
  375. else
  376. LIBS += -ldnet -lpcap
  377. endif
  378. endif
  379. ifeq ($(CONFIG_L2_PACKET), winpcap)
  380. LIBS += -lwpcap -lpacket
  381. LIBS_w += -lwpcap
  382. endif
  383. ifeq ($(CONFIG_L2_PACKET), freebsd)
  384. LIBS += -lpcap
  385. endif
  386. ifdef CONFIG_ERP
  387. CFLAGS += -DCONFIG_ERP
  388. NEED_SHA256=y
  389. NEED_HMAC_SHA256_KDF=y
  390. endif
  391. ifdef CONFIG_EAP_TLS
  392. # EAP-TLS
  393. ifeq ($(CONFIG_EAP_TLS), dyn)
  394. CFLAGS += -DEAP_TLS_DYNAMIC
  395. EAPDYN += ../src/eap_peer/eap_tls.so
  396. else
  397. CFLAGS += -DEAP_TLS
  398. OBJS += ../src/eap_peer/eap_tls.o
  399. endif
  400. TLS_FUNCS=y
  401. CONFIG_IEEE8021X_EAPOL=y
  402. endif
  403. ifdef CONFIG_EAP_UNAUTH_TLS
  404. # EAP-UNAUTH-TLS
  405. CFLAGS += -DEAP_UNAUTH_TLS
  406. ifndef CONFIG_EAP_TLS
  407. OBJS += ../src/eap_peer/eap_tls.o
  408. TLS_FUNCS=y
  409. endif
  410. CONFIG_IEEE8021X_EAPOL=y
  411. endif
  412. ifdef CONFIG_EAP_PEAP
  413. # EAP-PEAP
  414. ifeq ($(CONFIG_EAP_PEAP), dyn)
  415. CFLAGS += -DEAP_PEAP_DYNAMIC
  416. EAPDYN += ../src/eap_peer/eap_peap.so
  417. else
  418. CFLAGS += -DEAP_PEAP
  419. OBJS += ../src/eap_peer/eap_peap.o
  420. OBJS += ../src/eap_common/eap_peap_common.o
  421. endif
  422. TLS_FUNCS=y
  423. CONFIG_IEEE8021X_EAPOL=y
  424. endif
  425. ifdef CONFIG_EAP_TTLS
  426. # EAP-TTLS
  427. ifeq ($(CONFIG_EAP_TTLS), dyn)
  428. CFLAGS += -DEAP_TTLS_DYNAMIC
  429. EAPDYN += ../src/eap_peer/eap_ttls.so
  430. else
  431. CFLAGS += -DEAP_TTLS
  432. OBJS += ../src/eap_peer/eap_ttls.o
  433. endif
  434. TLS_FUNCS=y
  435. ifndef CONFIG_FIPS
  436. MS_FUNCS=y
  437. CHAP=y
  438. endif
  439. CONFIG_IEEE8021X_EAPOL=y
  440. endif
  441. ifdef CONFIG_EAP_MD5
  442. # EAP-MD5
  443. ifeq ($(CONFIG_EAP_MD5), dyn)
  444. CFLAGS += -DEAP_MD5_DYNAMIC
  445. EAPDYN += ../src/eap_peer/eap_md5.so
  446. else
  447. CFLAGS += -DEAP_MD5
  448. OBJS += ../src/eap_peer/eap_md5.o
  449. endif
  450. CHAP=y
  451. CONFIG_IEEE8021X_EAPOL=y
  452. endif
  453. # backwards compatibility for old spelling
  454. ifdef CONFIG_MSCHAPV2
  455. ifndef CONFIG_EAP_MSCHAPV2
  456. CONFIG_EAP_MSCHAPV2=y
  457. endif
  458. endif
  459. ifdef CONFIG_EAP_MSCHAPV2
  460. # EAP-MSCHAPv2
  461. ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
  462. CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
  463. EAPDYN += ../src/eap_peer/eap_mschapv2.so
  464. EAPDYN += ../src/eap_peer/mschapv2.so
  465. else
  466. CFLAGS += -DEAP_MSCHAPv2
  467. OBJS += ../src/eap_peer/eap_mschapv2.o
  468. OBJS += ../src/eap_peer/mschapv2.o
  469. endif
  470. MS_FUNCS=y
  471. CONFIG_IEEE8021X_EAPOL=y
  472. endif
  473. ifdef CONFIG_EAP_GTC
  474. # EAP-GTC
  475. ifeq ($(CONFIG_EAP_GTC), dyn)
  476. CFLAGS += -DEAP_GTC_DYNAMIC
  477. EAPDYN += ../src/eap_peer/eap_gtc.so
  478. else
  479. CFLAGS += -DEAP_GTC
  480. OBJS += ../src/eap_peer/eap_gtc.o
  481. endif
  482. CONFIG_IEEE8021X_EAPOL=y
  483. endif
  484. ifdef CONFIG_EAP_OTP
  485. # EAP-OTP
  486. ifeq ($(CONFIG_EAP_OTP), dyn)
  487. CFLAGS += -DEAP_OTP_DYNAMIC
  488. EAPDYN += ../src/eap_peer/eap_otp.so
  489. else
  490. CFLAGS += -DEAP_OTP
  491. OBJS += ../src/eap_peer/eap_otp.o
  492. endif
  493. CONFIG_IEEE8021X_EAPOL=y
  494. endif
  495. ifdef CONFIG_EAP_SIM
  496. # EAP-SIM
  497. ifeq ($(CONFIG_EAP_SIM), dyn)
  498. CFLAGS += -DEAP_SIM_DYNAMIC
  499. EAPDYN += ../src/eap_peer/eap_sim.so
  500. else
  501. CFLAGS += -DEAP_SIM
  502. OBJS += ../src/eap_peer/eap_sim.o
  503. endif
  504. CONFIG_IEEE8021X_EAPOL=y
  505. CONFIG_EAP_SIM_COMMON=y
  506. NEED_AES_CBC=y
  507. endif
  508. ifdef CONFIG_EAP_LEAP
  509. # EAP-LEAP
  510. ifeq ($(CONFIG_EAP_LEAP), dyn)
  511. CFLAGS += -DEAP_LEAP_DYNAMIC
  512. EAPDYN += ../src/eap_peer/eap_leap.so
  513. else
  514. CFLAGS += -DEAP_LEAP
  515. OBJS += ../src/eap_peer/eap_leap.o
  516. endif
  517. MS_FUNCS=y
  518. CONFIG_IEEE8021X_EAPOL=y
  519. endif
  520. ifdef CONFIG_EAP_PSK
  521. # EAP-PSK
  522. ifeq ($(CONFIG_EAP_PSK), dyn)
  523. CFLAGS += -DEAP_PSK_DYNAMIC
  524. EAPDYN += ../src/eap_peer/eap_psk.so
  525. else
  526. CFLAGS += -DEAP_PSK
  527. OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
  528. endif
  529. CONFIG_IEEE8021X_EAPOL=y
  530. NEED_AES=y
  531. NEED_AES_OMAC1=y
  532. NEED_AES_ENCBLOCK=y
  533. NEED_AES_EAX=y
  534. endif
  535. ifdef CONFIG_EAP_AKA
  536. # EAP-AKA
  537. ifeq ($(CONFIG_EAP_AKA), dyn)
  538. CFLAGS += -DEAP_AKA_DYNAMIC
  539. EAPDYN += ../src/eap_peer/eap_aka.so
  540. else
  541. CFLAGS += -DEAP_AKA
  542. OBJS += ../src/eap_peer/eap_aka.o
  543. endif
  544. CONFIG_IEEE8021X_EAPOL=y
  545. CONFIG_EAP_SIM_COMMON=y
  546. NEED_AES_CBC=y
  547. endif
  548. ifdef CONFIG_EAP_PROXY
  549. CFLAGS += -DCONFIG_EAP_PROXY
  550. OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
  551. include eap_proxy_$(CONFIG_EAP_PROXY).mak
  552. CONFIG_IEEE8021X_EAPOL=y
  553. endif
  554. ifdef CONFIG_EAP_AKA_PRIME
  555. # EAP-AKA'
  556. ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
  557. CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
  558. else
  559. CFLAGS += -DEAP_AKA_PRIME
  560. endif
  561. NEED_SHA256=y
  562. endif
  563. ifdef CONFIG_EAP_SIM_COMMON
  564. OBJS += ../src/eap_common/eap_sim_common.o
  565. NEED_AES=y
  566. NEED_FIPS186_2_PRF=y
  567. endif
  568. ifdef CONFIG_EAP_FAST
  569. # EAP-FAST
  570. ifeq ($(CONFIG_EAP_FAST), dyn)
  571. CFLAGS += -DEAP_FAST_DYNAMIC
  572. EAPDYN += ../src/eap_peer/eap_fast.so
  573. EAPDYN += ../src/eap_common/eap_fast_common.o
  574. else
  575. CFLAGS += -DEAP_FAST
  576. OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
  577. OBJS += ../src/eap_common/eap_fast_common.o
  578. endif
  579. TLS_FUNCS=y
  580. CONFIG_IEEE8021X_EAPOL=y
  581. NEED_T_PRF=y
  582. endif
  583. ifdef CONFIG_EAP_PAX
  584. # EAP-PAX
  585. ifeq ($(CONFIG_EAP_PAX), dyn)
  586. CFLAGS += -DEAP_PAX_DYNAMIC
  587. EAPDYN += ../src/eap_peer/eap_pax.so
  588. else
  589. CFLAGS += -DEAP_PAX
  590. OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
  591. endif
  592. CONFIG_IEEE8021X_EAPOL=y
  593. endif
  594. ifdef CONFIG_EAP_SAKE
  595. # EAP-SAKE
  596. ifeq ($(CONFIG_EAP_SAKE), dyn)
  597. CFLAGS += -DEAP_SAKE_DYNAMIC
  598. EAPDYN += ../src/eap_peer/eap_sake.so
  599. else
  600. CFLAGS += -DEAP_SAKE
  601. OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
  602. endif
  603. CONFIG_IEEE8021X_EAPOL=y
  604. endif
  605. ifdef CONFIG_EAP_GPSK
  606. # EAP-GPSK
  607. ifeq ($(CONFIG_EAP_GPSK), dyn)
  608. CFLAGS += -DEAP_GPSK_DYNAMIC
  609. EAPDYN += ../src/eap_peer/eap_gpsk.so
  610. else
  611. CFLAGS += -DEAP_GPSK
  612. OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
  613. endif
  614. CONFIG_IEEE8021X_EAPOL=y
  615. ifdef CONFIG_EAP_GPSK_SHA256
  616. CFLAGS += -DEAP_GPSK_SHA256
  617. endif
  618. NEED_SHA256=y
  619. NEED_AES_OMAC1=y
  620. endif
  621. ifdef CONFIG_EAP_PWD
  622. CFLAGS += -DEAP_PWD
  623. OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
  624. CONFIG_IEEE8021X_EAPOL=y
  625. NEED_SHA256=y
  626. endif
  627. ifdef CONFIG_EAP_EKE
  628. # EAP-EKE
  629. ifeq ($(CONFIG_EAP_EKE), dyn)
  630. CFLAGS += -DEAP_EKE_DYNAMIC
  631. EAPDYN += ../src/eap_peer/eap_eke.so
  632. else
  633. CFLAGS += -DEAP_EKE
  634. OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
  635. endif
  636. CONFIG_IEEE8021X_EAPOL=y
  637. NEED_DH_GROUPS=y
  638. NEED_DH_GROUPS_ALL=y
  639. NEED_SHA256=y
  640. NEED_AES_CBC=y
  641. endif
  642. ifdef CONFIG_WPS
  643. # EAP-WSC
  644. CFLAGS += -DCONFIG_WPS -DEAP_WSC
  645. OBJS += wps_supplicant.o
  646. OBJS += ../src/utils/uuid.o
  647. OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
  648. OBJS += ../src/wps/wps.o
  649. OBJS += ../src/wps/wps_common.o
  650. OBJS += ../src/wps/wps_attr_parse.o
  651. OBJS += ../src/wps/wps_attr_build.o
  652. OBJS += ../src/wps/wps_attr_process.o
  653. OBJS += ../src/wps/wps_dev_attr.o
  654. OBJS += ../src/wps/wps_enrollee.o
  655. OBJS += ../src/wps/wps_registrar.o
  656. CONFIG_IEEE8021X_EAPOL=y
  657. NEED_DH_GROUPS=y
  658. NEED_SHA256=y
  659. NEED_BASE64=y
  660. NEED_AES_CBC=y
  661. NEED_MODEXP=y
  662. ifdef CONFIG_WPS_NFC
  663. CFLAGS += -DCONFIG_WPS_NFC
  664. OBJS += ../src/wps/ndef.o
  665. NEED_WPS_OOB=y
  666. endif
  667. ifdef NEED_WPS_OOB
  668. CFLAGS += -DCONFIG_WPS_OOB
  669. endif
  670. ifdef CONFIG_WPS_ER
  671. CONFIG_WPS_UPNP=y
  672. CFLAGS += -DCONFIG_WPS_ER
  673. OBJS += ../src/wps/wps_er.o
  674. OBJS += ../src/wps/wps_er_ssdp.o
  675. endif
  676. ifdef CONFIG_WPS_UPNP
  677. CFLAGS += -DCONFIG_WPS_UPNP
  678. OBJS += ../src/wps/wps_upnp.o
  679. OBJS += ../src/wps/wps_upnp_ssdp.o
  680. OBJS += ../src/wps/wps_upnp_web.o
  681. OBJS += ../src/wps/wps_upnp_event.o
  682. OBJS += ../src/wps/wps_upnp_ap.o
  683. OBJS += ../src/wps/upnp_xml.o
  684. OBJS += ../src/wps/httpread.o
  685. OBJS += ../src/wps/http_client.o
  686. OBJS += ../src/wps/http_server.o
  687. endif
  688. ifdef CONFIG_WPS_STRICT
  689. CFLAGS += -DCONFIG_WPS_STRICT
  690. OBJS += ../src/wps/wps_validate.o
  691. endif
  692. ifdef CONFIG_WPS_TESTING
  693. CFLAGS += -DCONFIG_WPS_TESTING
  694. endif
  695. ifdef CONFIG_WPS_REG_DISABLE_OPEN
  696. CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
  697. endif
  698. endif
  699. ifdef CONFIG_EAP_IKEV2
  700. # EAP-IKEv2
  701. ifeq ($(CONFIG_EAP_IKEV2), dyn)
  702. CFLAGS += -DEAP_IKEV2_DYNAMIC
  703. EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
  704. EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  705. else
  706. CFLAGS += -DEAP_IKEV2
  707. OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
  708. OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
  709. endif
  710. CONFIG_IEEE8021X_EAPOL=y
  711. NEED_DH_GROUPS=y
  712. NEED_DH_GROUPS_ALL=y
  713. NEED_MODEXP=y
  714. NEED_CIPHER=y
  715. endif
  716. ifdef CONFIG_EAP_VENDOR_TEST
  717. ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
  718. CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
  719. EAPDYN += ../src/eap_peer/eap_vendor_test.so
  720. else
  721. CFLAGS += -DEAP_VENDOR_TEST
  722. OBJS += ../src/eap_peer/eap_vendor_test.o
  723. endif
  724. CONFIG_IEEE8021X_EAPOL=y
  725. endif
  726. ifdef CONFIG_EAP_TNC
  727. # EAP-TNC
  728. CFLAGS += -DEAP_TNC
  729. OBJS += ../src/eap_peer/eap_tnc.o
  730. OBJS += ../src/eap_peer/tncc.o
  731. NEED_BASE64=y
  732. ifndef CONFIG_NATIVE_WINDOWS
  733. ifndef CONFIG_DRIVER_BSD
  734. LIBS += -ldl
  735. endif
  736. endif
  737. endif
  738. ifdef CONFIG_MACSEC
  739. CFLAGS += -DCONFIG_MACSEC
  740. CONFIG_IEEE8021X_EAPOL=y
  741. NEED_AES_ENCBLOCK=y
  742. NEED_AES_UNWRAP=y
  743. NEED_AES_WRAP=y
  744. NEED_AES_OMAC1=y
  745. OBJS += wpas_kay.o
  746. OBJS += ../src/pae/ieee802_1x_cp.o
  747. OBJS += ../src/pae/ieee802_1x_kay.o
  748. OBJS += ../src/pae/ieee802_1x_key.o
  749. OBJS += ../src/pae/ieee802_1x_secy_ops.o
  750. endif
  751. ifdef CONFIG_IEEE8021X_EAPOL
  752. # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
  753. CFLAGS += -DIEEE8021X_EAPOL
  754. OBJS += ../src/eapol_supp/eapol_supp_sm.o
  755. OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
  756. NEED_EAP_COMMON=y
  757. ifdef CONFIG_DYNAMIC_EAP_METHODS
  758. CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
  759. LIBS += -ldl -rdynamic
  760. endif
  761. endif
  762. ifdef CONFIG_AP
  763. NEED_EAP_COMMON=y
  764. NEED_RSN_AUTHENTICATOR=y
  765. CFLAGS += -DCONFIG_AP
  766. OBJS += ap.o
  767. CFLAGS += -DCONFIG_NO_RADIUS
  768. CFLAGS += -DCONFIG_NO_ACCOUNTING
  769. CFLAGS += -DCONFIG_NO_VLAN
  770. OBJS += ../src/ap/hostapd.o
  771. OBJS += ../src/ap/wpa_auth_glue.o
  772. OBJS += ../src/ap/utils.o
  773. OBJS += ../src/ap/authsrv.o
  774. OBJS += ../src/ap/ap_config.o
  775. OBJS += ../src/utils/ip_addr.o
  776. OBJS += ../src/ap/sta_info.o
  777. OBJS += ../src/ap/tkip_countermeasures.o
  778. OBJS += ../src/ap/ap_mlme.o
  779. OBJS += ../src/ap/ieee802_1x.o
  780. OBJS += ../src/eapol_auth/eapol_auth_sm.o
  781. OBJS += ../src/ap/ieee802_11_auth.o
  782. OBJS += ../src/ap/ieee802_11_shared.o
  783. OBJS += ../src/ap/drv_callbacks.o
  784. OBJS += ../src/ap/ap_drv_ops.o
  785. OBJS += ../src/ap/beacon.o
  786. OBJS += ../src/ap/bss_load.o
  787. OBJS += ../src/ap/eap_user_db.o
  788. OBJS += ../src/ap/neighbor_db.o
  789. OBJS += ../src/ap/rrm.o
  790. ifdef CONFIG_IEEE80211N
  791. OBJS += ../src/ap/ieee802_11_ht.o
  792. ifdef CONFIG_IEEE80211AC
  793. OBJS += ../src/ap/ieee802_11_vht.o
  794. endif
  795. ifdef CONFIG_IEEE80211AX
  796. OBJS += ../src/ap/ieee802_11_he.o
  797. endif
  798. endif
  799. ifdef CONFIG_WNM_AP
  800. CFLAGS += -DCONFIG_WNM_AP
  801. OBJS += ../src/ap/wnm_ap.o
  802. endif
  803. ifdef CONFIG_MBO
  804. OBJS += ../src/ap/mbo_ap.o
  805. endif
  806. ifdef CONFIG_FILS
  807. OBJS += ../src/ap/fils_hlp.o
  808. endif
  809. ifdef CONFIG_CTRL_IFACE
  810. OBJS += ../src/ap/ctrl_iface_ap.o
  811. endif
  812. CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
  813. OBJS += ../src/eap_server/eap_server.o
  814. OBJS += ../src/eap_server/eap_server_identity.o
  815. OBJS += ../src/eap_server/eap_server_methods.o
  816. ifdef CONFIG_IEEE80211N
  817. CFLAGS += -DCONFIG_IEEE80211N
  818. ifdef CONFIG_IEEE80211AC
  819. CFLAGS += -DCONFIG_IEEE80211AC
  820. endif
  821. ifdef CONFIG_IEEE80211AX
  822. CFLAGS += -DCONFIG_IEEE80211AX
  823. endif
  824. endif
  825. ifdef NEED_AP_MLME
  826. OBJS += ../src/ap/wmm.o
  827. OBJS += ../src/ap/ap_list.o
  828. OBJS += ../src/ap/ieee802_11.o
  829. OBJS += ../src/ap/hw_features.o
  830. OBJS += ../src/ap/dfs.o
  831. CFLAGS += -DNEED_AP_MLME
  832. endif
  833. ifdef CONFIG_WPS
  834. CFLAGS += -DEAP_SERVER_WSC
  835. OBJS += ../src/ap/wps_hostapd.o
  836. OBJS += ../src/eap_server/eap_server_wsc.o
  837. endif
  838. ifdef CONFIG_DPP
  839. OBJS += ../src/ap/dpp_hostapd.o
  840. OBJS += ../src/ap/gas_query_ap.o
  841. endif
  842. ifdef CONFIG_INTERWORKING
  843. OBJS += ../src/ap/gas_serv.o
  844. endif
  845. ifdef CONFIG_HS20
  846. OBJS += ../src/ap/hs20.o
  847. endif
  848. endif
  849. ifdef CONFIG_MBO
  850. OBJS += mbo.o
  851. CFLAGS += -DCONFIG_MBO
  852. endif
  853. ifdef NEED_RSN_AUTHENTICATOR
  854. CFLAGS += -DCONFIG_NO_RADIUS
  855. NEED_AES_WRAP=y
  856. OBJS += ../src/ap/wpa_auth.o
  857. OBJS += ../src/ap/wpa_auth_ie.o
  858. OBJS += ../src/ap/pmksa_cache_auth.o
  859. ifdef CONFIG_IEEE80211R_AP
  860. CFLAGS += -DCONFIG_IEEE80211R_AP
  861. OBJS += ../src/ap/wpa_auth_ft.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)