xref: /freebsd/contrib/wpa/wpa_supplicant/Makefile (revision a90b9d0159070121c221b966469c3e36d912bf82)
1BINALL=wpa_supplicant wpa_cli
2
3ALL = $(BINALL)
4ALL += systemd/wpa_supplicant.service
5ALL += systemd/wpa_supplicant@.service
6ALL += systemd/wpa_supplicant-nl80211@.service
7ALL += systemd/wpa_supplicant-wired@.service
8ALL += dbus/fi.w1.wpa_supplicant1.service
9
10EXTRA_TARGETS=dynamic_eap_methods
11
12CONFIG_FILE=.config
13include ../src/build.rules
14
15ifdef CONFIG_BUILD_PASN_SO
16# add the dependency this way to allow CONFIG_BUILD_PASN_SO
17# being set in the config which is read by build.rules
18_all: libpasn.so
19endif
20
21ifdef CONFIG_BUILD_WPA_CLIENT_SO
22# add the dependency this way to allow CONFIG_BUILD_WPA_CLIENT_SO
23# being set in the config which is read by build.rules
24_all: libwpa_client.so
25endif
26
27ifndef CONFIG_NO_WPA_PASSPHRASE
28# add the dependency this way to allow CONFIG_NO_WPA_PASSPHRASE
29# being set in the config which is read by build.rules
30_all: wpa_passphrase
31endif
32
33ifdef LIBS
34# If LIBS is set with some global build system defaults, clone those for
35# LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
36ifndef LIBS_c
37LIBS_c := $(LIBS)
38endif
39ifndef LIBS_p
40LIBS_p := $(LIBS)
41endif
42endif
43
44export LIBDIR ?= /usr/local/lib
45export INCDIR ?= /usr/local/include
46export BINDIR ?= /usr/local/sbin
47PKG_CONFIG ?= pkg-config
48
49CFLAGS += $(EXTRA_CFLAGS)
50CFLAGS += -I$(abspath ../src)
51CFLAGS += -I$(abspath ../src/utils)
52
53ifndef CONFIG_NO_GITVER
54# Add VERSION_STR postfix for builds from a git repository
55ifeq ($(wildcard ../.git),../.git)
56GITVER := $(shell git describe --dirty=+)
57ifneq ($(GITVER),)
58CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
59endif
60endif
61endif
62
63ifdef CONFIG_TESTING_OPTIONS
64CFLAGS += -DCONFIG_TESTING_OPTIONS
65CONFIG_WPS_TESTING=y
66CONFIG_TDLS_TESTING=y
67NEED_AES_WRAP=y
68endif
69
70mkconfig:
71	@if [ -f .config ]; then \
72		echo '.config exists - did not replace it'; \
73		exit 1; \
74	fi
75	echo CONFIG_DRIVER_HOSTAP=y >> .config
76	echo CONFIG_DRIVER_WEXT=y >> .config
77
78$(DESTDIR)$(BINDIR)/%: %
79	install -D $(<) $(@)
80
81install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
82	$(MAKE) -C ../src install
83ifndef CONFIG_NO_WPA_PASSPHRASE
84	install -D wpa_passphrase $(DESTDIR)/$(BINDIR)/wpa_passphrase
85endif
86
87ifdef CONFIG_BUILD_PASN_SO
88	install -m 0644 -D libpasn.so $(DESTDIR)/$(LIBDIR)/libpasn.so
89endif
90
91ifdef CONFIG_BUILD_WPA_CLIENT_SO
92	install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
93	install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
94endif
95	if ls eap_*.so >/dev/null 2>&1; then \
96		install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
97		cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
98	; fi
99
100ifdef CONFIG_FIPS
101CONFIG_NO_RANDOM_POOL=
102endif
103
104OBJS = config.o
105OBJS += notify.o
106OBJS += bss.o
107OBJS += eap_register.o
108OBJS += ../src/utils/common.o
109OBJS += ../src/utils/config.o
110OBJS += ../src/utils/wpa_debug.o
111OBJS += ../src/utils/wpabuf.o
112OBJS += ../src/utils/bitfield.o
113OBJS += ../src/utils/ip_addr.o
114OBJS += ../src/utils/crc32.o
115OBJS += ../src/common/ptksa_cache.o
116OBJS += ../src/rsn_supp/pmksa_cache.o
117OBJS += twt.o
118OBJS_p = wpa_passphrase.o
119OBJS_p += ../src/utils/common.o
120OBJS_p += ../src/utils/wpa_debug.o
121OBJS_p += ../src/utils/wpabuf.o
122OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
123OBJS_c += ../src/utils/wpa_debug.o
124OBJS_c += ../src/utils/common.o
125OBJS_c += ../src/common/cli.o
126
127ifndef CONFIG_OS
128ifdef CONFIG_NATIVE_WINDOWS
129CONFIG_OS=win32
130else
131CONFIG_OS=unix
132endif
133endif
134
135ifeq ($(CONFIG_OS), internal)
136CFLAGS += -DOS_NO_C_LIB_DEFINES
137endif
138
139OBJS += ../src/utils/os_$(CONFIG_OS).o
140OBJS_p += ../src/utils/os_$(CONFIG_OS).o
141OBJS_c += ../src/utils/os_$(CONFIG_OS).o
142
143ifdef CONFIG_WPA_TRACE
144CFLAGS += -DWPA_TRACE
145OBJS += ../src/utils/trace.o
146OBJS_p += ../src/utils/trace.o
147OBJS_c += ../src/utils/trace.o
148OBJS_priv += ../src/utils/trace.o
149LIBCTRL += ../src/utils/trace.o
150LIBCTRLSO += ../src/utils/trace.c
151LDFLAGS += -rdynamic
152CFLAGS += -funwind-tables
153ifdef CONFIG_WPA_TRACE_BFD
154CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
155LIBS += -lbfd -ldl -liberty -lz
156LIBS_p += -lbfd -ldl -liberty -lz
157LIBS_c += -lbfd -ldl -liberty -lz
158endif
159endif
160
161ifndef CONFIG_ELOOP
162CONFIG_ELOOP=eloop
163endif
164OBJS += ../src/utils/$(CONFIG_ELOOP).o
165OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
166
167ifndef CONFIG_OSX
168ifeq ($(CONFIG_ELOOP), eloop)
169# Using glibc < 2.17 requires -lrt for clock_gettime()
170# OS X has an alternate implementation
171LIBS += -lrt
172LIBS_c += -lrt
173LIBS_p += -lrt
174endif
175endif
176
177ifdef CONFIG_ELOOP_POLL
178CFLAGS += -DCONFIG_ELOOP_POLL
179endif
180
181ifdef CONFIG_ELOOP_EPOLL
182CFLAGS += -DCONFIG_ELOOP_EPOLL
183endif
184
185ifdef CONFIG_ELOOP_KQUEUE
186CFLAGS += -DCONFIG_ELOOP_KQUEUE
187endif
188
189ifdef CONFIG_EAPOL_TEST
190CFLAGS += -Werror -DEAPOL_TEST
191endif
192
193ifdef CONFIG_CODE_COVERAGE
194CFLAGS += -O0 -fprofile-arcs -ftest-coverage -U_FORTIFY_SOURCE
195LIBS += -lgcov
196LIBS_c += -lgcov
197LIBS_p += -lgcov
198endif
199
200ifdef CONFIG_HT_OVERRIDES
201CFLAGS += -DCONFIG_HT_OVERRIDES
202endif
203
204ifdef CONFIG_VHT_OVERRIDES
205CFLAGS += -DCONFIG_VHT_OVERRIDES
206endif
207
208ifdef CONFIG_HE_OVERRIDES
209CFLAGS += -DCONFIG_HE_OVERRIDES
210endif
211
212ifndef CONFIG_BACKEND
213CONFIG_BACKEND=file
214endif
215
216ifeq ($(CONFIG_BACKEND), file)
217OBJS += config_file.o
218ifndef CONFIG_NO_CONFIG_BLOBS
219NEED_BASE64=y
220endif
221CFLAGS += -DCONFIG_BACKEND_FILE
222endif
223
224ifeq ($(CONFIG_BACKEND), winreg)
225OBJS += config_winreg.o
226endif
227
228ifeq ($(CONFIG_BACKEND), none)
229OBJS += config_none.o
230endif
231
232ifdef CONFIG_NO_CONFIG_WRITE
233CFLAGS += -DCONFIG_NO_CONFIG_WRITE
234endif
235
236ifdef CONFIG_NO_CONFIG_BLOBS
237CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
238endif
239
240ifdef CONFIG_NO_SCAN_PROCESSING
241CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
242endif
243
244ifdef CONFIG_SUITEB
245CFLAGS += -DCONFIG_SUITEB
246endif
247
248ifdef CONFIG_SUITEB192
249CFLAGS += -DCONFIG_SUITEB192
250NEED_SHA384=y
251endif
252
253ifdef CONFIG_OCV
254CFLAGS += -DCONFIG_OCV
255OBJS += ../src/common/ocv.o
256endif
257
258ifdef CONFIG_IEEE80211R
259CFLAGS += -DCONFIG_IEEE80211R
260OBJS += ../src/rsn_supp/wpa_ft.o
261endif
262
263ifdef CONFIG_MESH
264NEED_80211_COMMON=y
265NEED_AES_SIV=y
266CONFIG_SAE=y
267CONFIG_AP=y
268CFLAGS += -DCONFIG_MESH
269OBJS += mesh.o
270OBJS += mesh_mpm.o
271OBJS += mesh_rsn.o
272endif
273
274ifdef CONFIG_SAE
275CFLAGS += -DCONFIG_SAE
276OBJS += ../src/common/sae.o
277ifdef CONFIG_SAE_PK
278CFLAGS += -DCONFIG_SAE_PK
279NEED_AES_SIV=y
280OBJS += ../src/common/sae_pk.o
281endif
282NEED_ECC=y
283NEED_DH_GROUPS=y
284NEED_HMAC_SHA256_KDF=y
285NEED_DRAGONFLY=y
286ifdef CONFIG_TESTING_OPTIONS
287NEED_DH_GROUPS_ALL=y
288endif
289endif
290
291ifdef CONFIG_DPP
292CFLAGS += -DCONFIG_DPP
293OBJS += ../src/common/dpp.o
294OBJS += ../src/common/dpp_auth.o
295OBJS += ../src/common/dpp_backup.o
296OBJS += ../src/common/dpp_crypto.o
297OBJS += ../src/common/dpp_pkex.o
298OBJS += ../src/common/dpp_reconfig.o
299OBJS += ../src/common/dpp_tcp.o
300OBJS += dpp_supplicant.o
301NEED_AES_SIV=y
302NEED_HMAC_SHA256_KDF=y
303NEED_HMAC_SHA384_KDF=y
304NEED_HMAC_SHA512_KDF=y
305NEED_SHA384=y
306NEED_SHA512=y
307NEED_ECC=y
308NEED_JSON=y
309NEED_GAS_SERVER=y
310NEED_BASE64=y
311NEED_ASN1=y
312ifdef CONFIG_DPP2
313CFLAGS += -DCONFIG_DPP2
314endif
315ifdef CONFIG_DPP3
316CFLAGS += -DCONFIG_DPP3
317endif
318endif
319
320ifdef CONFIG_NAN_USD
321OBJS += ../src/common/nan_de.o
322OBJS += nan_usd.o
323CFLAGS += -DCONFIG_NAN_USD
324endif
325
326ifdef CONFIG_OWE
327CFLAGS += -DCONFIG_OWE
328NEED_ECC=y
329NEED_HMAC_SHA256_KDF=y
330NEED_HMAC_SHA384_KDF=y
331NEED_HMAC_SHA512_KDF=y
332NEED_SHA384=y
333NEED_SHA512=y
334endif
335
336ifdef CONFIG_FILS
337CFLAGS += -DCONFIG_FILS
338NEED_SHA384=y
339NEED_AES_SIV=y
340ifdef CONFIG_FILS_SK_PFS
341CFLAGS += -DCONFIG_FILS_SK_PFS
342NEED_ECC=y
343endif
344endif
345
346ifdef CONFIG_MBO
347CONFIG_WNM=y
348endif
349
350ifdef CONFIG_BGSCAN_SIMPLE
351CONFIG_WNM=y
352endif
353
354ifdef CONFIG_WNM
355CFLAGS += -DCONFIG_WNM
356OBJS += wnm_sta.o
357endif
358
359ifdef CONFIG_TDLS
360CFLAGS += -DCONFIG_TDLS
361OBJS += ../src/rsn_supp/tdls.o
362endif
363
364ifdef CONFIG_TDLS_TESTING
365CFLAGS += -DCONFIG_TDLS_TESTING
366endif
367
368ifdef CONFIG_PMKSA_CACHE_EXTERNAL
369CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
370endif
371
372ifndef CONFIG_NO_WPA
373OBJS += ../src/rsn_supp/wpa.o
374OBJS += ../src/rsn_supp/preauth.o
375OBJS += ../src/rsn_supp/wpa_ie.o
376OBJS += ../src/common/wpa_common.o
377NEED_AES=y
378NEED_SHA1=y
379NEED_MD5=y
380NEED_RC4=y
381else
382CFLAGS += -DCONFIG_NO_WPA
383ifeq ($(CONFIG_TLS), internal)
384NEED_SHA1=y
385NEED_MD5=y
386endif
387endif
388
389ifdef CONFIG_IBSS_RSN
390NEED_RSN_AUTHENTICATOR=y
391CFLAGS += -DCONFIG_IBSS_RSN
392CFLAGS += -DCONFIG_NO_VLAN
393OBJS += ibss_rsn.o
394endif
395
396ifdef CONFIG_MATCH_IFACE
397CFLAGS += -DCONFIG_MATCH_IFACE
398endif
399
400ifdef CONFIG_P2P
401OBJS += p2p_supplicant.o
402OBJS += p2p_supplicant_sd.o
403OBJS += ../src/p2p/p2p.o
404OBJS += ../src/p2p/p2p_utils.o
405OBJS += ../src/p2p/p2p_parse.o
406OBJS += ../src/p2p/p2p_build.o
407OBJS += ../src/p2p/p2p_go_neg.o
408OBJS += ../src/p2p/p2p_sd.o
409OBJS += ../src/p2p/p2p_pd.o
410OBJS += ../src/p2p/p2p_invitation.o
411OBJS += ../src/p2p/p2p_dev_disc.o
412OBJS += ../src/p2p/p2p_group.o
413OBJS += ../src/ap/p2p_hostapd.o
414CFLAGS += -DCONFIG_P2P
415NEED_GAS=y
416NEED_OFFCHANNEL=y
417CONFIG_WPS=y
418CONFIG_AP=y
419ifdef CONFIG_P2P_STRICT
420CFLAGS += -DCONFIG_P2P_STRICT
421endif
422ifdef CONFIG_WIFI_DISPLAY
423CFLAGS += -DCONFIG_WIFI_DISPLAY
424OBJS += wifi_display.o
425endif
426endif
427
428ifdef CONFIG_PASN
429CFLAGS += -DCONFIG_PASN
430CFLAGS += -DCONFIG_PTKSA_CACHE
431NEED_HMAC_SHA256_KDF=y
432NEED_HMAC_SHA384_KDF=y
433NEED_SHA256=y
434NEED_SHA384=y
435OBJS += ../src/pasn/pasn_initiator.o
436OBJS += ../src/pasn/pasn_common.o
437OBJS += pasn_supplicant.o
438endif
439
440ifdef CONFIG_HS20
441OBJS += hs20_supplicant.o
442CFLAGS += -DCONFIG_HS20
443CONFIG_INTERWORKING=y
444endif
445
446ifdef CONFIG_INTERWORKING
447OBJS += interworking.o
448CFLAGS += -DCONFIG_INTERWORKING
449NEED_GAS=y
450endif
451
452ifdef CONFIG_NO_ROAMING
453CFLAGS += -DCONFIG_NO_ROAMING
454endif
455
456ifdef CONFIG_OPENSC_ENGINE_PATH
457CFLAGS += -DCONFIG_OPENSC_ENGINE_PATH=\"$(CONFIG_OPENSC_ENGINE_PATH)\"
458endif
459
460ifdef CONFIG_NO_OPENSC_ENGINE_PATH
461CFLAGS += -DCONFIG_OPENSC_ENGINE_PATH=NULL
462endif
463
464ifdef CONFIG_PKCS11_ENGINE_PATH
465CFLAGS += -DCONFIG_PKCS11_ENGINE_PATH=\"$(CONFIG_PKCS11_ENGINE_PATH)\"
466endif
467
468ifdef CONFIG_NO_PKCS11_ENGINE_PATH
469CFLAGS += -DCONFIG_PKCS11_ENGINE_PATH=NULL
470endif
471
472ifdef CONFIG_PKCS11_MODULE_PATH
473CFLAGS += -DCONFIG_PKCS11_MODULE_PATH=\"$(CONFIG_PKCS11_MODULE_PATH)\"
474endif
475
476ifdef CONFIG_NO_PKCS11_MODULE_PATH
477CFLAGS += -DCONFIG_PKCS11_MODULE_PATH=NULL
478endif
479
480ifdef CONFIG_NO_LOAD_DYNAMIC_EAP
481CFLAGS += -DCONFIG_NO_LOAD_DYNAMIC_EAP
482endif
483
484ifdef CONFIG_NO_RRM
485CFLAGS += -DCONFIG_NO_RRM
486else
487OBJS += rrm.o
488ifdef CONFIG_AP
489OBJS += ../src/ap/rrm.o
490endif
491OBJS += op_classes.o
492endif
493
494ifdef CONFIG_NO_WMM_AC
495CFLAGS += -DCONFIG_NO_WMM_AC
496else
497OBJS += wmm_ac.o
498endif
499
500ifdef CONFIG_NO_ROBUST_AV
501CFLAGS += -DCONFIG_NO_ROBUST_AV
502else
503OBJS += robust_av.o
504endif
505
506include ../src/drivers/drivers.mak
507ifdef CONFIG_AP
508OBJS_d += $(DRV_BOTH_OBJS)
509CFLAGS += $(DRV_BOTH_CFLAGS)
510LDFLAGS += $(DRV_BOTH_LDFLAGS)
511LIBS += $(DRV_BOTH_LIBS)
512else
513NEED_AP_MLME=
514OBJS_d += $(DRV_WPA_OBJS)
515CFLAGS += $(DRV_WPA_CFLAGS)
516LDFLAGS += $(DRV_WPA_LDFLAGS)
517LIBS += $(DRV_WPA_LIBS)
518endif
519
520ifndef CONFIG_L2_PACKET
521CONFIG_L2_PACKET=linux
522endif
523
524OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
525
526ifeq ($(CONFIG_L2_PACKET), pcap)
527ifdef CONFIG_WINPCAP
528CFLAGS += -DCONFIG_WINPCAP
529LIBS += -lwpcap -lpacket
530LIBS_w += -lwpcap
531else
532LIBS += -ldnet -lpcap
533endif
534endif
535
536ifeq ($(CONFIG_L2_PACKET), winpcap)
537LIBS += -lwpcap -lpacket
538LIBS_w += -lwpcap
539endif
540
541ifeq ($(CONFIG_L2_PACKET), freebsd)
542LIBS += -lpcap
543endif
544
545ifdef CONFIG_ERP
546CFLAGS += -DCONFIG_ERP
547NEED_HMAC_SHA256_KDF=y
548endif
549
550ifdef CONFIG_EAP_TLS
551# EAP-TLS
552ifeq ($(CONFIG_EAP_TLS), dyn)
553CFLAGS += -DEAP_TLS_DYNAMIC
554EAPDYN += eap_tls.so
555else
556CFLAGS += -DEAP_TLS
557OBJS += ../src/eap_peer/eap_tls.o
558endif
559TLS_FUNCS=y
560CONFIG_IEEE8021X_EAPOL=y
561ifdef CONFIG_EAP_TLSV1_3
562CFLAGS += -DEAP_TLSV1_3
563endif
564endif
565
566ifdef CONFIG_EAP_UNAUTH_TLS
567# EAP-UNAUTH-TLS
568CFLAGS += -DEAP_UNAUTH_TLS
569ifndef CONFIG_EAP_TLS
570OBJS += ../src/eap_peer/eap_tls.o
571TLS_FUNCS=y
572endif
573CONFIG_IEEE8021X_EAPOL=y
574endif
575
576ifdef CONFIG_EAP_PEAP
577# EAP-PEAP
578SRC_EAP_PEAP = ../src/eap_peer/eap_peap.c ../src/eap_common/eap_peap_common.c
579ifeq ($(CONFIG_EAP_PEAP), dyn)
580CFLAGS += -DEAP_PEAP_DYNAMIC
581EAPDYN += eap_peap.so
582else
583CFLAGS += -DEAP_PEAP
584OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PEAP))
585endif
586TLS_FUNCS=y
587CONFIG_IEEE8021X_EAPOL=y
588endif
589
590ifdef CONFIG_EAP_TTLS
591# EAP-TTLS
592ifeq ($(CONFIG_EAP_TTLS), dyn)
593CFLAGS += -DEAP_TTLS_DYNAMIC
594EAPDYN += eap_ttls.so
595else
596CFLAGS += -DEAP_TTLS
597OBJS += ../src/eap_peer/eap_ttls.o
598endif
599TLS_FUNCS=y
600ifndef CONFIG_FIPS
601MS_FUNCS=y
602CHAP=y
603endif
604CONFIG_IEEE8021X_EAPOL=y
605endif
606
607ifdef CONFIG_EAP_MD5
608# EAP-MD5
609ifeq ($(CONFIG_EAP_MD5), dyn)
610CFLAGS += -DEAP_MD5_DYNAMIC
611EAPDYN += eap_md5.so
612else
613CFLAGS += -DEAP_MD5
614OBJS += ../src/eap_peer/eap_md5.o
615endif
616CHAP=y
617CONFIG_IEEE8021X_EAPOL=y
618endif
619
620# backwards compatibility for old spelling
621ifdef CONFIG_MSCHAPV2
622ifndef CONFIG_EAP_MSCHAPV2
623CONFIG_EAP_MSCHAPV2=y
624endif
625endif
626
627ifdef CONFIG_EAP_MSCHAPV2
628# EAP-MSCHAPv2
629SRC_EAP_MSCHAPV2 = ../src/eap_peer/eap_mschapv2.c ../src/eap_peer/mschapv2.c
630ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
631CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
632EAPDYN += eap_mschapv2.so
633else
634CFLAGS += -DEAP_MSCHAPv2
635OBJS += $(patsubst %.c, %.o, $(SRC_EAP_MSCHAPV2))
636endif
637MS_FUNCS=y
638CONFIG_IEEE8021X_EAPOL=y
639endif
640
641ifdef CONFIG_EAP_GTC
642# EAP-GTC
643ifeq ($(CONFIG_EAP_GTC), dyn)
644CFLAGS += -DEAP_GTC_DYNAMIC
645EAPDYN += eap_gtc.so
646else
647CFLAGS += -DEAP_GTC
648OBJS += ../src/eap_peer/eap_gtc.o
649endif
650CONFIG_IEEE8021X_EAPOL=y
651endif
652
653ifdef CONFIG_EAP_OTP
654# EAP-OTP
655ifeq ($(CONFIG_EAP_OTP), dyn)
656CFLAGS += -DEAP_OTP_DYNAMIC
657EAPDYN += eap_otp.so
658else
659CFLAGS += -DEAP_OTP
660OBJS += ../src/eap_peer/eap_otp.o
661endif
662CONFIG_IEEE8021X_EAPOL=y
663endif
664
665ifdef CONFIG_EAP_SIM
666# EAP-SIM
667ifeq ($(CONFIG_EAP_SIM), dyn)
668CFLAGS += -DEAP_SIM_DYNAMIC
669EAPDYN += eap_sim.so
670else
671CFLAGS += -DEAP_SIM
672OBJS += ../src/eap_peer/eap_sim.o
673endif
674CONFIG_IEEE8021X_EAPOL=y
675CONFIG_EAP_SIM_COMMON=y
676NEED_AES_CBC=y
677endif
678
679ifdef CONFIG_EAP_LEAP
680# EAP-LEAP
681ifeq ($(CONFIG_EAP_LEAP), dyn)
682CFLAGS += -DEAP_LEAP_DYNAMIC
683EAPDYN += eap_leap.so
684else
685CFLAGS += -DEAP_LEAP
686OBJS += ../src/eap_peer/eap_leap.o
687endif
688MS_FUNCS=y
689CONFIG_IEEE8021X_EAPOL=y
690endif
691
692ifdef CONFIG_EAP_PSK
693# EAP-PSK
694SRC_EAP_PSK = ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
695ifeq ($(CONFIG_EAP_PSK), dyn)
696CFLAGS += -DEAP_PSK_DYNAMIC
697EAPDYN += eap_psk.so
698else
699CFLAGS += -DEAP_PSK
700OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PSK))
701endif
702CONFIG_IEEE8021X_EAPOL=y
703NEED_AES=y
704NEED_AES_ENCBLOCK=y
705NEED_AES_EAX=y
706endif
707
708ifdef CONFIG_EAP_AKA
709# EAP-AKA
710ifeq ($(CONFIG_EAP_AKA), dyn)
711CFLAGS += -DEAP_AKA_DYNAMIC
712EAPDYN += eap_aka.so
713else
714CFLAGS += -DEAP_AKA
715OBJS += ../src/eap_peer/eap_aka.o
716endif
717CONFIG_IEEE8021X_EAPOL=y
718CONFIG_EAP_SIM_COMMON=y
719NEED_AES_CBC=y
720endif
721
722ifdef CONFIG_EAP_PROXY
723CFLAGS += -DCONFIG_EAP_PROXY
724OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
725include eap_proxy_$(CONFIG_EAP_PROXY).mak
726CONFIG_IEEE8021X_EAPOL=y
727endif
728
729ifdef CONFIG_EAP_AKA_PRIME
730# EAP-AKA'
731ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
732CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
733else
734CFLAGS += -DEAP_AKA_PRIME
735endif
736endif
737
738ifdef CONFIG_EAP_SIM_COMMON
739OBJS += ../src/eap_common/eap_sim_common.o
740NEED_AES=y
741NEED_FIPS186_2_PRF=y
742endif
743
744ifdef CONFIG_EAP_FAST
745# EAP-FAST
746SRC_EAP_FAST = ../src/eap_peer/eap_fast.c ../src/eap_peer/eap_fast_pac.c
747SRC_EAP_FAST += ../src/eap_common/eap_fast_common.c
748ifeq ($(CONFIG_EAP_FAST), dyn)
749CFLAGS += -DEAP_FAST_DYNAMIC
750EAPDYN += eap_fast.so
751else
752CFLAGS += -DEAP_FAST
753OBJS += $(patsubst %.c, %.o, $(SRC_EAP_FAST))
754endif
755TLS_FUNCS=y
756CONFIG_IEEE8021X_EAPOL=y
757NEED_T_PRF=y
758endif
759
760ifdef CONFIG_EAP_TEAP
761# EAP-TEAP
762SRC_EAP_TEAP = ../src/eap_peer/eap_teap.c ../src/eap_peer/eap_teap_pac.c
763SRC_EAP_TEAP += ../src/eap_common/eap_teap_common.c
764ifeq ($(CONFIG_EAP_TEAP), dyn)
765CFLAGS += -DEAP_TEAP_DYNAMIC
766EAPDYN += eap_teap.so
767else
768CFLAGS += -DEAP_TEAP
769OBJS += $(patsubst %.c, %.o, $(SRC_EAP_TEAP))
770endif
771TLS_FUNCS=y
772CONFIG_IEEE8021X_EAPOL=y
773NEED_T_PRF=y
774NEED_SHA384=y
775NEED_TLS_PRF_SHA256=y
776NEED_TLS_PRF_SHA384=y
777endif
778
779ifdef CONFIG_EAP_PAX
780# EAP-PAX
781SRC_EAP_PAX = ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
782ifeq ($(CONFIG_EAP_PAX), dyn)
783CFLAGS += -DEAP_PAX_DYNAMIC
784EAPDYN += eap_pax.so
785else
786CFLAGS += -DEAP_PAX
787OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PAX))
788endif
789CONFIG_IEEE8021X_EAPOL=y
790endif
791
792ifdef CONFIG_EAP_SAKE
793# EAP-SAKE
794SRC_EAP_SAKE = ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
795ifeq ($(CONFIG_EAP_SAKE), dyn)
796CFLAGS += -DEAP_SAKE_DYNAMIC
797EAPDYN += eap_sake.so
798else
799CFLAGS += -DEAP_SAKE
800OBJS += $(patsubst %.c, %.o, $(SRC_EAP_SAKE))
801endif
802CONFIG_IEEE8021X_EAPOL=y
803endif
804
805ifdef CONFIG_EAP_GPSK
806# EAP-GPSK
807SRC_EAP_GPSK = ../src/eap_peer/eap_gpsk.c ../src/eap_common/eap_gpsk_common.c
808ifeq ($(CONFIG_EAP_GPSK), dyn)
809CFLAGS += -DEAP_GPSK_DYNAMIC
810EAPDYN += eap_gpsk.so
811else
812CFLAGS += -DEAP_GPSK
813OBJS += $(patsubst %.c, %.o, $(SRC_EAP_GPSK))
814endif
815CONFIG_IEEE8021X_EAPOL=y
816ifdef CONFIG_EAP_GPSK_SHA256
817CFLAGS += -DEAP_GPSK_SHA256
818endif
819endif
820
821ifdef CONFIG_EAP_PWD
822CFLAGS += -DEAP_PWD
823ifeq ($(CONFIG_TLS), wolfssl)
824CFLAGS += -DCONFIG_ECC
825endif
826OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
827CONFIG_IEEE8021X_EAPOL=y
828NEED_ECC=y
829NEED_DRAGONFLY=y
830MS_FUNCS=y
831endif
832
833ifdef CONFIG_EAP_EKE
834# EAP-EKE
835SRC_EAP_EKE = ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
836ifeq ($(CONFIG_EAP_EKE), dyn)
837CFLAGS += -DEAP_EKE_DYNAMIC
838EAPDYN += eap_eke.so
839else
840CFLAGS += -DEAP_EKE
841OBJS += $(patsubst %.c, %.o, $(SRC_EAP_EKE))
842endif
843CONFIG_IEEE8021X_EAPOL=y
844NEED_DH_GROUPS=y
845NEED_DH_GROUPS_ALL=y
846NEED_AES_CBC=y
847endif
848
849ifdef CONFIG_WPS
850# EAP-WSC
851CFLAGS += -DCONFIG_WPS -DEAP_WSC
852OBJS += wps_supplicant.o
853OBJS += ../src/utils/uuid.o
854OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
855OBJS += ../src/wps/wps.o
856OBJS += ../src/wps/wps_common.o
857OBJS += ../src/wps/wps_attr_parse.o
858OBJS += ../src/wps/wps_attr_build.o
859OBJS += ../src/wps/wps_attr_process.o
860OBJS += ../src/wps/wps_dev_attr.o
861OBJS += ../src/wps/wps_enrollee.o
862OBJS += ../src/wps/wps_registrar.o
863CONFIG_IEEE8021X_EAPOL=y
864NEED_DH_GROUPS=y
865NEED_BASE64=y
866NEED_AES_CBC=y
867NEED_MODEXP=y
868
869ifdef CONFIG_WPS_NFC
870CFLAGS += -DCONFIG_WPS_NFC
871OBJS += ../src/wps/ndef.o
872NEED_WPS_OOB=y
873endif
874
875ifdef NEED_WPS_OOB
876CFLAGS += -DCONFIG_WPS_OOB
877endif
878
879ifdef CONFIG_WPS_ER
880CONFIG_WPS_UPNP=y
881CFLAGS += -DCONFIG_WPS_ER
882OBJS += ../src/wps/wps_er.o
883OBJS += ../src/wps/wps_er_ssdp.o
884endif
885
886ifdef CONFIG_WPS_UPNP
887CFLAGS += -DCONFIG_WPS_UPNP
888OBJS += ../src/wps/wps_upnp.o
889OBJS += ../src/wps/wps_upnp_ssdp.o
890OBJS += ../src/wps/wps_upnp_web.o
891OBJS += ../src/wps/wps_upnp_event.o
892OBJS += ../src/wps/wps_upnp_ap.o
893OBJS += ../src/wps/upnp_xml.o
894OBJS += ../src/wps/httpread.o
895OBJS += ../src/wps/http_client.o
896OBJS += ../src/wps/http_server.o
897endif
898
899ifdef CONFIG_WPS_STRICT
900CFLAGS += -DCONFIG_WPS_STRICT
901OBJS += ../src/wps/wps_validate.o
902endif
903
904ifdef CONFIG_WPS_TESTING
905CFLAGS += -DCONFIG_WPS_TESTING
906endif
907
908ifdef CONFIG_WPS_REG_DISABLE_OPEN
909CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
910endif
911
912endif
913
914ifdef CONFIG_EAP_IKEV2
915# EAP-IKEv2
916SRC_EAP_IKEV2 = ../src/eap_peer/eap_ikev2.c
917SRC_EAP_IKEV2 += ../src/eap_peer/ikev2.c
918SRC_EAP_IKEV2 += ../src/eap_common/eap_ikev2_common.c
919SRC_EAP_IKEV2 += ../src/eap_common/ikev2_common.c
920ifeq ($(CONFIG_EAP_IKEV2), dyn)
921CFLAGS += -DEAP_IKEV2_DYNAMIC
922EAPDYN += eap_ikev2.so
923else
924CFLAGS += -DEAP_IKEV2
925OBJS += $(patsubst %.c, %.o, $(SRC_EAP_IKEV2))
926endif
927CONFIG_IEEE8021X_EAPOL=y
928NEED_DH_GROUPS=y
929NEED_DH_GROUPS_ALL=y
930NEED_MODEXP=y
931NEED_CIPHER=y
932endif
933
934ifdef CONFIG_EAP_VENDOR_TEST
935ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
936CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
937EAPDYN += eap_vendor_test.so
938else
939CFLAGS += -DEAP_VENDOR_TEST
940OBJS += ../src/eap_peer/eap_vendor_test.o
941endif
942CONFIG_IEEE8021X_EAPOL=y
943endif
944
945ifdef CONFIG_EAP_TNC
946# EAP-TNC
947CFLAGS += -DEAP_TNC
948OBJS += ../src/eap_peer/eap_tnc.o
949OBJS += ../src/eap_peer/tncc.o
950NEED_BASE64=y
951ifndef CONFIG_NATIVE_WINDOWS
952ifndef CONFIG_DRIVER_BSD
953LIBS += -ldl
954endif
955endif
956endif
957
958ifdef CONFIG_MACSEC
959CFLAGS += -DCONFIG_MACSEC
960CONFIG_IEEE8021X_EAPOL=y
961NEED_AES_ENCBLOCK=y
962NEED_AES_UNWRAP=y
963NEED_AES_WRAP=y
964OBJS += wpas_kay.o
965OBJS += ../src/pae/ieee802_1x_cp.o
966OBJS += ../src/pae/ieee802_1x_kay.o
967OBJS += ../src/pae/ieee802_1x_key.o
968OBJS += ../src/pae/ieee802_1x_secy_ops.o
969ifdef CONFIG_AP
970OBJS += ../src/ap/wpa_auth_kay.o
971endif
972endif
973
974ifdef CONFIG_IEEE8021X_EAPOL
975# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
976CFLAGS += -DIEEE8021X_EAPOL
977OBJS += ../src/eapol_supp/eapol_supp_sm.o
978OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
979NEED_EAP_COMMON=y
980ifdef CONFIG_DYNAMIC_EAP_METHODS
981CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
982LIBS += -ldl -rdynamic
983endif
984endif
985
986ifdef CONFIG_AP
987NEED_EAP_COMMON=y
988NEED_RSN_AUTHENTICATOR=y
989CFLAGS += -DCONFIG_AP
990OBJS += ap.o
991CFLAGS += -DCONFIG_NO_RADIUS
992CFLAGS += -DCONFIG_NO_ACCOUNTING
993CFLAGS += -DCONFIG_NO_VLAN
994OBJS += ../src/ap/hostapd.o
995OBJS += ../src/ap/wpa_auth_glue.o
996OBJS += ../src/ap/utils.o
997OBJS += ../src/ap/authsrv.o
998OBJS += ../src/ap/ap_config.o
999OBJS += ../src/ap/sta_info.o
1000OBJS += ../src/ap/tkip_countermeasures.o
1001OBJS += ../src/ap/ap_mlme.o
1002OBJS += ../src/ap/ieee802_1x.o
1003OBJS += ../src/eapol_auth/eapol_auth_sm.o
1004OBJS += ../src/ap/ieee802_11_auth.o
1005OBJS += ../src/ap/ieee802_11_shared.o
1006OBJS += ../src/ap/drv_callbacks.o
1007OBJS += ../src/ap/ap_drv_ops.o
1008OBJS += ../src/ap/beacon.o
1009OBJS += ../src/ap/bss_load.o
1010OBJS += ../src/ap/eap_user_db.o
1011OBJS += ../src/ap/neighbor_db.o
1012OBJS += ../src/ap/ieee802_11_ht.o
1013ifdef CONFIG_IEEE80211AC
1014OBJS += ../src/ap/ieee802_11_vht.o
1015endif
1016ifdef CONFIG_IEEE80211AX
1017OBJS += ../src/ap/ieee802_11_he.o
1018endif
1019ifdef CONFIG_IEEE80211BE
1020OBJS += ../src/ap/ieee802_11_eht.o
1021endif
1022ifdef CONFIG_WNM_AP
1023CFLAGS += -DCONFIG_WNM_AP
1024OBJS += ../src/ap/wnm_ap.o
1025endif
1026ifdef CONFIG_MBO
1027OBJS += ../src/ap/mbo_ap.o
1028endif
1029ifdef CONFIG_FILS
1030OBJS += ../src/ap/fils_hlp.o
1031endif
1032ifdef CONFIG_CTRL_IFACE
1033OBJS += ../src/ap/ctrl_iface_ap.o
1034endif
1035
1036CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
1037OBJS += ../src/eap_server/eap_server.o
1038OBJS += ../src/eap_server/eap_server_identity.o
1039OBJS += ../src/eap_server/eap_server_methods.o
1040
1041ifdef CONFIG_IEEE80211AC
1042CFLAGS += -DCONFIG_IEEE80211AC
1043endif
1044ifdef CONFIG_IEEE80211BE
1045CONFIG_IEEE80211AX=y
1046CFLAGS += -DCONFIG_IEEE80211BE
1047endif
1048ifdef CONFIG_IEEE80211AX
1049CFLAGS += -DCONFIG_IEEE80211AX
1050endif
1051
1052ifdef NEED_AP_MLME
1053OBJS += ../src/ap/wmm.o
1054OBJS += ../src/ap/ap_list.o
1055OBJS += ../src/ap/comeback_token.o
1056OBJS += ../src/pasn/pasn_responder.o
1057OBJS += ../src/ap/ieee802_11.o
1058OBJS += ../src/ap/hw_features.o
1059OBJS += ../src/ap/dfs.o
1060CFLAGS += -DNEED_AP_MLME
1061endif
1062ifdef CONFIG_WPS
1063CFLAGS += -DEAP_SERVER_WSC
1064OBJS += ../src/ap/wps_hostapd.o
1065OBJS += ../src/eap_server/eap_server_wsc.o
1066endif
1067ifdef CONFIG_DPP
1068OBJS += ../src/ap/dpp_hostapd.o
1069OBJS += ../src/ap/gas_query_ap.o
1070NEED_AP_GAS_SERV=y
1071endif
1072ifdef CONFIG_NAN_USD
1073OBJS += ../src/ap/nan_usd_ap.o
1074endif
1075ifdef CONFIG_INTERWORKING
1076NEED_AP_GAS_SERV=y
1077endif
1078ifdef NEED_AP_GAS_SERV
1079OBJS += ../src/ap/gas_serv.o
1080endif
1081ifdef CONFIG_HS20
1082OBJS += ../src/ap/hs20.o
1083endif
1084endif
1085
1086ifdef CONFIG_MBO
1087OBJS += mbo.o
1088CFLAGS += -DCONFIG_MBO
1089NEED_GAS=y
1090endif
1091
1092ifdef NEED_RSN_AUTHENTICATOR
1093CFLAGS += -DCONFIG_NO_RADIUS
1094NEED_AES_WRAP=y
1095OBJS += ../src/ap/wpa_auth.o
1096OBJS += ../src/ap/wpa_auth_ie.o
1097OBJS += ../src/ap/pmksa_cache_auth.o
1098endif
1099
1100ifdef CONFIG_ACS
1101CFLAGS += -DCONFIG_ACS
1102OBJS += ../src/ap/acs.o
1103LIBS += -lm
1104endif
1105
1106ifdef CONFIG_PCSC
1107# PC/SC interface for smartcards (USIM, GSM SIM)
1108CFLAGS += -DPCSC_FUNCS
1109OBJS += ../src/utils/pcsc_funcs.o
1110ifdef CONFIG_NATIVE_WINDOWS
1111#Once MinGW gets support for WinScard, -lwinscard could be used instead of the
1112#dynamic symbol loading that is now used in pcsc_funcs.c
1113#LIBS += -lwinscard
1114CFLAGS += -I/usr/include/PCSC
1115else
1116ifdef CONFIG_OSX
1117LIBS += -framework PCSC
1118CFLAGS += -I/usr/include/PCSC
1119else
1120LIBS += $(shell $(PKG_CONFIG) --libs libpcsclite)
1121CFLAGS += $(shell $(PKG_CONFIG) --cflags libpcsclite)
1122endif
1123endif
1124endif
1125
1126ifdef CONFIG_SIM_SIMULATOR
1127CFLAGS += -DCONFIG_SIM_SIMULATOR
1128NEED_MILENAGE=y
1129endif
1130
1131ifdef CONFIG_USIM_SIMULATOR
1132CFLAGS += -DCONFIG_USIM_SIMULATOR
1133NEED_MILENAGE=y
1134endif
1135
1136ifdef NEED_MILENAGE
1137OBJS += ../src/crypto/milenage.o
1138NEED_AES_ENCBLOCK=y
1139endif
1140
1141ifdef CONFIG_PKCS12
1142CFLAGS += -DPKCS12_FUNCS
1143endif
1144
1145ifdef CONFIG_SMARTCARD
1146CFLAGS += -DCONFIG_SMARTCARD
1147endif
1148
1149ifdef NEED_DRAGONFLY
1150OBJS += ../src/common/dragonfly.o
1151endif
1152
1153ifdef MS_FUNCS
1154OBJS += ../src/crypto/ms_funcs.o
1155NEED_DES=y
1156NEED_MD4=y
1157endif
1158
1159ifdef CHAP
1160OBJS += ../src/eap_common/chap.o
1161endif
1162
1163ifdef TLS_FUNCS
1164NEED_DES=y
1165# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, EAP_FAST, and
1166# EAP_TEAP)
1167OBJS += ../src/eap_peer/eap_tls_common.o
1168ifndef CONFIG_FIPS
1169NEED_TLS_PRF=y
1170NEED_SHA1=y
1171NEED_MD5=y
1172endif
1173endif
1174
1175ifndef CONFIG_TLS
1176CONFIG_TLS=openssl
1177endif
1178
1179ifdef CONFIG_TLSV11
1180CFLAGS += -DCONFIG_TLSV11
1181endif
1182
1183ifdef CONFIG_TLSV12
1184CFLAGS += -DCONFIG_TLSV12
1185endif
1186
1187ifdef CONFIG_RADIUS_TLS
1188TLS_FUNCS=y
1189endif
1190
1191ifeq ($(CONFIG_TLS), wolfssl)
1192ifdef TLS_FUNCS
1193CFLAGS += -DWOLFSSL_DER_LOAD
1194OBJS += ../src/crypto/tls_wolfssl.o
1195endif
1196OBJS += ../src/crypto/crypto_wolfssl.o
1197OBJS_p += ../src/crypto/crypto_wolfssl.o
1198ifdef NEED_FIPS186_2_PRF
1199OBJS += ../src/crypto/fips_prf_wolfssl.o
1200endif
1201NEED_TLS_PRF_SHA256=y
1202LIBS += -lwolfssl -lm
1203LIBS_p += -lwolfssl -lm
1204endif
1205
1206ifeq ($(CONFIG_TLS), openssl)
1207CFLAGS += -DCRYPTO_RSA_OAEP_SHA256
1208ifdef TLS_FUNCS
1209CFLAGS += -DEAP_TLS_OPENSSL
1210OBJS += ../src/crypto/tls_openssl.o
1211OBJS += ../src/crypto/tls_openssl_ocsp.o
1212LIBS += -lssl
1213endif
1214OBJS += ../src/crypto/crypto_openssl.o
1215OBJS_p += ../src/crypto/crypto_openssl.o
1216OBJS_priv += ../src/crypto/crypto_openssl.o
1217ifdef NEED_FIPS186_2_PRF
1218OBJS += ../src/crypto/fips_prf_openssl.o
1219endif
1220NEED_TLS_PRF_SHA256=y
1221LIBS += -lcrypto
1222LIBS_p += -lcrypto
1223ifdef CONFIG_TLS_ADD_DL
1224LIBS += -ldl
1225LIBS_p += -ldl
1226endif
1227ifndef CONFIG_TLS_DEFAULT_CIPHERS
1228CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
1229endif
1230CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
1231endif
1232
1233ifeq ($(CONFIG_TLS), gnutls)
1234ifndef CONFIG_CRYPTO
1235# default to libgcrypt
1236CONFIG_CRYPTO=gnutls
1237endif
1238ifdef TLS_FUNCS
1239OBJS += ../src/crypto/tls_gnutls.o
1240LIBS += -lgnutls -lgpg-error
1241endif
1242OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1243OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1244OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o
1245ifdef NEED_FIPS186_2_PRF
1246OBJS += ../src/crypto/fips_prf_internal.o
1247SHA1OBJS += ../src/crypto/sha1-internal.o
1248endif
1249ifeq ($(CONFIG_CRYPTO), gnutls)
1250LIBS += -lgcrypt
1251LIBS_p += -lgcrypt
1252CONFIG_INTERNAL_RC4=y
1253CONFIG_INTERNAL_DH_GROUP5=y
1254endif
1255ifeq ($(CONFIG_CRYPTO), nettle)
1256LIBS += -lnettle -lgmp
1257LIBS_p += -lnettle -lgmp
1258CONFIG_INTERNAL_RC4=y
1259CONFIG_INTERNAL_DH_GROUP5=y
1260endif
1261endif
1262
1263ifeq ($(CONFIG_TLS), internal)
1264ifndef CONFIG_CRYPTO
1265CONFIG_CRYPTO=internal
1266endif
1267ifdef TLS_FUNCS
1268OBJS += ../src/crypto/crypto_internal-rsa.o
1269OBJS += ../src/crypto/tls_internal.o
1270OBJS += ../src/tls/tlsv1_common.o
1271OBJS += ../src/tls/tlsv1_record.o
1272OBJS += ../src/tls/tlsv1_cred.o
1273OBJS += ../src/tls/tlsv1_client.o
1274OBJS += ../src/tls/tlsv1_client_write.o
1275OBJS += ../src/tls/tlsv1_client_read.o
1276OBJS += ../src/tls/tlsv1_client_ocsp.o
1277OBJS += ../src/tls/rsa.o
1278OBJS += ../src/tls/x509v3.o
1279OBJS += ../src/tls/pkcs1.o
1280OBJS += ../src/tls/pkcs5.o
1281OBJS += ../src/tls/pkcs8.o
1282NEED_ASN1=y
1283NEED_BASE64=y
1284NEED_TLS_PRF=y
1285ifdef CONFIG_TLSV12
1286NEED_TLS_PRF_SHA256=y
1287endif
1288NEED_MODEXP=y
1289NEED_CIPHER=y
1290CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1291endif
1292ifdef NEED_CIPHER
1293NEED_DES=y
1294OBJS += ../src/crypto/crypto_internal-cipher.o
1295endif
1296ifdef NEED_MODEXP
1297OBJS += ../src/crypto/crypto_internal-modexp.o
1298OBJS += ../src/tls/bignum.o
1299endif
1300ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1301OBJS += ../src/crypto/crypto_libtomcrypt.o
1302OBJS_p += ../src/crypto/crypto_libtomcrypt.o
1303LIBS += -ltomcrypt -ltfm
1304LIBS_p += -ltomcrypt -ltfm
1305CONFIG_INTERNAL_SHA256=y
1306CONFIG_INTERNAL_RC4=y
1307CONFIG_INTERNAL_DH_GROUP5=y
1308endif
1309ifeq ($(CONFIG_CRYPTO), internal)
1310OBJS += ../src/crypto/crypto_internal.o
1311OBJS_p += ../src/crypto/crypto_internal.o
1312NEED_AES_ENC=y
1313CFLAGS += -DCONFIG_CRYPTO_INTERNAL
1314ifdef CONFIG_INTERNAL_LIBTOMMATH
1315CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1316ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
1317CFLAGS += -DLTM_FAST
1318endif
1319else
1320LIBS += -ltommath
1321LIBS_p += -ltommath
1322endif
1323CONFIG_INTERNAL_AES=y
1324CONFIG_INTERNAL_DES=y
1325CONFIG_INTERNAL_SHA1=y
1326CONFIG_INTERNAL_MD4=y
1327CONFIG_INTERNAL_MD5=y
1328CONFIG_INTERNAL_SHA256=y
1329CONFIG_INTERNAL_SHA384=y
1330CONFIG_INTERNAL_SHA512=y
1331CONFIG_INTERNAL_RC4=y
1332CONFIG_INTERNAL_DH_GROUP5=y
1333endif
1334ifeq ($(CONFIG_CRYPTO), cryptoapi)
1335OBJS += ../src/crypto/crypto_cryptoapi.o
1336OBJS_p += ../src/crypto/crypto_cryptoapi.o
1337CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
1338CONFIG_INTERNAL_SHA256=y
1339CONFIG_INTERNAL_RC4=y
1340endif
1341endif
1342
1343ifeq ($(CONFIG_TLS), linux)
1344OBJS += ../src/crypto/crypto_linux.o
1345OBJS_p += ../src/crypto/crypto_linux.o
1346ifdef TLS_FUNCS
1347OBJS += ../src/crypto/crypto_internal-rsa.o
1348OBJS += ../src/crypto/tls_internal.o
1349OBJS += ../src/tls/tlsv1_common.o
1350OBJS += ../src/tls/tlsv1_record.o
1351OBJS += ../src/tls/tlsv1_cred.o
1352OBJS += ../src/tls/tlsv1_client.o
1353OBJS += ../src/tls/tlsv1_client_write.o
1354OBJS += ../src/tls/tlsv1_client_read.o
1355OBJS += ../src/tls/tlsv1_client_ocsp.o
1356OBJS += ../src/tls/rsa.o
1357OBJS += ../src/tls/x509v3.o
1358OBJS += ../src/tls/pkcs1.o
1359OBJS += ../src/tls/pkcs5.o
1360OBJS += ../src/tls/pkcs8.o
1361NEED_ASN1=y
1362NEED_BASE64=y
1363NEED_TLS_PRF=y
1364ifdef CONFIG_TLSV12
1365NEED_TLS_PRF_SHA256=y
1366endif
1367NEED_MODEXP=y
1368NEED_CIPHER=y
1369CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1370endif
1371ifdef NEED_MODEXP
1372OBJS += ../src/crypto/crypto_internal-modexp.o
1373OBJS += ../src/tls/bignum.o
1374CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1375CFLAGS += -DLTM_FAST
1376endif
1377CONFIG_INTERNAL_DH_GROUP5=y
1378ifdef NEED_FIPS186_2_PRF
1379OBJS += ../src/crypto/fips_prf_internal.o
1380OBJS += ../src/crypto/sha1-internal.o
1381endif
1382endif
1383
1384ifeq ($(CONFIG_TLS), none)
1385ifdef TLS_FUNCS
1386OBJS += ../src/crypto/tls_none.o
1387CFLAGS += -DEAP_TLS_NONE
1388CONFIG_INTERNAL_AES=y
1389CONFIG_INTERNAL_SHA1=y
1390CONFIG_INTERNAL_MD5=y
1391endif
1392OBJS += ../src/crypto/crypto_none.o
1393OBJS_p += ../src/crypto/crypto_none.o
1394CONFIG_INTERNAL_SHA256=y
1395CONFIG_INTERNAL_RC4=y
1396endif
1397
1398ifdef TLS_FUNCS
1399ifdef CONFIG_SMARTCARD
1400ifndef CONFIG_NATIVE_WINDOWS
1401ifneq ($(CONFIG_L2_PACKET), freebsd)
1402LIBS += -ldl
1403endif
1404endif
1405endif
1406endif
1407
1408ifndef TLS_FUNCS
1409OBJS += ../src/crypto/tls_none.o
1410ifeq ($(CONFIG_TLS), internal)
1411CONFIG_INTERNAL_AES=y
1412CONFIG_INTERNAL_SHA1=y
1413CONFIG_INTERNAL_MD5=y
1414CONFIG_INTERNAL_RC4=y
1415endif
1416endif
1417
1418AESOBJS = # none so far (see below)
1419ifdef CONFIG_INTERNAL_AES
1420AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
1421endif
1422
1423ifneq ($(CONFIG_TLS), openssl)
1424ifneq ($(CONFIG_TLS), wolfssl)
1425NEED_INTERNAL_AES_WRAP=y
1426endif
1427endif
1428ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
1429# Seems to be needed at least with BoringSSL
1430NEED_INTERNAL_AES_WRAP=y
1431CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
1432endif
1433ifdef CONFIG_FIPS
1434# Have to use internal AES key wrap routines to use OpenSSL EVP since the
1435# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
1436NEED_INTERNAL_AES_WRAP=y
1437endif
1438
1439ifdef NEED_INTERNAL_AES_WRAP
1440ifneq ($(CONFIG_TLS), linux)
1441AESOBJS += ../src/crypto/aes-unwrap.o
1442endif
1443endif
1444ifdef NEED_AES_EAX
1445AESOBJS += ../src/crypto/aes-eax.o
1446NEED_AES_CTR=y
1447endif
1448ifdef NEED_AES_SIV
1449AESOBJS += ../src/crypto/aes-siv.o
1450NEED_AES_CTR=y
1451endif
1452ifdef NEED_AES_CTR
1453AESOBJS += ../src/crypto/aes-ctr.o
1454endif
1455ifdef NEED_AES_ENCBLOCK
1456AESOBJS += ../src/crypto/aes-encblock.o
1457endif
1458NEED_AES_ENC=y
1459ifneq ($(CONFIG_TLS), openssl)
1460ifneq ($(CONFIG_TLS), linux)
1461ifneq ($(CONFIG_TLS), wolfssl)
1462AESOBJS += ../src/crypto/aes-omac1.o
1463endif
1464endif
1465endif
1466ifdef NEED_AES_WRAP
1467NEED_AES_ENC=y
1468ifdef NEED_INTERNAL_AES_WRAP
1469AESOBJS += ../src/crypto/aes-wrap.o
1470endif
1471endif
1472ifdef NEED_AES_CBC
1473NEED_AES_ENC=y
1474ifneq ($(CONFIG_TLS), openssl)
1475ifneq ($(CONFIG_TLS), linux)
1476ifneq ($(CONFIG_TLS), wolfssl)
1477AESOBJS += ../src/crypto/aes-cbc.o
1478endif
1479endif
1480endif
1481endif
1482ifdef NEED_AES_ENC
1483ifdef CONFIG_INTERNAL_AES
1484AESOBJS += ../src/crypto/aes-internal-enc.o
1485endif
1486endif
1487ifdef NEED_AES
1488OBJS += $(AESOBJS)
1489endif
1490
1491ifdef NEED_SHA1
1492ifneq ($(CONFIG_TLS), openssl)
1493ifneq ($(CONFIG_TLS), linux)
1494ifneq ($(CONFIG_TLS), gnutls)
1495ifneq ($(CONFIG_TLS), wolfssl)
1496SHA1OBJS += ../src/crypto/sha1.o
1497endif
1498endif
1499endif
1500endif
1501SHA1OBJS += ../src/crypto/sha1-prf.o
1502ifdef CONFIG_INTERNAL_SHA1
1503SHA1OBJS += ../src/crypto/sha1-internal.o
1504ifdef NEED_FIPS186_2_PRF
1505SHA1OBJS += ../src/crypto/fips_prf_internal.o
1506endif
1507endif
1508ifdef CONFIG_NO_WPA_PASSPHRASE
1509CFLAGS += -DCONFIG_NO_PBKDF2
1510else
1511ifneq ($(CONFIG_TLS), openssl)
1512ifneq ($(CONFIG_TLS), wolfssl)
1513SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
1514endif
1515endif
1516endif
1517ifdef NEED_T_PRF
1518SHA1OBJS += ../src/crypto/sha1-tprf.o
1519endif
1520ifdef NEED_TLS_PRF
1521SHA1OBJS += ../src/crypto/sha1-tlsprf.o
1522endif
1523endif
1524
1525ifndef CONFIG_FIPS
1526ifneq ($(CONFIG_TLS), openssl)
1527ifneq ($(CONFIG_TLS), linux)
1528ifneq ($(CONFIG_TLS), gnutls)
1529ifneq ($(CONFIG_TLS), wolfssl)
1530MD5OBJS += ../src/crypto/md5.o
1531endif
1532endif
1533endif
1534endif
1535endif
1536ifdef NEED_MD5
1537ifdef CONFIG_INTERNAL_MD5
1538MD5OBJS += ../src/crypto/md5-internal.o
1539endif
1540OBJS += $(MD5OBJS)
1541OBJS_p += $(MD5OBJS)
1542OBJS_priv += $(MD5OBJS)
1543endif
1544
1545ifdef NEED_MD4
1546ifdef CONFIG_INTERNAL_MD4
1547OBJS += ../src/crypto/md4-internal.o
1548endif
1549endif
1550
1551DESOBJS = # none needed when not internal
1552ifdef NEED_DES
1553ifndef CONFIG_FIPS
1554CFLAGS += -DCONFIG_DES
1555endif
1556ifdef CONFIG_INTERNAL_DES
1557DESOBJS += ../src/crypto/des-internal.o
1558endif
1559endif
1560
1561ifdef CONFIG_NO_RC4
1562CFLAGS += -DCONFIG_NO_RC4
1563endif
1564
1565ifdef NEED_RC4
1566ifdef CONFIG_INTERNAL_RC4
1567ifndef CONFIG_NO_RC4
1568OBJS += ../src/crypto/rc4.o
1569endif
1570endif
1571endif
1572
1573ifdef CONFIG_SAE
1574ifdef NEED_SHA384
1575# Need to add HMAC-SHA384 KDF as well, if SHA384 was enabled.
1576NEED_HMAC_SHA384_KDF=y
1577endif
1578ifdef NEED_SHA512
1579# Need to add HMAC-SHA512 KDF as well, if SHA512 was enabled.
1580NEED_HMAC_SHA512_KDF=y
1581endif
1582endif
1583
1584SHA256OBJS = # none by default
1585CFLAGS += -DCONFIG_SHA256
1586ifneq ($(CONFIG_TLS), openssl)
1587ifneq ($(CONFIG_TLS), linux)
1588ifneq ($(CONFIG_TLS), gnutls)
1589ifneq ($(CONFIG_TLS), wolfssl)
1590SHA256OBJS += ../src/crypto/sha256.o
1591endif
1592endif
1593endif
1594endif
1595SHA256OBJS += ../src/crypto/sha256-prf.o
1596ifdef CONFIG_INTERNAL_SHA256
1597SHA256OBJS += ../src/crypto/sha256-internal.o
1598endif
1599ifdef CONFIG_INTERNAL_SHA384
1600CFLAGS += -DCONFIG_INTERNAL_SHA384
1601SHA256OBJS += ../src/crypto/sha384-internal.o
1602endif
1603ifdef CONFIG_INTERNAL_SHA512
1604CFLAGS += -DCONFIG_INTERNAL_SHA512
1605SHA256OBJS += ../src/crypto/sha512-internal.o
1606endif
1607ifdef NEED_TLS_PRF_SHA256
1608SHA256OBJS += ../src/crypto/sha256-tlsprf.o
1609endif
1610ifdef NEED_TLS_PRF_SHA384
1611SHA256OBJS += ../src/crypto/sha384-tlsprf.o
1612endif
1613ifdef NEED_HMAC_SHA256_KDF
1614CFLAGS += -DCONFIG_HMAC_SHA256_KDF
1615OBJS += ../src/crypto/sha256-kdf.o
1616endif
1617ifdef NEED_HMAC_SHA384_KDF
1618CFLAGS += -DCONFIG_HMAC_SHA384_KDF
1619OBJS += ../src/crypto/sha384-kdf.o
1620endif
1621ifdef NEED_HMAC_SHA512_KDF
1622CFLAGS += -DCONFIG_HMAC_SHA512_KDF
1623OBJS += ../src/crypto/sha512-kdf.o
1624endif
1625OBJS += $(SHA256OBJS)
1626ifdef NEED_SHA384
1627ifneq ($(CONFIG_TLS), openssl)
1628ifneq ($(CONFIG_TLS), linux)
1629ifneq ($(CONFIG_TLS), gnutls)
1630ifneq ($(CONFIG_TLS), wolfssl)
1631OBJS += ../src/crypto/sha384.o
1632endif
1633endif
1634endif
1635endif
1636CFLAGS += -DCONFIG_SHA384
1637OBJS += ../src/crypto/sha384-prf.o
1638endif
1639ifdef NEED_SHA512
1640ifneq ($(CONFIG_TLS), openssl)
1641ifneq ($(CONFIG_TLS), linux)
1642ifneq ($(CONFIG_TLS), gnutls)
1643ifneq ($(CONFIG_TLS), wolfssl)
1644OBJS += ../src/crypto/sha512.o
1645endif
1646endif
1647endif
1648endif
1649CFLAGS += -DCONFIG_SHA512
1650OBJS += ../src/crypto/sha512-prf.o
1651endif
1652
1653ifdef NEED_ASN1
1654OBJS += ../src/tls/asn1.o
1655endif
1656
1657ifdef NEED_DH_GROUPS
1658OBJS += ../src/crypto/dh_groups.o
1659endif
1660ifdef NEED_DH_GROUPS_ALL
1661CFLAGS += -DALL_DH_GROUPS
1662endif
1663ifdef CONFIG_INTERNAL_DH_GROUP5
1664ifdef NEED_DH_GROUPS
1665OBJS += ../src/crypto/dh_group5.o
1666endif
1667endif
1668
1669ifdef NEED_ECC
1670CFLAGS += -DCONFIG_ECC
1671endif
1672
1673ifdef CONFIG_NO_RANDOM_POOL
1674CFLAGS += -DCONFIG_NO_RANDOM_POOL
1675else
1676ifdef CONFIG_GETRANDOM
1677CFLAGS += -DCONFIG_GETRANDOM
1678endif
1679OBJS += ../src/crypto/random.o
1680endif
1681
1682ifdef CONFIG_CTRL_IFACE
1683ifeq ($(CONFIG_CTRL_IFACE), y)
1684ifdef CONFIG_NATIVE_WINDOWS
1685CONFIG_CTRL_IFACE=named_pipe
1686else
1687CONFIG_CTRL_IFACE=unix
1688endif
1689endif
1690CFLAGS += -DCONFIG_CTRL_IFACE
1691ifeq ($(CONFIG_CTRL_IFACE), unix)
1692CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1693OBJS += ../src/common/ctrl_iface_common.o
1694endif
1695ifeq ($(CONFIG_CTRL_IFACE), udp)
1696CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1697endif
1698ifeq ($(CONFIG_CTRL_IFACE), udp6)
1699CONFIG_CTRL_IFACE=udp
1700CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1701CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
1702endif
1703ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1704CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1705endif
1706ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
1707CONFIG_CTRL_IFACE=udp
1708CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1709CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1710endif
1711ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
1712CONFIG_CTRL_IFACE=udp
1713CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1714CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1715CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
1716endif
1717OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
1718endif
1719
1720ifdef CONFIG_CTRL_IFACE_DBUS_NEW
1721CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
1722OBJS += dbus/dbus_dict_helpers.o
1723OBJS += dbus/dbus_new_helpers.o
1724OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
1725OBJS += dbus/dbus_common.o
1726ifdef CONFIG_WPS
1727OBJS += dbus/dbus_new_handlers_wps.o
1728endif
1729ifdef CONFIG_P2P
1730OBJS += dbus/dbus_new_handlers_p2p.o
1731endif
1732ifndef DBUS_LIBS
1733DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
1734endif
1735ifndef DBUS_INCLUDE
1736DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
1737endif
1738ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
1739OBJS += dbus/dbus_new_introspect.o
1740CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
1741endif
1742CFLAGS += $(DBUS_INCLUDE)
1743LIBS += $(DBUS_LIBS)
1744endif
1745
1746ifdef CONFIG_READLINE
1747OBJS_c += ../src/utils/edit_readline.o
1748LIBS_c += -lreadline -lncurses
1749else
1750ifdef CONFIG_WPA_CLI_EDIT
1751OBJS_c += ../src/utils/edit.o
1752else
1753OBJS_c += ../src/utils/edit_simple.o
1754endif
1755endif
1756
1757ifdef CONFIG_NATIVE_WINDOWS
1758CFLAGS += -DCONFIG_NATIVE_WINDOWS
1759LIBS += -lws2_32 -lgdi32 -lcrypt32
1760LIBS_c += -lws2_32
1761LIBS_p += -lws2_32 -lgdi32
1762ifeq ($(CONFIG_CRYPTO), cryptoapi)
1763LIBS_p += -lcrypt32
1764endif
1765endif
1766
1767ifdef CONFIG_NO_STDOUT_DEBUG
1768CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1769ifndef CONFIG_CTRL_IFACE
1770CFLAGS += -DCONFIG_NO_WPA_MSG
1771endif
1772endif
1773
1774ifdef CONFIG_IPV6
1775# for eapol_test only
1776CFLAGS += -DCONFIG_IPV6
1777endif
1778
1779ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
1780CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
1781endif
1782
1783ifdef NEED_BASE64
1784OBJS += ../src/utils/base64.o
1785endif
1786
1787ifdef NEED_SME
1788OBJS += sme.o
1789CFLAGS += -DCONFIG_SME
1790endif
1791
1792OBJS += ../src/common/ieee802_11_common.o
1793OBJS += ../src/common/hw_features_common.o
1794
1795ifdef NEED_EAP_COMMON
1796OBJS += ../src/eap_common/eap_common.o
1797endif
1798
1799ifndef CONFIG_MAIN
1800CONFIG_MAIN=main
1801endif
1802
1803ifdef CONFIG_DEBUG_SYSLOG
1804CFLAGS += -DCONFIG_DEBUG_SYSLOG
1805ifdef CONFIG_DEBUG_SYSLOG_FACILITY
1806CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
1807endif
1808endif
1809
1810ifdef CONFIG_DEBUG_LINUX_TRACING
1811CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1812endif
1813
1814ifdef CONFIG_DEBUG_FILE
1815CFLAGS += -DCONFIG_DEBUG_FILE
1816endif
1817
1818ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1819CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1820endif
1821
1822ifdef CONFIG_FIPS
1823CFLAGS += -DCONFIG_FIPS
1824ifneq ($(CONFIG_TLS), openssl)
1825ifneq ($(CONFIG_TLS), wolfssl)
1826$(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
1827endif
1828endif
1829endif
1830
1831OBJS += $(SHA1OBJS) $(DESOBJS)
1832
1833OBJS_p += $(SHA1OBJS)
1834OBJS_p += $(SHA256OBJS)
1835OBJS_priv += $(SHA1OBJS)
1836
1837ifdef CONFIG_BGSCAN_SIMPLE
1838CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1839OBJS += bgscan_simple.o
1840NEED_BGSCAN=y
1841endif
1842
1843ifdef CONFIG_BGSCAN_LEARN
1844CFLAGS += -DCONFIG_BGSCAN_LEARN
1845OBJS += bgscan_learn.o
1846NEED_BGSCAN=y
1847endif
1848
1849ifdef NEED_BGSCAN
1850CFLAGS += -DCONFIG_BGSCAN
1851OBJS += bgscan.o
1852endif
1853
1854ifdef CONFIG_AUTOSCAN_EXPONENTIAL
1855CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
1856OBJS += autoscan_exponential.o
1857NEED_AUTOSCAN=y
1858endif
1859
1860ifdef CONFIG_AUTOSCAN_PERIODIC
1861CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
1862OBJS += autoscan_periodic.o
1863NEED_AUTOSCAN=y
1864endif
1865
1866ifdef NEED_AUTOSCAN
1867CFLAGS += -DCONFIG_AUTOSCAN
1868OBJS += autoscan.o
1869endif
1870
1871ifdef CONFIG_EXT_PASSWORD_TEST
1872OBJS += ../src/utils/ext_password_test.o
1873CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
1874NEED_EXT_PASSWORD=y
1875endif
1876
1877ifdef CONFIG_EXT_PASSWORD_FILE
1878OBJS += ../src/utils/ext_password_file.o
1879CFLAGS += -DCONFIG_EXT_PASSWORD_FILE
1880NEED_EXT_PASSWORD=y
1881endif
1882
1883ifdef NEED_EXT_PASSWORD
1884OBJS += ../src/utils/ext_password.o
1885CFLAGS += -DCONFIG_EXT_PASSWORD
1886endif
1887
1888ifdef NEED_GAS_SERVER
1889OBJS += ../src/common/gas_server.o
1890CFLAGS += -DCONFIG_GAS_SERVER
1891NEED_GAS=y
1892endif
1893
1894ifdef NEED_GAS
1895OBJS += ../src/common/gas.o
1896OBJS += gas_query.o
1897CFLAGS += -DCONFIG_GAS
1898NEED_OFFCHANNEL=y
1899endif
1900
1901ifdef NEED_OFFCHANNEL
1902OBJS += offchannel.o
1903CFLAGS += -DCONFIG_OFFCHANNEL
1904endif
1905
1906ifdef NEED_JSON
1907OBJS += ../src/utils/json.o
1908CFLAGS += -DCONFIG_JSON
1909endif
1910
1911ifdef CONFIG_MODULE_TESTS
1912CFLAGS += -DCONFIG_MODULE_TESTS
1913OBJS += wpas_module_tests.o
1914OBJS += ../src/utils/utils_module_tests.o
1915OBJS += ../src/common/common_module_tests.o
1916OBJS += ../src/crypto/crypto_module_tests.o
1917ifdef CONFIG_WPS
1918OBJS += ../src/wps/wps_module_tests.o
1919endif
1920endif
1921
1922OBJS += ../src/drivers/driver_common.o
1923OBJS_priv += ../src/drivers/driver_common.o
1924
1925OBJS += wpa_supplicant.o events.o bssid_ignore.o wpas_glue.o scan.o
1926OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
1927OBJS_t += ../src/radius/radius_client.o
1928OBJS_t += ../src/radius/radius.o
1929ifdef CONFIG_RADIUS_TLS
1930CFLAGS += -DCONFIG_RADIUS_TLS
1931endif
1932OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
1933
1934OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
1935OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
1936
1937OBJS += $(CONFIG_MAIN).o
1938
1939ifdef CONFIG_PRIVSEP
1940OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
1941OBJS_priv += $(OBJS_l2)
1942OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
1943OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
1944OBJS_priv += ../src/utils/common.o
1945OBJS_priv += ../src/utils/wpa_debug.o
1946OBJS_priv += ../src/utils/wpabuf.o
1947OBJS_priv += wpa_priv.o
1948ifdef CONFIG_DRIVER_NL80211
1949OBJS_priv += ../src/common/ieee802_11_common.o
1950endif
1951OBJS += ../src/l2_packet/l2_packet_privsep.o
1952OBJS += ../src/drivers/driver_privsep.o
1953EXTRA_progs += wpa_priv
1954else
1955OBJS += $(OBJS_d) ../src/drivers/drivers.o
1956OBJS += $(OBJS_l2)
1957endif
1958
1959ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1960CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1961OBJS += ../src/drivers/ndis_events.o
1962EXTRALIBS += -loleaut32 -lole32 -luuid
1963ifdef PLATFORMSDKLIB
1964EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1965else
1966EXTRALIBS += WbemUuid.Lib
1967endif
1968endif
1969
1970ifdef CONFIG_FST
1971CFLAGS += -DCONFIG_FST
1972ifdef CONFIG_FST_TEST
1973CFLAGS += -DCONFIG_FST_TEST
1974endif
1975FST_OBJS += ../src/fst/fst.o
1976FST_OBJS += ../src/fst/fst_session.o
1977FST_OBJS += ../src/fst/fst_iface.o
1978FST_OBJS += ../src/fst/fst_group.o
1979FST_OBJS += ../src/fst/fst_ctrl_aux.o
1980ifdef CONFIG_CTRL_IFACE
1981FST_OBJS += ../src/fst/fst_ctrl_iface.o
1982endif
1983OBJS += $(FST_OBJS)
1984OBJS_t += $(FST_OBJS)
1985OBJS_t2 += $(FST_OBJS)
1986OBJS_nfc += $(FST_OBJS)
1987endif
1988
1989ifdef CONFIG_WEP
1990CFLAGS += -DCONFIG_WEP
1991endif
1992
1993ifdef CONFIG_NO_TKIP
1994CFLAGS += -DCONFIG_NO_TKIP
1995endif
1996
1997dynamic_eap_methods: $(EAPDYN)
1998
1999_OBJS_VAR := OBJS_priv
2000include ../src/objs.mk
2001wpa_priv: $(BCHECK) $(OBJS_priv)
2002	$(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
2003	@$(E) "  LD " $@
2004
2005_OBJS_VAR := OBJS
2006include ../src/objs.mk
2007wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
2008	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
2009	@$(E) "  LD " $@
2010
2011_OBJS_VAR := OBJS_t
2012include ../src/objs.mk
2013eapol_test: $(OBJS_t)
2014	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
2015	@$(E) "  LD " $@
2016
2017_OBJS_VAR := OBJS_t2
2018include ../src/objs.mk
2019preauth_test: $(OBJS_t2)
2020	$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
2021	@$(E) "  LD " $@
2022
2023_OBJS_VAR := OBJS_p
2024include ../src/objs.mk
2025wpa_passphrase: $(OBJS_p)
2026	$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
2027	@$(E) "  LD " $@
2028
2029_OBJS_VAR := OBJS_c
2030include ../src/objs.mk
2031wpa_cli: $(OBJS_c)
2032	$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
2033	@$(E) "  LD " $@
2034
2035LIBCTRL += ../src/common/wpa_ctrl.o
2036LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
2037LIBCTRL += ../src/utils/common.o
2038LIBCTRL += ../src/utils/wpa_debug.o
2039LIBCTRLSO += ../src/common/wpa_ctrl.c
2040LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
2041LIBCTRLSO += ../src/utils/common.c
2042LIBCTRLSO += ../src/utils/wpa_debug.c
2043
2044_OBJS_VAR := LIBCTRL
2045include ../src/objs.mk
2046libwpa_client.a: $(LIBCTRL)
2047	$(Q)rm -f $@
2048	$(Q)$(AR) crs $@ $?
2049	@$(E) "  AR " $@
2050
2051libwpa_client.so: $(LIBCTRLSO)
2052	@$(E) "  CC  $@ ($^)"
2053	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
2054
2055OBJS_wpatest := libwpa_test.o
2056_OBJS_VAR := OBJS_wpatest
2057include ../src/objs.mk
2058libwpa_test1: $(OBJS_wpatest) libwpa_client.a
2059	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 $(OBJS_wpatest) libwpa_client.a $(LIBS_c)
2060	@$(E) "  LD " $@
2061
2062libwpa_test2: $(OBJS_wpatest) libwpa_client.so
2063	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 $(OBJS_wpatest) -L. -lwpa_client $(LIBS_c)
2064	@$(E) "  LD " $@
2065
2066_OBJS_VAR := OBJS_nfc
2067include ../src/objs.mk
2068nfc_pw_token: $(OBJS_nfc)
2069	$(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
2070	@$(E) "  LD " $@
2071
2072win_if_list: win_if_list.c
2073	$(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
2074	@$(E) "  LD " $@
2075
2076eap_psk.so: $(SRC_EAP_PSK)
2077	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2078		-Deap_peer_psk_register=eap_peer_method_dynamic_init
2079	@$(E) "  CC/LD " $@
2080
2081eap_pax.so: $(SRC_EAP_PAX)
2082	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2083		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2084	@$(E) "  CC/LD " $@
2085
2086eap_peap.so: $(SRC_EAP_PEAP)
2087	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2088		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2089	@$(E) "  CC/LD " $@
2090
2091eap_sake.so: $(SRC_EAP_SAKE)
2092	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2093		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2094	@$(E) "  CC/LD " $@
2095
2096eap_ikev2.so: $(SRC_EAP_IKEV2)
2097	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2098		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2099	@$(E) "  CC/LD " $@
2100
2101eap_eke.so: $(SRC_EAP_EKE)
2102	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2103		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2104	@$(E) "  CC/LD " $@
2105
2106eap_mschapv2.so: $(SRC_EAP_MSCHAPV2)
2107	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2108		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2109	@$(E) "  CC/LD " $@
2110
2111eap_fast.so: $(SRC_EAP_FAST)
2112	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2113		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2114	@$(E) "  CC/LD " $@
2115
2116eap_teap.so: $(SRC_EAP_TEAP)
2117	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2118		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2119	@$(E) "  CC/LD " $@
2120
2121eap_gpsk.so: $(SRC_EAP_GPSK)
2122	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
2123		-D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init
2124	@$(E) "  CC/LD " $@
2125
2126%.so: ../src/eap_peer/%.c
2127	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
2128		-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
2129	@$(E) "  CC/LD " $@
2130
2131%.service: %.service.in
2132	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
2133	@$(E) "  sed" $<
2134
2135%@.service: %.service.arg.in
2136	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
2137	@$(E) "  sed" $<
2138
2139wpa_supplicant.exe: wpa_supplicant
2140	mv -f $< $@
2141wpa_cli.exe: wpa_cli
2142	mv -f $< $@
2143wpa_passphrase.exe: wpa_passphrase
2144	mv -f $< $@
2145win_if_list.exe: win_if_list
2146	mv -f $< $@
2147eapol_test.exe: eapol_test
2148	mv -f $< $@
2149
2150WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
2151
2152windows-bin: $(WINALL)
2153	$(STRIP) $(WINALL)
2154
2155wpa_gui:
2156	@echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
2157
2158wpa_gui-qt4/Makefile:
2159	qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
2160
2161wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
2162	lrelease wpa_gui-qt4/wpa_gui.pro
2163
2164wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
2165	$(MAKE) -C wpa_gui-qt4
2166
2167FIPSDIR=/usr/local/ssl/fips-2.0
2168FIPSLD=$(FIPSDIR)/bin/fipsld
2169fips:
2170	$(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
2171
2172.PHONY: lcov-html
2173lcov-html: $(call BUILDOBJ,wpa_supplicant.gcda)
2174	lcov -c -d $(BUILDDIR) > lcov.info
2175	genhtml lcov.info --output-directory lcov-html
2176
2177PASN_CFLAGS := $(CFLAGS)
2178PASN_CFLAGS += -DCONFIG_PASN
2179
2180LIBPASNSO := ../src/utils/$(CONFIG_ELOOP).c
2181LIBPASNSO += ../src/utils/wpa_debug.c
2182LIBPASNSO += ../src/utils/wpabuf.c
2183LIBPASNSO += ../src/utils/os_$(CONFIG_OS).c
2184LIBPASNSO += ../src/utils/config.c
2185LIBPASNSO += ../src/utils/common.c
2186
2187ifdef NEED_BASE64
2188LIBPASNSO += ../src/utils/base64.c
2189endif
2190
2191ifdef CONFIG_WPA_TRACE
2192LIBPASNSO += ../src/utils/trace.c
2193endif
2194
2195ifdef CONFIG_EXT_PASSWORD_FILE
2196LIBPASNSO += ../src/utils/ext_password_file.c
2197endif
2198
2199ifdef CONFIG_EXT_PASSWORD_TEST
2200LIBPASNSO += ../src/utils/ext_password_test.c
2201endif
2202
2203ifdef NEED_EXT_PASSWORD
2204LIBPASNSO += ../src/utils/ext_password.c
2205endif
2206
2207ifdef CONFIG_SAE
2208LIBPASNSO += ../src/common/sae.c
2209endif
2210
2211ifdef CONFIG_SAE_PK
2212LIBPASNSO += ../src/common/sae_pk.c
2213endif
2214
2215ifndef CONFIG_NO_WPA
2216LIBPASNSO += ../src/common/wpa_common.c
2217endif
2218
2219LIBPASNSO += ../src/common/ieee802_11_common.c
2220
2221ifdef NEED_DRAGONFLY
2222LIBPASNSO += ../src/common/dragonfly.c
2223endif
2224
2225LIBPASNSO += ../src/common/ptksa_cache.c
2226LIBPASNSO += ../src/rsn_supp/pmksa_cache.c
2227
2228ifndef CONFIG_NO_WPA
2229LIBPASNSO += ../src/rsn_supp/wpa_ie.c
2230endif
2231
2232LIBPASNSO += ../src/ap/comeback_token.c
2233LIBPASNSO += ../src/ap/pmksa_cache_auth.c
2234
2235ifdef NEED_EAP_COMMON
2236LIBPASNSO += ../src/eap_common/eap_common.c
2237endif
2238
2239ifdef CHAP
2240LIBPASNSO += ../src/eap_common/chap.c
2241endif
2242
2243ifdef CONFIG_IEEE8021X_EAPOL
2244LIBPASNSO += ../src/eap_peer/eap.c
2245LIBPASNSO += ../src/eap_peer/eap_methods.c
2246LIBPASNSO += ../src/eapol_supp/eapol_supp_sm.c
2247endif
2248
2249ifeq ($(CONFIG_TLS), wolfssl)
2250LIBPASNSO += ../src/crypto/crypto_wolfssl.c
2251ifdef TLS_FUNCS
2252LIBPASNSO += ../src/crypto/tls_wolfssl.c
2253NEED_TLS_PRF_SHA256=y
2254LIBPASNSO += -lwolfssl -lm
2255endif
2256endif
2257
2258ifeq ($(CONFIG_TLS), openssl)
2259LIBPASNSO += ../src/crypto/crypto_openssl.c
2260ifdef TLS_FUNCS
2261LIBPASNSO += ../src/crypto/tls_openssl.c
2262LIBPASNSO += -lssl -lcrypto
2263NEED_TLS_PRF_SHA256=y
2264endif
2265endif
2266
2267ifeq ($(CONFIG_TLS), gnutls)
2268LIBPASNSO += ../src/crypto/crypto_$(CONFIG_CRYPTO).c
2269ifdef TLS_FUNCS
2270LIBPASNSO += ../src/crypto/tls_gnutls.c
2271LIBPASNSO += -lgnutls -lgpg-error
2272LIBPASNSO += -lgcrypt
2273endif
2274endif
2275
2276ifdef NEED_TLS_PRF_SHA256
2277LIBPASNSO += ../src/crypto/sha256-tlsprf.c
2278endif
2279
2280ifdef NEED_SHA512
2281LIBPASNSO += ../src/crypto/sha512-prf.c
2282endif
2283
2284ifdef NEED_SHA384
2285LIBPASNSO += ../src/crypto/sha384-prf.c
2286endif
2287
2288LIBPASNSO += ../src/crypto/sha256-prf.c
2289
2290ifdef NEED_HMAC_SHA512_KDF
2291LIBPASNSO += ../src/crypto/sha512-kdf.c
2292endif
2293
2294ifdef NEED_HMAC_SHA384_KDF
2295LIBPASNSO += ../src/crypto/sha384-kdf.c
2296endif
2297
2298ifdef NEED_HMAC_SHA256_KDF
2299LIBPASNSO += ../src/crypto/sha256-kdf.c
2300endif
2301
2302ifdef NEED_DH_GROUPS
2303LIBPASNSO += ../src/crypto/dh_groups.c
2304endif
2305
2306ifdef NEED_AES_SIV
2307LIBPASNSO += ../src/crypto/aes-siv.c
2308endif
2309
2310ifdef NEED_AES_CTR
2311LIBPASNSO += ../src/crypto/aes-ctr.c
2312endif
2313
2314ifdef NEED_SHA1
2315LIBPASNSO += ../src/crypto/sha1-prf.c
2316ifdef NEED_TLS_PRF
2317LIBPASNSO += ../src/crypto/sha1-tlsprf.c
2318endif
2319endif
2320
2321LIBPASNSO += ../src/pasn/pasn_initiator.c
2322LIBPASNSO += ../src/pasn/pasn_responder.c
2323LIBPASNSO += ../src/pasn/pasn_common.c
2324
2325libpasn.so: $(LIBPASNSO)
2326	@$(E) "  CC  $@ ($^)"
2327	$(Q)$(CC) $(LDFLAGS) -o $@ $(PASN_CFLAGS) -shared -fPIC -lcrypto $^
2328
2329clean: common-clean
2330	$(MAKE) -C ../src clean
2331	$(MAKE) -C dbus clean
2332	rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
2333	rm -f eap_*.so $(WINALL) eapol_test preauth_test
2334	rm -f wpa_priv
2335	rm -f nfc_pw_token
2336	rm -f lcov.info
2337	rm -rf lcov-html
2338	rm -f libwpa_client.a
2339	rm -f libpasn.so
2340	rm -f libwpa_client.so
2341	rm -f libwpa_test1 libwpa_test2
2342	rm -f wpa_passphrase
2343