1#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# This software may be distributed under the terms of the BSD license.
5# See README for more details.
6#
7
8LOCAL_PATH := $(call my-dir)
9PKG_CONFIG ?= pkg-config
10
11ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
12  CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
13endif
14
15include $(LOCAL_PATH)/android.config
16
17# To ignore possible wrong network configurations
18L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
19
20L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
21
22# Set Android log name
23L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
24
25# Disable unused parameter warnings
26L_CFLAGS += -Wno-unused-parameter
27
28# Set Android extended P2P functionality
29L_CFLAGS += -DANDROID_P2P
30
31ifeq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
32L_CFLAGS += -DANDROID_LIB_STUB
33endif
34
35ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB_EVENT),)
36L_CFLAGS += -DANDROID_LIB_EVENT
37endif
38
39# Disable roaming in wpa_supplicant
40ifdef CONFIG_NO_ROAMING
41L_CFLAGS += -DCONFIG_NO_ROAMING
42endif
43
44# Use Android specific directory for control interface sockets
45L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
46L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/misc/wifi/sockets\"
47
48# Use Android specific directory for wpa_cli command completion history
49L_CFLAGS += -DCONFIG_WPA_CLI_HISTORY_DIR=\"/data/misc/wifi\"
50
51# To force sizeof(enum) = 4
52ifeq ($(TARGET_ARCH),arm)
53L_CFLAGS += -mabi=aapcs-linux
54endif
55
56# C++ flags for binder interface
57L_CPPFLAGS := -std=c++11 -Wall -Werror
58# TODO: Remove these allowed warnings later.
59L_CPPFLAGS += -Wno-unused-variable -Wno-unused-parameter
60L_CPPFLAGS += -Wno-unused-private-field
61
62INCLUDES = $(LOCAL_PATH)
63INCLUDES += $(LOCAL_PATH)/src
64INCLUDES += $(LOCAL_PATH)/src/common
65# INCLUDES += $(LOCAL_PATH)/src/crypto # To force proper includes
66INCLUDES += $(LOCAL_PATH)/src/drivers
67INCLUDES += $(LOCAL_PATH)/src/eap_common
68INCLUDES += $(LOCAL_PATH)/src/eapol_supp
69INCLUDES += $(LOCAL_PATH)/src/eap_peer
70INCLUDES += $(LOCAL_PATH)/src/eap_server
71INCLUDES += $(LOCAL_PATH)/src/hlr_auc_gw
72INCLUDES += $(LOCAL_PATH)/src/l2_packet
73INCLUDES += $(LOCAL_PATH)/src/radius
74INCLUDES += $(LOCAL_PATH)/src/rsn_supp
75INCLUDES += $(LOCAL_PATH)/src/tls
76INCLUDES += $(LOCAL_PATH)/src/utils
77INCLUDES += $(LOCAL_PATH)/src/wps
78INCLUDES += system/security/keystore/include
79ifdef CONFIG_DRIVER_NL80211
80ifneq ($(wildcard external/libnl),)
81INCLUDES += external/libnl/include
82else
83INCLUDES += external/libnl-headers
84endif
85endif
86
87ifdef CONFIG_FIPS
88CONFIG_NO_RANDOM_POOL=
89CONFIG_OPENSSL_CMAC=y
90endif
91
92OBJS = config.c
93OBJS += notify.c
94OBJS += bss.c
95OBJS += eap_register.c
96OBJS += src/utils/common.c
97OBJS += src/utils/config.c
98OBJS += src/utils/wpa_debug.c
99OBJS += src/utils/wpabuf.c
100OBJS += src/utils/bitfield.c
101OBJS += src/utils/ip_addr.c
102OBJS += src/utils/crc32.c
103OBJS += wmm_ac.c
104OBJS += op_classes.c
105OBJS += rrm.c
106OBJS += twt.c
107OBJS += robust_av.c
108OBJS_p = wpa_passphrase.c
109OBJS_p += src/utils/common.c
110OBJS_p += src/utils/wpa_debug.c
111OBJS_p += src/utils/wpabuf.c
112OBJS_c = wpa_cli.c src/common/wpa_ctrl.c
113OBJS_c += src/utils/wpa_debug.c
114OBJS_c += src/utils/common.c
115OBJS_c += src/common/cli.c
116OBJS_d =
117OBJS_priv =
118
119ifndef CONFIG_OS
120ifdef CONFIG_NATIVE_WINDOWS
121CONFIG_OS=win32
122else
123CONFIG_OS=unix
124endif
125endif
126
127ifeq ($(CONFIG_OS), internal)
128L_CFLAGS += -DOS_NO_C_LIB_DEFINES
129endif
130
131OBJS += src/utils/os_$(CONFIG_OS).c
132OBJS_p += src/utils/os_$(CONFIG_OS).c
133OBJS_c += src/utils/os_$(CONFIG_OS).c
134
135ifdef CONFIG_WPA_TRACE
136L_CFLAGS += -DWPA_TRACE
137OBJS += src/utils/trace.c
138OBJS_p += src/utils/trace.c
139OBJS_c += src/utils/trace.c
140LDFLAGS += -rdynamic
141L_CFLAGS += -funwind-tables
142ifdef CONFIG_WPA_TRACE_BFD
143L_CFLAGS += -DWPA_TRACE_BFD
144LIBS += -lbfd
145LIBS_p += -lbfd
146LIBS_c += -lbfd
147endif
148endif
149
150ifndef CONFIG_ELOOP
151CONFIG_ELOOP=eloop
152endif
153OBJS += src/utils/$(CONFIG_ELOOP).c
154OBJS_c += src/utils/$(CONFIG_ELOOP).c
155
156ifdef CONFIG_ELOOP_POLL
157L_CFLAGS += -DCONFIG_ELOOP_POLL
158endif
159
160ifdef CONFIG_ELOOP_EPOLL
161L_CFLAGS += -DCONFIG_ELOOP_EPOLL
162endif
163
164ifdef CONFIG_EAPOL_TEST
165L_CFLAGS += -Werror -DEAPOL_TEST
166endif
167
168ifdef CONFIG_HT_OVERRIDES
169L_CFLAGS += -DCONFIG_HT_OVERRIDES
170endif
171
172ifdef CONFIG_VHT_OVERRIDES
173L_CFLAGS += -DCONFIG_VHT_OVERRIDES
174endif
175
176ifdef CONFIG_HE_OVERRIDES
177L_CFLAGS += -DCONFIG_HE_OVERRIDES
178endif
179
180ifndef CONFIG_BACKEND
181CONFIG_BACKEND=file
182endif
183
184ifeq ($(CONFIG_BACKEND), file)
185OBJS += config_file.c
186ifndef CONFIG_NO_CONFIG_BLOBS
187NEED_BASE64=y
188endif
189L_CFLAGS += -DCONFIG_BACKEND_FILE
190endif
191
192ifeq ($(CONFIG_BACKEND), winreg)
193OBJS += config_winreg.c
194endif
195
196ifeq ($(CONFIG_BACKEND), none)
197OBJS += config_none.c
198endif
199
200ifdef CONFIG_NO_CONFIG_WRITE
201L_CFLAGS += -DCONFIG_NO_CONFIG_WRITE
202endif
203
204ifdef CONFIG_NO_CONFIG_BLOBS
205L_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
206endif
207
208ifdef CONFIG_NO_SCAN_PROCESSING
209L_CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
210endif
211
212ifdef CONFIG_SUITEB
213L_CFLAGS += -DCONFIG_SUITEB
214endif
215
216ifdef CONFIG_SUITEB192
217L_CFLAGS += -DCONFIG_SUITEB192
218NEED_SHA384=y
219endif
220
221ifdef CONFIG_OCV
222L_CFLAGS += -DCONFIG_OCV
223OBJS += src/common/ocv.c
224endif
225
226ifdef CONFIG_IEEE80211R
227L_CFLAGS += -DCONFIG_IEEE80211R
228OBJS += src/rsn_supp/wpa_ft.c
229endif
230
231ifdef CONFIG_MESH
232NEED_80211_COMMON=y
233NEED_AES_SIV=y
234CONFIG_SAE=y
235CONFIG_AP=y
236L_CFLAGS += -DCONFIG_MESH
237OBJS += mesh.c
238OBJS += mesh_mpm.c
239OBJS += mesh_rsn.c
240endif
241
242ifdef CONFIG_SAE
243L_CFLAGS += -DCONFIG_SAE
244OBJS += src/common/sae.c
245ifdef CONFIG_SAE_PK
246L_CFLAGS += -DCONFIG_SAE_PK
247OBJS += src/common/sae_pk.c
248endif
249NEED_ECC=y
250NEED_DH_GROUPS=y
251NEED_HMAC_SHA256_KDF=y
252NEED_DRAGONFLY=y
253ifdef CONFIG_TESTING_OPTIONS
254NEED_DH_GROUPS_ALL=y
255endif
256endif
257
258ifdef CONFIG_DPP
259L_CFLAGS += -DCONFIG_DPP
260OBJS += src/common/dpp.c
261OBJS += src/common/dpp_auth.c
262OBJS += src/common/dpp_backup.c
263OBJS += src/common/dpp_crypto.c
264OBJS += src/common/dpp_pkex.c
265OBJS += src/common/dpp_reconfig.c
266OBJS += src/common/dpp_tcp.c
267OBJS += dpp_supplicant.c
268NEED_AES_SIV=y
269NEED_HMAC_SHA256_KDF=y
270NEED_HMAC_SHA384_KDF=y
271NEED_HMAC_SHA512_KDF=y
272NEED_SHA384=y
273NEED_SHA512=y
274NEED_ECC=y
275NEED_JSON=y
276NEED_GAS_SERVER=y
277NEED_BASE64=y
278NEED_ASN1=y
279ifdef CONFIG_DPP2
280L_CFLAGS += -DCONFIG_DPP2
281endif
282ifdef CONFIG_DPP3
283L_CFLAGS += -DCONFIG_DPP3
284endif
285endif
286
287ifdef CONFIG_OWE
288L_CFLAGS += -DCONFIG_OWE
289NEED_ECC=y
290NEED_HMAC_SHA256_KDF=y
291NEED_HMAC_SHA384_KDF=y
292NEED_HMAC_SHA512_KDF=y
293NEED_SHA384=y
294NEED_SHA512=y
295endif
296
297ifdef CONFIG_FILS
298L_CFLAGS += -DCONFIG_FILS
299NEED_SHA384=y
300NEED_AES_SIV=y
301ifdef CONFIG_FILS_SK_PFS
302L_CFLAGS += -DCONFIG_FILS_SK_PFS
303NEED_ECC=y
304endif
305endif
306
307ifdef CONFIG_MBO
308CONFIG_WNM=y
309endif
310
311ifdef CONFIG_WNM
312L_CFLAGS += -DCONFIG_WNM
313OBJS += wnm_sta.c
314endif
315
316ifdef CONFIG_TDLS
317L_CFLAGS += -DCONFIG_TDLS
318OBJS += src/rsn_supp/tdls.c
319endif
320
321ifdef CONFIG_TDLS_TESTING
322L_CFLAGS += -DCONFIG_TDLS_TESTING
323endif
324
325ifdef CONFIG_PMKSA_CACHE_EXTERNAL
326L_CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
327endif
328
329ifndef CONFIG_NO_WPA
330OBJS += src/rsn_supp/wpa.c
331OBJS += src/rsn_supp/preauth.c
332OBJS += src/rsn_supp/pmksa_cache.c
333OBJS += src/rsn_supp/wpa_ie.c
334OBJS += src/common/wpa_common.c
335NEED_AES=y
336NEED_SHA1=y
337NEED_MD5=y
338NEED_RC4=y
339else
340L_CFLAGS += -DCONFIG_NO_WPA
341endif
342
343ifdef CONFIG_IBSS_RSN
344NEED_RSN_AUTHENTICATOR=y
345L_CFLAGS += -DCONFIG_IBSS_RSN
346L_CFLAGS += -DCONFIG_NO_VLAN
347OBJS += ibss_rsn.c
348endif
349
350ifdef CONFIG_P2P
351OBJS += p2p_supplicant.c
352OBJS += p2p_supplicant_sd.c
353OBJS += src/p2p/p2p.c
354OBJS += src/p2p/p2p_utils.c
355OBJS += src/p2p/p2p_parse.c
356OBJS += src/p2p/p2p_build.c
357OBJS += src/p2p/p2p_go_neg.c
358OBJS += src/p2p/p2p_sd.c
359OBJS += src/p2p/p2p_pd.c
360OBJS += src/p2p/p2p_invitation.c
361OBJS += src/p2p/p2p_dev_disc.c
362OBJS += src/p2p/p2p_group.c
363OBJS += src/ap/p2p_hostapd.c
364L_CFLAGS += -DCONFIG_P2P
365NEED_GAS=y
366NEED_OFFCHANNEL=y
367CONFIG_WPS=y
368CONFIG_AP=y
369ifdef CONFIG_P2P_STRICT
370L_CFLAGS += -DCONFIG_P2P_STRICT
371endif
372ifdef CONFIG_WIFI_DISPLAY
373L_CFLAGS += -DCONFIG_WIFI_DISPLAY
374OBJS += wifi_display.c
375endif
376endif
377
378ifdef CONFIG_PASN
379L_CFLAGS += -DCONFIG_PASN
380L_CFLAGS += -DCONFIG_PTKSA_CACHE
381NEED_HMAC_SHA256_KDF=y
382NEED_HMAC_SHA384_KDF=y
383NEED_SHA256=y
384NEED_SHA384=y
385OBJS += src/common/ptksa_cache.c
386OBJS += pasn_supplicant.c
387endif
388
389ifdef CONFIG_HS20
390OBJS += hs20_supplicant.c
391L_CFLAGS += -DCONFIG_HS20
392CONFIG_INTERWORKING=y
393endif
394
395ifdef CONFIG_INTERWORKING
396OBJS += interworking.c
397L_CFLAGS += -DCONFIG_INTERWORKING
398NEED_GAS=y
399endif
400
401ifdef CONFIG_FST
402L_CFLAGS += -DCONFIG_FST
403OBJS += src/fst/fst.c
404OBJS += src/fst/fst_session.c
405OBJS += src/fst/fst_iface.c
406OBJS += src/fst/fst_group.c
407OBJS += src/fst/fst_ctrl_aux.c
408ifdef CONFIG_FST_TEST
409L_CFLAGS += -DCONFIG_FST_TEST
410endif
411ifdef CONFIG_CTRL_IFACE
412OBJS += src/fst/fst_ctrl_iface.c
413endif
414endif
415
416ifdef CONFIG_WEP
417L_CFLAGS += -DCONFIG_WEP
418endif
419
420ifdef CONFIG_NO_TKIP
421L_CFLAGS += -DCONFIG_NO_TKIP
422endif
423
424
425include $(LOCAL_PATH)/src/drivers/drivers.mk
426
427ifdef CONFIG_AP
428OBJS_d += $(DRV_BOTH_OBJS)
429L_CFLAGS += $(DRV_BOTH_CFLAGS)
430LDFLAGS += $(DRV_BOTH_LDFLAGS)
431LIBS += $(DRV_BOTH_LIBS)
432else
433NEED_AP_MLME=
434OBJS_d += $(DRV_WPA_OBJS)
435L_CFLAGS += $(DRV_WPA_CFLAGS)
436LDFLAGS += $(DRV_WPA_LDFLAGS)
437LIBS += $(DRV_WPA_LIBS)
438endif
439
440ifndef CONFIG_L2_PACKET
441CONFIG_L2_PACKET=linux
442endif
443
444OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
445
446ifeq ($(CONFIG_L2_PACKET), pcap)
447ifdef CONFIG_WINPCAP
448L_CFLAGS += -DCONFIG_WINPCAP
449LIBS += -lwpcap -lpacket
450LIBS_w += -lwpcap
451else
452LIBS += -ldnet -lpcap
453endif
454endif
455
456ifeq ($(CONFIG_L2_PACKET), winpcap)
457LIBS += -lwpcap -lpacket
458LIBS_w += -lwpcap
459endif
460
461ifeq ($(CONFIG_L2_PACKET), freebsd)
462LIBS += -lpcap
463endif
464
465ifdef CONFIG_ERP
466L_CFLAGS += -DCONFIG_ERP
467NEED_HMAC_SHA256_KDF=y
468endif
469
470ifdef CONFIG_EAP_TLS
471# EAP-TLS
472ifeq ($(CONFIG_EAP_TLS), dyn)
473L_CFLAGS += -DEAP_TLS_DYNAMIC
474EAPDYN += src/eap_peer/eap_tls.so
475else
476L_CFLAGS += -DEAP_TLS
477OBJS += src/eap_peer/eap_tls.c
478endif
479TLS_FUNCS=y
480CONFIG_IEEE8021X_EAPOL=y
481endif
482
483ifdef CONFIG_EAP_UNAUTH_TLS
484# EAP-UNAUTH-TLS
485L_CFLAGS += -DEAP_UNAUTH_TLS
486ifndef CONFIG_EAP_TLS
487OBJS += src/eap_peer/eap_tls.c
488TLS_FUNCS=y
489endif
490CONFIG_IEEE8021X_EAPOL=y
491endif
492
493ifdef CONFIG_EAP_PEAP
494# EAP-PEAP
495ifeq ($(CONFIG_EAP_PEAP), dyn)
496L_CFLAGS += -DEAP_PEAP_DYNAMIC
497EAPDYN += src/eap_peer/eap_peap.so
498else
499L_CFLAGS += -DEAP_PEAP
500OBJS += src/eap_peer/eap_peap.c
501OBJS += src/eap_common/eap_peap_common.c
502endif
503TLS_FUNCS=y
504CONFIG_IEEE8021X_EAPOL=y
505endif
506
507ifdef CONFIG_EAP_TTLS
508# EAP-TTLS
509ifeq ($(CONFIG_EAP_TTLS), dyn)
510L_CFLAGS += -DEAP_TTLS_DYNAMIC
511EAPDYN += src/eap_peer/eap_ttls.so
512else
513L_CFLAGS += -DEAP_TTLS
514OBJS += src/eap_peer/eap_ttls.c
515endif
516TLS_FUNCS=y
517ifndef CONFIG_FIPS
518MS_FUNCS=y
519CHAP=y
520endif
521CONFIG_IEEE8021X_EAPOL=y
522endif
523
524ifdef CONFIG_EAP_MD5
525# EAP-MD5
526ifeq ($(CONFIG_EAP_MD5), dyn)
527L_CFLAGS += -DEAP_MD5_DYNAMIC
528EAPDYN += src/eap_peer/eap_md5.so
529else
530L_CFLAGS += -DEAP_MD5
531OBJS += src/eap_peer/eap_md5.c
532endif
533CHAP=y
534CONFIG_IEEE8021X_EAPOL=y
535endif
536
537# backwards compatibility for old spelling
538ifdef CONFIG_MSCHAPV2
539ifndef CONFIG_EAP_MSCHAPV2
540CONFIG_EAP_MSCHAPV2=y
541endif
542endif
543
544ifdef CONFIG_EAP_MSCHAPV2
545# EAP-MSCHAPv2
546ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
547L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
548EAPDYN += src/eap_peer/eap_mschapv2.so
549EAPDYN += src/eap_peer/mschapv2.so
550else
551L_CFLAGS += -DEAP_MSCHAPv2
552OBJS += src/eap_peer/eap_mschapv2.c
553OBJS += src/eap_peer/mschapv2.c
554endif
555MS_FUNCS=y
556CONFIG_IEEE8021X_EAPOL=y
557endif
558
559ifdef CONFIG_EAP_GTC
560# EAP-GTC
561ifeq ($(CONFIG_EAP_GTC), dyn)
562L_CFLAGS += -DEAP_GTC_DYNAMIC
563EAPDYN += src/eap_peer/eap_gtc.so
564else
565L_CFLAGS += -DEAP_GTC
566OBJS += src/eap_peer/eap_gtc.c
567endif
568CONFIG_IEEE8021X_EAPOL=y
569endif
570
571ifdef CONFIG_EAP_OTP
572# EAP-OTP
573ifeq ($(CONFIG_EAP_OTP), dyn)
574L_CFLAGS += -DEAP_OTP_DYNAMIC
575EAPDYN += src/eap_peer/eap_otp.so
576else
577L_CFLAGS += -DEAP_OTP
578OBJS += src/eap_peer/eap_otp.c
579endif
580CONFIG_IEEE8021X_EAPOL=y
581endif
582
583ifdef CONFIG_EAP_SIM
584# EAP-SIM
585ifeq ($(CONFIG_EAP_SIM), dyn)
586L_CFLAGS += -DEAP_SIM_DYNAMIC
587EAPDYN += src/eap_peer/eap_sim.so
588else
589L_CFLAGS += -DEAP_SIM
590OBJS += src/eap_peer/eap_sim.c
591endif
592CONFIG_IEEE8021X_EAPOL=y
593CONFIG_EAP_SIM_COMMON=y
594NEED_AES_CBC=y
595endif
596
597ifdef CONFIG_EAP_LEAP
598# EAP-LEAP
599ifeq ($(CONFIG_EAP_LEAP), dyn)
600L_CFLAGS += -DEAP_LEAP_DYNAMIC
601EAPDYN += src/eap_peer/eap_leap.so
602else
603L_CFLAGS += -DEAP_LEAP
604OBJS += src/eap_peer/eap_leap.c
605endif
606MS_FUNCS=y
607CONFIG_IEEE8021X_EAPOL=y
608endif
609
610ifdef CONFIG_EAP_PSK
611# EAP-PSK
612ifeq ($(CONFIG_EAP_PSK), dyn)
613L_CFLAGS += -DEAP_PSK_DYNAMIC
614EAPDYN += src/eap_peer/eap_psk.so
615else
616L_CFLAGS += -DEAP_PSK
617OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
618endif
619CONFIG_IEEE8021X_EAPOL=y
620NEED_AES=y
621NEED_AES_ENCBLOCK=y
622NEED_AES_EAX=y
623endif
624
625ifdef CONFIG_EAP_AKA
626# EAP-AKA
627ifeq ($(CONFIG_EAP_AKA), dyn)
628L_CFLAGS += -DEAP_AKA_DYNAMIC
629EAPDYN += src/eap_peer/eap_aka.so
630else
631L_CFLAGS += -DEAP_AKA
632OBJS += src/eap_peer/eap_aka.c
633endif
634CONFIG_IEEE8021X_EAPOL=y
635CONFIG_EAP_SIM_COMMON=y
636NEED_AES_CBC=y
637endif
638
639ifdef CONFIG_EAP_PROXY
640L_CFLAGS += -DCONFIG_EAP_PROXY
641OBJS += src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).c
642include $(LOCAL_PATH)/eap_proxy_$(CONFIG_EAP_PROXY).mk
643CONFIG_IEEE8021X_EAPOL=y
644endif
645
646ifdef CONFIG_EAP_AKA_PRIME
647# EAP-AKA'
648ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
649L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
650else
651L_CFLAGS += -DEAP_AKA_PRIME
652endif
653endif
654
655ifdef CONFIG_EAP_SIM_COMMON
656OBJS += src/eap_common/eap_sim_common.c
657NEED_AES=y
658NEED_FIPS186_2_PRF=y
659endif
660
661ifdef CONFIG_EAP_FAST
662# EAP-FAST
663ifeq ($(CONFIG_EAP_FAST), dyn)
664L_CFLAGS += -DEAP_FAST_DYNAMIC
665EAPDYN += src/eap_peer/eap_fast.so
666EAPDYN += src/eap_common/eap_fast_common.c
667else
668L_CFLAGS += -DEAP_FAST
669OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
670OBJS += src/eap_common/eap_fast_common.c
671endif
672TLS_FUNCS=y
673CONFIG_IEEE8021X_EAPOL=y
674NEED_T_PRF=y
675endif
676
677ifdef CONFIG_EAP_TEAP
678# EAP-TEAP
679ifeq ($(CONFIG_EAP_TEAP), dyn)
680L_CFLAGS += -DEAP_YEAP_DYNAMIC
681EAPDYN += src/eap_peer/eap_teap.so
682EAPDYN += src/eap_common/eap_teap_common.c
683else
684L_CFLAGS += -DEAP_TEAP
685OBJS += src/eap_peer/eap_teap.c src/eap_peer/eap_teap_pac.c
686OBJS += src/eap_common/eap_teap_common.c
687endif
688TLS_FUNCS=y
689CONFIG_IEEE8021X_EAPOL=y
690NEED_T_PRF=y
691NEED_SHA384=y
692NEED_TLS_PRF_SHA256=y
693NEED_TLS_PRF_SHA384=y
694endif
695
696ifdef CONFIG_EAP_PAX
697# EAP-PAX
698ifeq ($(CONFIG_EAP_PAX), dyn)
699L_CFLAGS += -DEAP_PAX_DYNAMIC
700EAPDYN += src/eap_peer/eap_pax.so
701else
702L_CFLAGS += -DEAP_PAX
703OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
704endif
705CONFIG_IEEE8021X_EAPOL=y
706endif
707
708ifdef CONFIG_EAP_SAKE
709# EAP-SAKE
710ifeq ($(CONFIG_EAP_SAKE), dyn)
711L_CFLAGS += -DEAP_SAKE_DYNAMIC
712EAPDYN += src/eap_peer/eap_sake.so
713else
714L_CFLAGS += -DEAP_SAKE
715OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
716endif
717CONFIG_IEEE8021X_EAPOL=y
718endif
719
720ifdef CONFIG_EAP_GPSK
721# EAP-GPSK
722ifeq ($(CONFIG_EAP_GPSK), dyn)
723L_CFLAGS += -DEAP_GPSK_DYNAMIC
724EAPDYN += src/eap_peer/eap_gpsk.so
725else
726L_CFLAGS += -DEAP_GPSK
727OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
728endif
729CONFIG_IEEE8021X_EAPOL=y
730ifdef CONFIG_EAP_GPSK_SHA256
731L_CFLAGS += -DEAP_GPSK_SHA256
732endif
733endif
734
735ifdef CONFIG_EAP_PWD
736L_CFLAGS += -DEAP_PWD
737OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
738CONFIG_IEEE8021X_EAPOL=y
739NEED_ECC=y
740NEED_DRAGONFLY=y
741endif
742
743ifdef CONFIG_EAP_EKE
744# EAP-EKE
745ifeq ($(CONFIG_EAP_EKE), dyn)
746L_CFLAGS += -DEAP_EKE_DYNAMIC
747EAPDYN += src/eap_peer/eap_eke.so
748else
749L_CFLAGS += -DEAP_EKE
750OBJS += src/eap_peer/eap_eke.c src/eap_common/eap_eke_common.c
751endif
752CONFIG_IEEE8021X_EAPOL=y
753NEED_DH_GROUPS=y
754NEED_DH_GROUPS_ALL=y
755NEED_AES_CBC=y
756endif
757
758ifdef CONFIG_WPS
759# EAP-WSC
760L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
761OBJS += wps_supplicant.c
762OBJS += src/utils/uuid.c
763OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
764OBJS += src/wps/wps.c
765OBJS += src/wps/wps_common.c
766OBJS += src/wps/wps_attr_parse.c
767OBJS += src/wps/wps_attr_build.c
768OBJS += src/wps/wps_attr_process.c
769OBJS += src/wps/wps_dev_attr.c
770OBJS += src/wps/wps_enrollee.c
771OBJS += src/wps/wps_registrar.c
772CONFIG_IEEE8021X_EAPOL=y
773NEED_DH_GROUPS=y
774NEED_BASE64=y
775NEED_AES_CBC=y
776NEED_MODEXP=y
777
778ifdef CONFIG_WPS_NFC
779L_CFLAGS += -DCONFIG_WPS_NFC
780OBJS += src/wps/ndef.c
781NEED_WPS_OOB=y
782endif
783
784ifdef NEED_WPS_OOB
785L_CFLAGS += -DCONFIG_WPS_OOB
786endif
787
788ifdef CONFIG_WPS_ER
789CONFIG_WPS_UPNP=y
790L_CFLAGS += -DCONFIG_WPS_ER
791OBJS += src/wps/wps_er.c
792OBJS += src/wps/wps_er_ssdp.c
793endif
794
795ifdef CONFIG_WPS_UPNP
796L_CFLAGS += -DCONFIG_WPS_UPNP
797OBJS += src/wps/wps_upnp.c
798OBJS += src/wps/wps_upnp_ssdp.c
799OBJS += src/wps/wps_upnp_web.c
800OBJS += src/wps/wps_upnp_event.c
801OBJS += src/wps/wps_upnp_ap.c
802OBJS += src/wps/upnp_xml.c
803OBJS += src/wps/httpread.c
804OBJS += src/wps/http_client.c
805OBJS += src/wps/http_server.c
806endif
807
808ifdef CONFIG_WPS_STRICT
809L_CFLAGS += -DCONFIG_WPS_STRICT
810OBJS += src/wps/wps_validate.c
811endif
812
813ifdef CONFIG_WPS_TESTING
814L_CFLAGS += -DCONFIG_WPS_TESTING
815endif
816
817ifdef CONFIG_WPS_REG_DISABLE_OPEN
818L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
819endif
820
821endif
822
823ifdef CONFIG_EAP_IKEV2
824# EAP-IKEv2
825ifeq ($(CONFIG_EAP_IKEV2), dyn)
826L_CFLAGS += -DEAP_IKEV2_DYNAMIC
827EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
828EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
829else
830L_CFLAGS += -DEAP_IKEV2
831OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
832OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
833endif
834CONFIG_IEEE8021X_EAPOL=y
835NEED_DH_GROUPS=y
836NEED_DH_GROUPS_ALL=y
837NEED_MODEXP=y
838NEED_CIPHER=y
839endif
840
841ifdef CONFIG_EAP_VENDOR_TEST
842ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
843L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
844EAPDYN += src/eap_peer/eap_vendor_test.so
845else
846L_CFLAGS += -DEAP_VENDOR_TEST
847OBJS += src/eap_peer/eap_vendor_test.c
848endif
849CONFIG_IEEE8021X_EAPOL=y
850endif
851
852ifdef CONFIG_EAP_TNC
853# EAP-TNC
854L_CFLAGS += -DEAP_TNC
855OBJS += src/eap_peer/eap_tnc.c
856OBJS += src/eap_peer/tncc.c
857NEED_BASE64=y
858ifndef CONFIG_NATIVE_WINDOWS
859ifndef CONFIG_DRIVER_BSD
860LIBS += -ldl
861endif
862endif
863endif
864
865ifdef CONFIG_IEEE8021X_EAPOL
866# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
867L_CFLAGS += -DIEEE8021X_EAPOL
868OBJS += src/eapol_supp/eapol_supp_sm.c
869OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
870NEED_EAP_COMMON=y
871ifdef CONFIG_DYNAMIC_EAP_METHODS
872L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
873LIBS += -ldl -rdynamic
874endif
875endif
876
877ifdef CONFIG_AP
878NEED_EAP_COMMON=y
879NEED_RSN_AUTHENTICATOR=y
880L_CFLAGS += -DCONFIG_AP
881OBJS += ap.c
882L_CFLAGS += -DCONFIG_NO_RADIUS
883L_CFLAGS += -DCONFIG_NO_ACCOUNTING
884L_CFLAGS += -DCONFIG_NO_VLAN
885OBJS += src/ap/hostapd.c
886OBJS += src/ap/wpa_auth_glue.c
887OBJS += src/ap/utils.c
888OBJS += src/ap/authsrv.c
889OBJS += src/ap/ap_config.c
890OBJS += src/ap/sta_info.c
891OBJS += src/ap/tkip_countermeasures.c
892OBJS += src/ap/ap_mlme.c
893OBJS += src/ap/ieee802_1x.c
894OBJS += src/eapol_auth/eapol_auth_sm.c
895OBJS += src/ap/ieee802_11_auth.c
896OBJS += src/ap/ieee802_11_shared.c
897OBJS += src/ap/drv_callbacks.c
898OBJS += src/ap/ap_drv_ops.c
899OBJS += src/ap/beacon.c
900OBJS += src/ap/bss_load.c
901OBJS += src/ap/eap_user_db.c
902OBJS += src/ap/neighbor_db.c
903OBJS += src/ap/rrm.c
904OBJS += src/ap/ieee802_11_ht.c
905ifdef CONFIG_IEEE80211AC
906OBJS += src/ap/ieee802_11_vht.c
907endif
908ifdef CONFIG_IEEE80211AX
909OBJS += src/ap/ieee802_11_he.c
910endif
911ifdef CONFIG_WNM_AP
912L_CFLAGS += -DCONFIG_WNM_AP
913OBJS += src/ap/wnm_ap.c
914endif
915ifdef CONFIG_MBO
916OBJS += src/ap/mbo_ap.c
917endif
918ifdef CONFIG_FILS
919OBJS += src/ap/fils_hlp.c
920endif
921ifdef CONFIG_CTRL_IFACE
922OBJS += src/ap/ctrl_iface_ap.c
923endif
924
925L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
926OBJS += src/eap_server/eap_server.c
927OBJS += src/eap_server/eap_server_identity.c
928OBJS += src/eap_server/eap_server_methods.c
929
930ifdef CONFIG_IEEE80211AC
931L_CFLAGS += -DCONFIG_IEEE80211AC
932endif
933ifdef CONFIG_IEEE80211AX
934L_CFLAGS += -DCONFIG_IEEE80211AX
935endif
936
937ifdef NEED_AP_MLME
938OBJS += src/ap/wmm.c
939OBJS += src/ap/ap_list.c
940OBJS += src/ap/ieee802_11.c
941OBJS += src/ap/hw_features.c
942OBJS += src/ap/dfs.c
943L_CFLAGS += -DNEED_AP_MLME
944endif
945ifdef CONFIG_WPS
946L_CFLAGS += -DEAP_SERVER_WSC
947OBJS += src/ap/wps_hostapd.c
948OBJS += src/eap_server/eap_server_wsc.c
949endif
950ifdef CONFIG_DPP
951OBJS += src/ap/dpp_hostapd.c
952OBJS += src/ap/gas_query_ap.c
953NEED_AP_GAS_SERV=y
954endif
955ifdef CONFIG_INTERWORKING
956NEED_AP_GAS_SERV=y
957endif
958ifdef NEED_AP_GAS_SERV
959OBJS += src/ap/gas_serv.c
960endif
961ifdef CONFIG_HS20
962OBJS += src/ap/hs20.c
963endif
964endif
965
966ifdef CONFIG_MBO
967OBJS += mbo.c
968L_CFLAGS += -DCONFIG_MBO
969endif
970
971ifdef CONFIG_TESTING_OPTIONS
972L_CFLAGS += -DCONFIG_TESTING_OPTIONS
973endif
974
975ifdef NEED_RSN_AUTHENTICATOR
976L_CFLAGS += -DCONFIG_NO_RADIUS
977NEED_AES_WRAP=y
978OBJS += src/ap/wpa_auth.c
979OBJS += src/ap/wpa_auth_ie.c
980OBJS += src/ap/pmksa_cache_auth.c
981endif
982
983ifdef CONFIG_ACS
984L_CFLAGS += -DCONFIG_ACS
985OBJS += src/ap/acs.c
986LIBS += -lm
987endif
988
989ifdef CONFIG_PCSC
990# PC/SC interface for smartcards (USIM, GSM SIM)
991L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
992OBJS += src/utils/pcsc_funcs.c
993# -lpthread may not be needed depending on how pcsc-lite was configured
994ifdef CONFIG_NATIVE_WINDOWS
995#Once MinGW gets support for WinScard, -lwinscard could be used instead of the
996#dynamic symbol loading that is now used in pcsc_funcs.c
997#LIBS += -lwinscard
998else
999LIBS += -lpcsclite -lpthread
1000endif
1001endif
1002
1003ifdef CONFIG_SIM_SIMULATOR
1004L_CFLAGS += -DCONFIG_SIM_SIMULATOR
1005NEED_MILENAGE=y
1006endif
1007
1008ifdef CONFIG_USIM_SIMULATOR
1009L_CFLAGS += -DCONFIG_USIM_SIMULATOR
1010NEED_MILENAGE=y
1011endif
1012
1013ifdef NEED_MILENAGE
1014OBJS += src/crypto/milenage.c
1015NEED_AES_ENCBLOCK=y
1016endif
1017
1018ifdef CONFIG_PKCS12
1019L_CFLAGS += -DPKCS12_FUNCS
1020endif
1021
1022ifdef CONFIG_SMARTCARD
1023L_CFLAGS += -DCONFIG_SMARTCARD
1024endif
1025
1026ifdef NEED_DRAGONFLY
1027OBJS += src/common/dragonfly.c
1028endif
1029
1030ifdef MS_FUNCS
1031OBJS += src/crypto/ms_funcs.c
1032NEED_DES=y
1033NEED_MD4=y
1034endif
1035
1036ifdef CHAP
1037OBJS += src/eap_common/chap.c
1038endif
1039
1040ifdef TLS_FUNCS
1041NEED_DES=y
1042# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
1043OBJS += src/eap_peer/eap_tls_common.c
1044ifndef CONFIG_FIPS
1045NEED_TLS_PRF=y
1046NEED_SHA1=y
1047NEED_MD5=y
1048endif
1049endif
1050
1051ifndef CONFIG_TLS
1052CONFIG_TLS=openssl
1053endif
1054
1055ifdef CONFIG_TLSV11
1056L_CFLAGS += -DCONFIG_TLSV11
1057endif
1058
1059ifdef CONFIG_TLSV12
1060L_CFLAGS += -DCONFIG_TLSV12
1061endif
1062
1063ifeq ($(CONFIG_TLS), openssl)
1064ifdef TLS_FUNCS
1065L_CFLAGS += -DEAP_TLS_OPENSSL
1066OBJS += src/crypto/tls_openssl.c
1067OBJS += src/crypto/tls_openssl_ocsp.c
1068LIBS += -lssl
1069endif
1070OBJS += src/crypto/crypto_openssl.c
1071OBJS_p += src/crypto/crypto_openssl.c
1072ifdef NEED_FIPS186_2_PRF
1073OBJS += src/crypto/fips_prf_openssl.c
1074endif
1075NEED_TLS_PRF_SHA256=y
1076LIBS += -lcrypto
1077LIBS_p += -lcrypto
1078ifdef CONFIG_TLS_ADD_DL
1079LIBS += -ldl
1080LIBS_p += -ldl
1081endif
1082ifndef CONFIG_TLS_DEFAULT_CIPHERS
1083CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
1084endif
1085L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
1086endif
1087
1088ifeq ($(CONFIG_TLS), gnutls)
1089ifndef CONFIG_CRYPTO
1090# default to libgcrypt
1091CONFIG_CRYPTO=gnutls
1092endif
1093ifdef TLS_FUNCS
1094OBJS += src/crypto/tls_gnutls.c
1095LIBS += -lgnutls -lgpg-error
1096endif
1097OBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
1098OBJS_p += src/crypto/crypto_$(CONFIG_CRYPTO).c
1099ifdef NEED_FIPS186_2_PRF
1100OBJS += src/crypto/fips_prf_internal.c
1101OBJS += src/crypto/sha1-internal.c
1102endif
1103ifeq ($(CONFIG_CRYPTO), gnutls)
1104LIBS += -lgcrypt
1105LIBS_p += -lgcrypt
1106CONFIG_INTERNAL_RC4=y
1107CONFIG_INTERNAL_DH_GROUP5=y
1108endif
1109ifeq ($(CONFIG_CRYPTO), nettle)
1110LIBS += -lnettle -lgmp
1111LIBS_p += -lnettle -lgmp
1112CONFIG_INTERNAL_RC4=y
1113CONFIG_INTERNAL_DH_GROUP5=y
1114endif
1115endif
1116
1117ifeq ($(CONFIG_TLS), internal)
1118ifndef CONFIG_CRYPTO
1119CONFIG_CRYPTO=internal
1120endif
1121ifdef TLS_FUNCS
1122OBJS += src/crypto/crypto_internal-rsa.c
1123OBJS += src/crypto/tls_internal.c
1124OBJS += src/tls/tlsv1_common.c
1125OBJS += src/tls/tlsv1_record.c
1126OBJS += src/tls/tlsv1_cred.c
1127OBJS += src/tls/tlsv1_client.c
1128OBJS += src/tls/tlsv1_client_write.c
1129OBJS += src/tls/tlsv1_client_read.c
1130OBJS += src/tls/tlsv1_client_ocsp.c
1131NEED_ASN1=y
1132OBJS += src/tls/rsa.c
1133OBJS += src/tls/x509v3.c
1134OBJS += src/tls/pkcs1.c
1135OBJS += src/tls/pkcs5.c
1136OBJS += src/tls/pkcs8.c
1137NEED_BASE64=y
1138NEED_TLS_PRF=y
1139ifdef CONFIG_TLSV12
1140NEED_TLS_PRF_SHA256=y
1141endif
1142NEED_MODEXP=y
1143NEED_CIPHER=y
1144L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1145endif
1146ifdef NEED_CIPHER
1147NEED_DES=y
1148OBJS += src/crypto/crypto_internal-cipher.c
1149endif
1150ifdef NEED_MODEXP
1151OBJS += src/crypto/crypto_internal-modexp.c
1152OBJS += src/tls/bignum.c
1153endif
1154ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1155OBJS += src/crypto/crypto_libtomcrypt.c
1156OBJS_p += src/crypto/crypto_libtomcrypt.c
1157LIBS += -ltomcrypt -ltfm
1158LIBS_p += -ltomcrypt -ltfm
1159CONFIG_INTERNAL_SHA256=y
1160CONFIG_INTERNAL_RC4=y
1161CONFIG_INTERNAL_DH_GROUP5=y
1162endif
1163ifeq ($(CONFIG_CRYPTO), internal)
1164OBJS += src/crypto/crypto_internal.c
1165OBJS_p += src/crypto/crypto_internal.c
1166NEED_AES_ENC=y
1167L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
1168ifdef CONFIG_INTERNAL_LIBTOMMATH
1169L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1170ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
1171L_CFLAGS += -DLTM_FAST
1172endif
1173else
1174LIBS += -ltommath
1175LIBS_p += -ltommath
1176endif
1177CONFIG_INTERNAL_AES=y
1178CONFIG_INTERNAL_DES=y
1179CONFIG_INTERNAL_SHA1=y
1180CONFIG_INTERNAL_MD4=y
1181CONFIG_INTERNAL_MD5=y
1182CONFIG_INTERNAL_SHA256=y
1183CONFIG_INTERNAL_SHA384=y
1184CONFIG_INTERNAL_SHA512=y
1185CONFIG_INTERNAL_RC4=y
1186CONFIG_INTERNAL_DH_GROUP5=y
1187endif
1188ifeq ($(CONFIG_CRYPTO), cryptoapi)
1189OBJS += src/crypto/crypto_cryptoapi.c
1190OBJS_p += src/crypto/crypto_cryptoapi.c
1191L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
1192CONFIG_INTERNAL_SHA256=y
1193CONFIG_INTERNAL_RC4=y
1194endif
1195endif
1196
1197ifeq ($(CONFIG_TLS), none)
1198ifdef TLS_FUNCS
1199OBJS += src/crypto/tls_none.c
1200L_CFLAGS += -DEAP_TLS_NONE
1201CONFIG_INTERNAL_AES=y
1202CONFIG_INTERNAL_SHA1=y
1203CONFIG_INTERNAL_MD5=y
1204endif
1205OBJS += src/crypto/crypto_none.c
1206OBJS_p += src/crypto/crypto_none.c
1207CONFIG_INTERNAL_SHA256=y
1208CONFIG_INTERNAL_RC4=y
1209endif
1210
1211ifdef TLS_FUNCS
1212ifdef CONFIG_SMARTCARD
1213ifndef CONFIG_NATIVE_WINDOWS
1214ifneq ($(CONFIG_L2_PACKET), freebsd)
1215LIBS += -ldl
1216endif
1217endif
1218endif
1219endif
1220
1221ifndef TLS_FUNCS
1222OBJS += src/crypto/tls_none.c
1223ifeq ($(CONFIG_TLS), internal)
1224CONFIG_INTERNAL_AES=y
1225CONFIG_INTERNAL_SHA1=y
1226CONFIG_INTERNAL_MD5=y
1227CONFIG_INTERNAL_RC4=y
1228endif
1229endif
1230
1231AESOBJS = # none so far (see below)
1232ifdef CONFIG_INTERNAL_AES
1233AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c
1234endif
1235
1236ifneq ($(CONFIG_TLS), openssl)
1237NEED_INTERNAL_AES_WRAP=y
1238endif
1239ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
1240# Seems to be needed at least with BoringSSL
1241NEED_INTERNAL_AES_WRAP=y
1242L_CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
1243endif
1244ifdef CONFIG_FIPS
1245# Have to use internal AES key wrap routines to use OpenSSL EVP since the
1246# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
1247NEED_INTERNAL_AES_WRAP=y
1248endif
1249
1250ifdef NEED_INTERNAL_AES_WRAP
1251AESOBJS += src/crypto/aes-unwrap.c
1252endif
1253ifdef NEED_AES_EAX
1254AESOBJS += src/crypto/aes-eax.c
1255NEED_AES_CTR=y
1256endif
1257ifdef NEED_AES_SIV
1258AESOBJS += src/crypto/aes-siv.c
1259NEED_AES_CTR=y
1260endif
1261ifdef NEED_AES_CTR
1262AESOBJS += src/crypto/aes-ctr.c
1263endif
1264ifdef NEED_AES_ENCBLOCK
1265AESOBJS += src/crypto/aes-encblock.c
1266endif
1267NEED_AES_ENC=y
1268ifdef CONFIG_OPENSSL_CMAC
1269L_CFLAGS += -DCONFIG_OPENSSL_CMAC
1270else
1271AESOBJS += src/crypto/aes-omac1.c
1272endif
1273ifdef NEED_AES_WRAP
1274NEED_AES_ENC=y
1275ifdef NEED_INTERNAL_AES_WRAP
1276AESOBJS += src/crypto/aes-wrap.c
1277endif
1278endif
1279ifdef NEED_AES_CBC
1280NEED_AES_ENC=y
1281ifneq ($(CONFIG_TLS), openssl)
1282AESOBJS += src/crypto/aes-cbc.c
1283endif
1284endif
1285ifdef NEED_AES_ENC
1286ifdef CONFIG_INTERNAL_AES
1287AESOBJS += src/crypto/aes-internal-enc.c
1288endif
1289endif
1290ifdef NEED_AES
1291OBJS += $(AESOBJS)
1292endif
1293
1294SHA1OBJS =
1295ifdef NEED_SHA1
1296ifneq ($(CONFIG_TLS), openssl)
1297ifneq ($(CONFIG_TLS), gnutls)
1298SHA1OBJS += src/crypto/sha1.c
1299endif
1300endif
1301SHA1OBJS += src/crypto/sha1-prf.c
1302ifdef CONFIG_INTERNAL_SHA1
1303SHA1OBJS += src/crypto/sha1-internal.c
1304ifdef NEED_FIPS186_2_PRF
1305SHA1OBJS += src/crypto/fips_prf_internal.c
1306endif
1307endif
1308ifdef CONFIG_NO_WPA_PASSPHRASE
1309L_CFLAGS += -DCONFIG_NO_PBKDF2
1310else
1311ifneq ($(CONFIG_TLS), openssl)
1312SHA1OBJS += src/crypto/sha1-pbkdf2.c
1313endif
1314endif
1315ifdef NEED_T_PRF
1316SHA1OBJS += src/crypto/sha1-tprf.c
1317endif
1318ifdef NEED_TLS_PRF
1319SHA1OBJS += src/crypto/sha1-tlsprf.c
1320endif
1321endif
1322
1323MD5OBJS =
1324ifndef CONFIG_FIPS
1325ifneq ($(CONFIG_TLS), openssl)
1326ifneq ($(CONFIG_TLS), gnutls)
1327MD5OBJS += src/crypto/md5.c
1328endif
1329endif
1330endif
1331ifdef NEED_MD5
1332ifdef CONFIG_INTERNAL_MD5
1333MD5OBJS += src/crypto/md5-internal.c
1334endif
1335OBJS += $(MD5OBJS)
1336OBJS_p += $(MD5OBJS)
1337endif
1338
1339ifdef NEED_MD4
1340ifdef CONFIG_INTERNAL_MD4
1341OBJS += src/crypto/md4-internal.c
1342endif
1343endif
1344
1345DESOBJS = # none needed when not internal
1346ifdef NEED_DES
1347ifdef CONFIG_INTERNAL_DES
1348DESOBJS += src/crypto/des-internal.c
1349endif
1350endif
1351
1352ifdef CONFIG_NO_RC4
1353L_CFLAGS += -DCONFIG_NO_RC4
1354endif
1355
1356ifdef NEED_RC4
1357ifdef CONFIG_INTERNAL_RC4
1358ifndef CONFIG_NO_RC4
1359OBJS += src/crypto/rc4.c
1360endif
1361endif
1362endif
1363
1364SHA256OBJS = # none by default
1365L_CFLAGS += -DCONFIG_SHA256
1366ifneq ($(CONFIG_TLS), openssl)
1367ifneq ($(CONFIG_TLS), gnutls)
1368SHA256OBJS += src/crypto/sha256.c
1369endif
1370endif
1371SHA256OBJS += src/crypto/sha256-prf.c
1372ifdef CONFIG_INTERNAL_SHA256
1373SHA256OBJS += src/crypto/sha256-internal.c
1374endif
1375ifdef CONFIG_INTERNAL_SHA384
1376L_CFLAGS += -DCONFIG_INTERNAL_SHA384
1377SHA256OBJS += src/crypto/sha384-internal.c
1378endif
1379ifdef CONFIG_INTERNAL_SHA512
1380L_CFLAGS += -DCONFIG_INTERNAL_SHA512
1381SHA256OBJS += src/crypto/sha512-internal.c
1382endif
1383ifdef NEED_TLS_PRF_SHA256
1384SHA256OBJS += src/crypto/sha256-tlsprf.c
1385endif
1386ifdef NEED_TLS_PRF_SHA384
1387SHA256OBJS += src/crypto/sha384-tlsprf.c
1388endif
1389ifdef NEED_HMAC_SHA256_KDF
1390L_CFLAGS += -DCONFIG_HMAC_SHA256_KDF
1391SHA256OBJS += src/crypto/sha256-kdf.c
1392endif
1393ifdef NEED_HMAC_SHA384_KDF
1394L_CFLAGS += -DCONFIG_HMAC_SHA384_KDF
1395SHA256OBJS += src/crypto/sha384-kdf.c
1396endif
1397ifdef NEED_HMAC_SHA512_KDF
1398L_CFLAGS += -DCONFIG_HMAC_SHA512_KDF
1399SHA256OBJS += src/crypto/sha512-kdf.c
1400endif
1401OBJS += $(SHA256OBJS)
1402ifdef NEED_SHA384
1403L_CFLAGS += -DCONFIG_SHA384
1404ifneq ($(CONFIG_TLS), openssl)
1405ifneq ($(CONFIG_TLS), gnutls)
1406OBJS += src/crypto/sha384.c
1407endif
1408endif
1409OBJS += src/crypto/sha384-prf.c
1410endif
1411ifdef NEED_SHA512
1412L_CFLAGS += -DCONFIG_SHA512
1413ifneq ($(CONFIG_TLS), openssl)
1414ifneq ($(CONFIG_TLS), gnutls)
1415OBJS += src/crypto/sha512.c
1416endif
1417endif
1418OBJS += src/crypto/sha512-prf.c
1419endif
1420
1421ifdef NEED_ASN1
1422OBJS += src/tls/asn1.c
1423endif
1424
1425ifdef NEED_DH_GROUPS
1426OBJS += src/crypto/dh_groups.c
1427endif
1428ifdef NEED_DH_GROUPS_ALL
1429L_CFLAGS += -DALL_DH_GROUPS
1430endif
1431ifdef CONFIG_INTERNAL_DH_GROUP5
1432ifdef NEED_DH_GROUPS
1433OBJS += src/crypto/dh_group5.c
1434endif
1435endif
1436
1437ifdef NEED_ECC
1438L_CFLAGS += -DCONFIG_ECC
1439endif
1440
1441ifdef CONFIG_NO_RANDOM_POOL
1442L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
1443else
1444OBJS += src/crypto/random.c
1445endif
1446
1447ifdef CONFIG_CTRL_IFACE
1448ifeq ($(CONFIG_CTRL_IFACE), y)
1449ifdef CONFIG_NATIVE_WINDOWS
1450CONFIG_CTRL_IFACE=named_pipe
1451else
1452CONFIG_CTRL_IFACE=unix
1453endif
1454endif
1455L_CFLAGS += -DCONFIG_CTRL_IFACE
1456ifeq ($(CONFIG_CTRL_IFACE), unix)
1457L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1458OBJS += src/common/ctrl_iface_common.c
1459endif
1460ifeq ($(CONFIG_CTRL_IFACE), udp)
1461L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1462endif
1463ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1464L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1465endif
1466ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
1467CONFIG_CTRL_IFACE=udp
1468L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1469L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1470endif
1471OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
1472endif
1473
1474ifdef CONFIG_CTRL_IFACE_DBUS_NEW
1475L_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
1476OBJS += dbus/dbus_dict_helpers.c
1477OBJS += dbus/dbus_new_helpers.c
1478OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
1479OBJS += dbus/dbus_common.c
1480ifdef CONFIG_WPS
1481OBJS += dbus/dbus_new_handlers_wps.c
1482endif
1483ifdef CONFIG_P2P
1484OBJS += dbus/dbus_new_handlers_p2p.c
1485endif
1486ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
1487OBJS += dbus/dbus_new_introspect.c
1488L_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
1489endif
1490L_CFLAGS += $(DBUS_INCLUDE)
1491endif
1492
1493ifdef CONFIG_CTRL_IFACE_BINDER
1494WPA_SUPPLICANT_USE_BINDER=y
1495L_CFLAGS += -DCONFIG_BINDER -DCONFIG_CTRL_IFACE_BINDER
1496endif
1497
1498ifdef CONFIG_READLINE
1499OBJS_c += src/utils/edit_readline.c
1500LIBS_c += -lncurses -lreadline
1501else
1502ifdef CONFIG_WPA_CLI_EDIT
1503OBJS_c += src/utils/edit.c
1504else
1505OBJS_c += src/utils/edit_simple.c
1506endif
1507endif
1508
1509ifdef CONFIG_NATIVE_WINDOWS
1510L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
1511LIBS += -lws2_32 -lgdi32 -lcrypt32
1512LIBS_c += -lws2_32
1513LIBS_p += -lws2_32 -lgdi32
1514ifeq ($(CONFIG_CRYPTO), cryptoapi)
1515LIBS_p += -lcrypt32
1516endif
1517endif
1518
1519ifdef CONFIG_NO_STDOUT_DEBUG
1520L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1521ifndef CONFIG_CTRL_IFACE
1522L_CFLAGS += -DCONFIG_NO_WPA_MSG
1523endif
1524endif
1525
1526ifdef CONFIG_ANDROID_LOG
1527L_CFLAGS += -DCONFIG_ANDROID_LOG
1528endif
1529
1530ifdef CONFIG_IPV6
1531# for eapol_test only
1532L_CFLAGS += -DCONFIG_IPV6
1533endif
1534
1535ifdef NEED_BASE64
1536OBJS += src/utils/base64.c
1537endif
1538
1539ifdef NEED_SME
1540OBJS += sme.c
1541L_CFLAGS += -DCONFIG_SME
1542endif
1543
1544OBJS += src/common/ieee802_11_common.c
1545OBJS += src/common/hw_features_common.c
1546
1547ifdef NEED_EAP_COMMON
1548OBJS += src/eap_common/eap_common.c
1549endif
1550
1551ifndef CONFIG_MAIN
1552CONFIG_MAIN=main
1553endif
1554
1555ifdef CONFIG_DEBUG_SYSLOG
1556L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
1557ifdef CONFIG_DEBUG_SYSLOG_FACILITY
1558L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
1559endif
1560endif
1561
1562ifdef CONFIG_DEBUG_LINUX_TRACING
1563L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1564endif
1565
1566ifdef CONFIG_DEBUG_FILE
1567L_CFLAGS += -DCONFIG_DEBUG_FILE
1568endif
1569
1570ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1571L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1572endif
1573
1574ifdef CONFIG_FIPS
1575L_CFLAGS += -DCONFIG_FIPS
1576endif
1577
1578OBJS += $(SHA1OBJS) $(DESOBJS)
1579
1580OBJS_p += $(SHA1OBJS)
1581OBJS_p += $(SHA256OBJS)
1582
1583ifdef CONFIG_BGSCAN_SIMPLE
1584L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1585OBJS += bgscan_simple.c
1586NEED_BGSCAN=y
1587endif
1588
1589ifdef CONFIG_BGSCAN_LEARN
1590L_CFLAGS += -DCONFIG_BGSCAN_LEARN
1591OBJS += bgscan_learn.c
1592NEED_BGSCAN=y
1593endif
1594
1595ifdef NEED_BGSCAN
1596L_CFLAGS += -DCONFIG_BGSCAN
1597OBJS += bgscan.c
1598endif
1599
1600ifdef CONFIG_AUTOSCAN_EXPONENTIAL
1601L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
1602OBJS += autoscan_exponential.c
1603NEED_AUTOSCAN=y
1604endif
1605
1606ifdef CONFIG_AUTOSCAN_PERIODIC
1607L_CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
1608OBJS += autoscan_periodic.c
1609NEED_AUTOSCAN=y
1610endif
1611
1612ifdef NEED_AUTOSCAN
1613L_CFLAGS += -DCONFIG_AUTOSCAN
1614OBJS += autoscan.c
1615endif
1616
1617ifdef CONFIG_EXT_PASSWORD_TEST
1618OBJS += src/utils/ext_password_test.c
1619L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
1620NEED_EXT_PASSWORD=y
1621endif
1622
1623ifdef CONFIG_EXT_PASSWORD_FILE
1624OBJS += src/utils/ext_password_file.c
1625L_CFLAGS += -DCONFIG_EXT_PASSWORD_FILE
1626NEED_EXT_PASSWORD=y
1627endif
1628
1629ifdef NEED_EXT_PASSWORD
1630OBJS += src/utils/ext_password.c
1631L_CFLAGS += -DCONFIG_EXT_PASSWORD
1632endif
1633
1634ifdef NEED_GAS_SERVER
1635OBJS += src/common/gas_server.c
1636L_CFLAGS += -DCONFIG_GAS_SERVER
1637NEED_GAS=y
1638endif
1639
1640ifdef NEED_GAS
1641OBJS += src/common/gas.c
1642OBJS += gas_query.c
1643L_CFLAGS += -DCONFIG_GAS
1644NEED_OFFCHANNEL=y
1645endif
1646
1647ifdef NEED_OFFCHANNEL
1648OBJS += offchannel.c
1649L_CFLAGS += -DCONFIG_OFFCHANNEL
1650endif
1651
1652ifdef NEED_JSON
1653OBJS += src/utils/json.c
1654L_CFLAGS += -DCONFIG_JSON
1655endif
1656
1657OBJS += src/drivers/driver_common.c
1658
1659OBJS += wpa_supplicant.c events.c bssid_ignore.c wpas_glue.c scan.c
1660OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
1661OBJS_t += src/radius/radius_client.c
1662OBJS_t += src/radius/radius.c
1663OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
1664OBJS += $(CONFIG_MAIN).c
1665
1666ifdef CONFIG_PRIVSEP
1667OBJS_priv += $(OBJS_d) src/drivers/drivers.c
1668OBJS_priv += $(OBJS_l2)
1669OBJS_priv += src/utils/os_$(CONFIG_OS).c
1670OBJS_priv += src/utils/$(CONFIG_ELOOP).c
1671OBJS_priv += src/utils/common.c
1672OBJS_priv += src/utils/wpa_debug.c
1673OBJS_priv += src/utils/wpabuf.c
1674OBJS_priv += wpa_priv.c
1675ifdef CONFIG_DRIVER_NL80211
1676OBJS_priv += src/common/ieee802_11_common.c
1677endif
1678OBJS += src/l2_packet/l2_packet_privsep.c
1679OBJS += src/drivers/driver_privsep.c
1680EXTRA_progs += wpa_priv
1681else
1682OBJS += $(OBJS_d) src/drivers/drivers.c
1683OBJS += $(OBJS_l2)
1684endif
1685
1686ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1687L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1688OBJS += src/drivers/ndis_events.c
1689EXTRALIBS += -loleaut32 -lole32 -luuid
1690ifdef PLATFORMSDKLIB
1691EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1692else
1693EXTRALIBS += WbemUuid.Lib
1694endif
1695endif
1696
1697ifndef LDO
1698LDO=$(CC)
1699endif
1700
1701########################
1702
1703include $(CLEAR_VARS)
1704LOCAL_MODULE := wpa_cli
1705LOCAL_MODULE_TAGS := debug
1706LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1707LOCAL_CFLAGS := $(L_CFLAGS)
1708LOCAL_SRC_FILES := $(OBJS_c)
1709LOCAL_C_INCLUDES := $(INCLUDES)
1710include $(BUILD_EXECUTABLE)
1711
1712########################
1713include $(CLEAR_VARS)
1714LOCAL_MODULE := wpa_supplicant
1715ifdef CONFIG_DRIVER_CUSTOM
1716LOCAL_STATIC_LIBRARIES := libCustomWifi
1717endif
1718ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
1719LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
1720endif
1721LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1722ifdef CONFIG_EAP_PROXY
1723LOCAL_STATIC_LIBRARIES += $(LIB_STATIC_EAP_PROXY)
1724LOCAL_SHARED_LIBRARIES += $(LIB_SHARED_EAP_PROXY)
1725endif
1726ifeq ($(CONFIG_TLS), openssl)
1727LOCAL_SHARED_LIBRARIES += libcrypto libssl libkeystore_binder
1728endif
1729
1730# With BoringSSL we need libkeystore-engine in order to provide access to
1731# keystore keys.
1732LOCAL_SHARED_LIBRARIES += libkeystore-engine
1733
1734ifdef CONFIG_DRIVER_NL80211
1735ifneq ($(wildcard external/libnl),)
1736LOCAL_SHARED_LIBRARIES += libnl
1737else
1738LOCAL_STATIC_LIBRARIES += libnl_2
1739endif
1740endif
1741LOCAL_CFLAGS := $(L_CFLAGS)
1742LOCAL_SRC_FILES := $(OBJS)
1743LOCAL_C_INCLUDES := $(INCLUDES)
1744ifeq ($(DBUS), y)
1745LOCAL_SHARED_LIBRARIES += libdbus
1746endif
1747ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
1748LOCAL_SHARED_LIBRARIES += libbinder libutils
1749LOCAL_STATIC_LIBRARIES += libwpa_binder libwpa_binder_interface
1750endif
1751include $(BUILD_EXECUTABLE)
1752
1753########################
1754#
1755#include $(CLEAR_VARS)
1756#LOCAL_MODULE := eapol_test
1757#ifdef CONFIG_DRIVER_CUSTOM
1758#LOCAL_STATIC_LIBRARIES := libCustomWifi
1759#endif
1760#LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
1761#LOCAL_CFLAGS := $(L_CFLAGS)
1762#LOCAL_SRC_FILES := $(OBJS_t)
1763#LOCAL_C_INCLUDES := $(INCLUDES)
1764#include $(BUILD_EXECUTABLE)
1765#
1766########################
1767#
1768#local_target_dir := $(TARGET_OUT)/etc/wifi
1769#
1770#include $(CLEAR_VARS)
1771#LOCAL_MODULE := wpa_supplicant.conf
1772#LOCAL_MODULE_CLASS := ETC
1773#LOCAL_MODULE_PATH := $(local_target_dir)
1774#LOCAL_SRC_FILES := $(LOCAL_MODULE)
1775#include $(BUILD_PREBUILT)
1776#
1777########################
1778
1779include $(CLEAR_VARS)
1780LOCAL_MODULE = libwpa_client
1781LOCAL_CFLAGS = $(L_CFLAGS)
1782LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
1783LOCAL_C_INCLUDES = $(INCLUDES)
1784LOCAL_SHARED_LIBRARIES := libcutils liblog
1785LOCAL_COPY_HEADERS_TO := libwpa_client
1786LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
1787LOCAL_COPY_HEADERS += src/common/qca-vendor.h
1788include $(BUILD_SHARED_LIBRARY)
1789
1790ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
1791### Binder interface library ###
1792########################
1793
1794include $(CLEAR_VARS)
1795LOCAL_MODULE := libwpa_binder_interface
1796LOCAL_AIDL_INCLUDES := \
1797    $(LOCAL_PATH)/binder \
1798    frameworks/native/aidl/binder
1799LOCAL_EXPORT_C_INCLUDE_DIRS := \
1800    $(LOCAL_PATH)/binder
1801LOCAL_CPPFLAGS := $(L_CPPFLAGS)
1802LOCAL_SRC_FILES := \
1803    binder/binder_constants.cpp \
1804    binder/fi/w1/wpa_supplicant/ISupplicant.aidl \
1805    binder/fi/w1/wpa_supplicant/ISupplicantCallbacks.aidl \
1806    binder/fi/w1/wpa_supplicant/IIface.aidl
1807LOCAL_SHARED_LIBRARIES := libbinder
1808include $(BUILD_STATIC_LIBRARY)
1809
1810### Binder service library ###
1811########################
1812
1813include $(CLEAR_VARS)
1814LOCAL_MODULE := libwpa_binder
1815LOCAL_CPPFLAGS := $(L_CPPFLAGS)
1816LOCAL_CFLAGS := $(L_CFLAGS)
1817LOCAL_C_INCLUDES := $(INCLUDES)
1818LOCAL_SRC_FILES := \
1819    binder/binder.cpp binder/binder_manager.cpp \
1820    binder/supplicant.cpp binder/iface.cpp
1821LOCAL_SHARED_LIBRARIES := \
1822    libbinder \
1823    libutils
1824LOCAL_STATIC_LIBRARIES := libwpa_binder_interface
1825include $(BUILD_STATIC_LIBRARY)
1826
1827endif # BINDER == y
1828