• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2008 The Android Open Source Project
2#
3# This software may be distributed under the terms of the BSD license.
4# See README for more details.
5#
6
7LOCAL_PATH := $(call my-dir)
8
9WPA_BUILD_HOSTAPD := false
10ifneq ($(BOARD_HOSTAPD_DRIVER),)
11  WPA_BUILD_HOSTAPD := true
12  CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
13endif
14
15ifeq ($(WPA_BUILD_HOSTAPD),true)
16
17include $(LOCAL_PATH)/android.config
18
19# To ignore possible wrong network configurations
20L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
21
22L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
23
24# Set Android log name
25L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
26
27L_CFLAGS += -Wall -Werror
28
29# Disable unused parameter warnings
30L_CFLAGS += -Wno-unused-parameter
31
32# Disable unused variable warnings
33L_CFLAGS += -Wno-unused-variable
34
35# Disable macro redefined warnings
36L_CFLAGS += -Wno-macro-redefined
37
38# Set Android extended P2P functionality
39L_CFLAGS += -DANDROID_P2P
40
41ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
42L_CFLAGS += -DANDROID_LIB_STUB
43endif
44
45# Use Android specific directory for control interface sockets
46L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/vendor/wifi/hostapd/sockets\"
47L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/vendor/wifi/hostapd/ctrl\"
48
49# Use Android specific directory for hostapd_cli command completion history
50L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/vendor/wifi/hostapd\"
51
52# To force sizeof(enum) = 4
53ifeq ($(TARGET_ARCH),arm)
54L_CFLAGS += -mabi=aapcs-linux
55endif
56
57INCLUDES = $(LOCAL_PATH)
58INCLUDES += $(LOCAL_PATH)/src
59INCLUDES += $(LOCAL_PATH)/src/utils
60INCLUDES += system/security/keystore/include
61ifdef CONFIG_DRIVER_NL80211
62ifneq ($(wildcard external/libnl),)
63INCLUDES += external/libnl/include
64else
65INCLUDES += external/libnl-headers
66endif
67endif
68
69ifdef CONFIG_TESTING_OPTIONS
70L_CFLAGS += -DCONFIG_TESTING_OPTIONS
71CONFIG_WPS_TESTING=y
72endif
73
74ifndef CONFIG_OS
75ifdef CONFIG_NATIVE_WINDOWS
76CONFIG_OS=win32
77else
78CONFIG_OS=unix
79endif
80endif
81
82ifeq ($(CONFIG_OS), internal)
83L_CFLAGS += -DOS_NO_C_LIB_DEFINES
84endif
85
86ifdef CONFIG_NATIVE_WINDOWS
87L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
88LIBS += -lws2_32
89endif
90
91OBJS = main.c
92OBJS += config_file.c
93
94OBJS += src/ap/hostapd.c
95OBJS += src/ap/wpa_auth_glue.c
96OBJS += src/ap/drv_callbacks.c
97OBJS += src/ap/ap_drv_ops.c
98OBJS += src/ap/utils.c
99OBJS += src/ap/authsrv.c
100OBJS += src/ap/ieee802_1x.c
101OBJS += src/ap/ap_config.c
102OBJS += src/ap/eap_user_db.c
103OBJS += src/ap/ieee802_11_auth.c
104OBJS += src/ap/sta_info.c
105OBJS += src/ap/wpa_auth.c
106OBJS += src/ap/tkip_countermeasures.c
107OBJS += src/ap/ap_mlme.c
108OBJS += src/ap/wpa_auth_ie.c
109OBJS += src/ap/preauth_auth.c
110OBJS += src/ap/pmksa_cache_auth.c
111OBJS += src/ap/ieee802_11_shared.c
112OBJS += src/ap/beacon.c
113OBJS += src/ap/bss_load.c
114OBJS += src/ap/neighbor_db.c
115OBJS += src/ap/rrm.c
116OBJS_d =
117OBJS_p =
118LIBS =
119LIBS_c =
120HOBJS =
121LIBS_h =
122
123NEED_RC4=y
124NEED_AES=y
125NEED_MD5=y
126NEED_SHA1=y
127
128OBJS += src/drivers/drivers.c
129L_CFLAGS += -DHOSTAPD
130
131ifdef CONFIG_WPA_TRACE
132L_CFLAGS += -DWPA_TRACE
133OBJS += src/utils/trace.c
134HOBJS += src/utils/trace.c
135LDFLAGS += -rdynamic
136L_CFLAGS += -funwind-tables
137ifdef CONFIG_WPA_TRACE_BFD
138L_CFLAGS += -DWPA_TRACE_BFD
139LIBS += -lbfd
140LIBS_c += -lbfd
141LIBS_h += -lbfd
142endif
143endif
144
145OBJS += src/utils/eloop.c
146
147ifdef CONFIG_ELOOP_POLL
148L_CFLAGS += -DCONFIG_ELOOP_POLL
149endif
150
151ifdef CONFIG_ELOOP_EPOLL
152L_CFLAGS += -DCONFIG_ELOOP_EPOLL
153endif
154
155OBJS += src/utils/common.c
156OBJS += src/utils/wpa_debug.c
157OBJS += src/utils/wpabuf.c
158OBJS += src/utils/os_$(CONFIG_OS).c
159OBJS += src/utils/ip_addr.c
160OBJS += src/utils/crc32.c
161
162OBJS += src/common/ieee802_11_common.c
163OBJS += src/common/wpa_common.c
164OBJS += src/common/hw_features_common.c
165
166OBJS += src/eapol_auth/eapol_auth_sm.c
167
168
169ifndef CONFIG_NO_DUMP_STATE
170# define HOSTAPD_DUMP_STATE to include support for dumping internal state
171# through control interface commands (undefine it, if you want to save in
172# binary size)
173L_CFLAGS += -DHOSTAPD_DUMP_STATE
174OBJS += src/eapol_auth/eapol_auth_dump.c
175endif
176
177ifdef CONFIG_NO_RADIUS
178L_CFLAGS += -DCONFIG_NO_RADIUS
179CONFIG_NO_ACCOUNTING=y
180else
181OBJS += src/radius/radius.c
182OBJS += src/radius/radius_client.c
183OBJS += src/radius/radius_das.c
184endif
185
186ifdef CONFIG_NO_ACCOUNTING
187L_CFLAGS += -DCONFIG_NO_ACCOUNTING
188else
189OBJS += src/ap/accounting.c
190endif
191
192ifdef CONFIG_NO_VLAN
193L_CFLAGS += -DCONFIG_NO_VLAN
194else
195OBJS += src/ap/vlan_init.c
196OBJS += src/ap/vlan_ifconfig.c
197OBJS += src/ap/vlan.c
198ifdef CONFIG_FULL_DYNAMIC_VLAN
199# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
200# and VLAN interfaces for the VLAN feature.
201L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
202OBJS += src/ap/vlan_full.c
203ifdef CONFIG_VLAN_NETLINK
204OBJS += src/ap/vlan_util.c
205else
206OBJS += src/ap/vlan_ioctl.c
207endif
208endif
209endif
210
211ifdef CONFIG_NO_CTRL_IFACE
212L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
213else
214OBJS += src/common/ctrl_iface_common.c
215OBJS += ctrl_iface.c
216OBJS += src/ap/ctrl_iface_ap.c
217endif
218
219L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
220
221ifdef CONFIG_RSN_PREAUTH
222L_CFLAGS += -DCONFIG_RSN_PREAUTH
223CONFIG_L2_PACKET=y
224endif
225
226ifdef CONFIG_HS20
227CONFIG_PROXYARP=y
228endif
229
230ifdef CONFIG_PROXYARP
231CONFIG_L2_PACKET=y
232endif
233
234ifdef CONFIG_SUITEB
235L_CFLAGS += -DCONFIG_SUITEB
236endif
237
238ifdef CONFIG_SUITEB192
239L_CFLAGS += -DCONFIG_SUITEB192
240NEED_SHA384=y
241endif
242
243ifdef CONFIG_OCV
244L_CFLAGS += -DCONFIG_OCV
245OBJS += src/common/ocv.c
246endif
247
248ifdef CONFIG_IEEE80211R
249L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
250OBJS += src/ap/wpa_auth_ft.c
251NEED_AES_UNWRAP=y
252NEED_AES_SIV=y
253NEED_ETH_P_OUI=y
254NEED_HMAC_SHA256_KDF=y
255endif
256
257ifdef NEED_ETH_P_OUI
258L_CFLAGS += -DCONFIG_ETH_P_OUI
259OBJS += src/ap/eth_p_oui.c
260endif
261
262ifdef CONFIG_SAE
263L_CFLAGS += -DCONFIG_SAE
264OBJS += src/common/sae.c
265ifdef CONFIG_SAE_PK
266L_CFLAGS += -DCONFIG_SAE_PK
267OBJS += src/common/sae_pk.c
268endif
269NEED_ECC=y
270NEED_DH_GROUPS=y
271NEED_HMAC_SHA256_KDF=y
272NEED_DRAGONFLY=y
273endif
274
275ifdef CONFIG_OWE
276L_CFLAGS += -DCONFIG_OWE
277NEED_ECC=y
278NEED_HMAC_SHA256_KDF=y
279NEED_HMAC_SHA384_KDF=y
280NEED_HMAC_SHA512_KDF=y
281NEED_SHA384=y
282NEED_SHA512=y
283endif
284
285ifdef CONFIG_WAPI_INTERFACE
286L_CFLAGS += -DCONFIG_WAPI_INTERFACE
287endif
288
289ifdef CONFIG_FILS
290L_CFLAGS += -DCONFIG_FILS
291OBJS += src/ap/fils_hlp.c
292NEED_SHA384=y
293NEED_AES_SIV=y
294ifdef CONFIG_FILS_SK_PFS
295L_CFLAGS += -DCONFIG_FILS_SK_PFS
296NEED_ECC=y
297endif
298endif
299
300ifdef CONFIG_WNM
301L_CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP
302OBJS += src/ap/wnm_ap.c
303endif
304
305ifdef CONFIG_IEEE80211AC
306L_CFLAGS += -DCONFIG_IEEE80211AC
307endif
308
309ifdef CONFIG_IEEE80211AX
310L_CFLAGS += -DCONFIG_IEEE80211AX
311endif
312
313ifdef CONFIG_MBO
314L_CFLAGS += -DCONFIG_MBO
315OBJS += src/ap/mbo_ap.c
316endif
317
318ifdef CONFIG_FST
319L_CFLAGS += -DCONFIG_FST
320OBJS += src/fst/fst.c
321OBJS += src/fst/fst_group.c
322OBJS += src/fst/fst_iface.c
323OBJS += src/fst/fst_session.c
324OBJS += src/fst/fst_ctrl_aux.c
325ifdef CONFIG_FST_TEST
326L_CFLAGS += -DCONFIG_FST_TEST
327endif
328ifndef CONFIG_NO_CTRL_IFACE
329OBJS += src/fst/fst_ctrl_iface.c
330endif
331endif
332
333ifdef CONFIG_WEP
334L_CFLAGS += -DCONFIG_WEP
335endif
336
337ifdef CONFIG_NO_TKIP
338L_CFLAGS += -DCONFIG_NO_TKIP
339endif
340
341
342include $(LOCAL_PATH)/src/drivers/drivers.mk
343
344OBJS += $(DRV_AP_OBJS)
345L_CFLAGS += $(DRV_AP_CFLAGS)
346LDFLAGS += $(DRV_AP_LDFLAGS)
347LIBS += $(DRV_AP_LIBS)
348
349ifdef CONFIG_L2_PACKET
350ifdef CONFIG_DNET_PCAP
351ifdef CONFIG_L2_FREEBSD
352LIBS += -lpcap
353OBJS += src/l2_packet/l2_packet_freebsd.c
354else
355LIBS += -ldnet -lpcap
356OBJS += src/l2_packet/l2_packet_pcap.c
357endif
358else
359OBJS += src/l2_packet/l2_packet_linux.c
360endif
361else
362OBJS += src/l2_packet/l2_packet_none.c
363endif
364
365
366ifdef CONFIG_EAP_MD5
367L_CFLAGS += -DEAP_SERVER_MD5
368OBJS += src/eap_server/eap_server_md5.c
369CHAP=y
370endif
371
372ifdef CONFIG_EAP_TLS
373L_CFLAGS += -DEAP_SERVER_TLS
374OBJS += src/eap_server/eap_server_tls.c
375TLS_FUNCS=y
376endif
377
378ifdef CONFIG_EAP_UNAUTH_TLS
379L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
380ifndef CONFIG_EAP_TLS
381OBJS += src/eap_server/eap_server_tls.c
382TLS_FUNCS=y
383endif
384endif
385
386ifdef CONFIG_EAP_PEAP
387L_CFLAGS += -DEAP_SERVER_PEAP
388OBJS += src/eap_server/eap_server_peap.c
389OBJS += src/eap_common/eap_peap_common.c
390TLS_FUNCS=y
391CONFIG_EAP_MSCHAPV2=y
392endif
393
394ifdef CONFIG_EAP_TTLS
395L_CFLAGS += -DEAP_SERVER_TTLS
396OBJS += src/eap_server/eap_server_ttls.c
397TLS_FUNCS=y
398CHAP=y
399endif
400
401ifdef CONFIG_EAP_MSCHAPV2
402L_CFLAGS += -DEAP_SERVER_MSCHAPV2
403OBJS += src/eap_server/eap_server_mschapv2.c
404MS_FUNCS=y
405endif
406
407ifdef CONFIG_EAP_GTC
408L_CFLAGS += -DEAP_SERVER_GTC
409OBJS += src/eap_server/eap_server_gtc.c
410endif
411
412ifdef CONFIG_EAP_SIM
413L_CFLAGS += -DEAP_SERVER_SIM
414OBJS += src/eap_server/eap_server_sim.c
415CONFIG_EAP_SIM_COMMON=y
416NEED_AES_CBC=y
417endif
418
419ifdef CONFIG_EAP_AKA
420L_CFLAGS += -DEAP_SERVER_AKA
421OBJS += src/eap_server/eap_server_aka.c
422CONFIG_EAP_SIM_COMMON=y
423NEED_AES_CBC=y
424endif
425
426ifdef CONFIG_EAP_AKA_PRIME
427L_CFLAGS += -DEAP_SERVER_AKA_PRIME
428endif
429
430ifdef CONFIG_EAP_SIM_COMMON
431OBJS += src/eap_common/eap_sim_common.c
432# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
433# replaced with another file implementing the interface specified in
434# eap_sim_db.h.
435OBJS += src/eap_server/eap_sim_db.c
436NEED_FIPS186_2_PRF=y
437endif
438
439ifdef CONFIG_EAP_PAX
440L_CFLAGS += -DEAP_SERVER_PAX
441OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
442endif
443
444ifdef CONFIG_EAP_PSK
445L_CFLAGS += -DEAP_SERVER_PSK
446OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
447NEED_AES_ENCBLOCK=y
448NEED_AES_EAX=y
449endif
450
451ifdef CONFIG_EAP_SAKE
452L_CFLAGS += -DEAP_SERVER_SAKE
453OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
454endif
455
456ifdef CONFIG_EAP_GPSK
457L_CFLAGS += -DEAP_SERVER_GPSK
458OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
459ifdef CONFIG_EAP_GPSK_SHA256
460L_CFLAGS += -DEAP_GPSK_SHA256
461endif
462endif
463
464ifdef CONFIG_EAP_PWD
465L_CFLAGS += -DEAP_SERVER_PWD
466OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
467NEED_ECC=y
468NEED_DRAGONFLY=y
469endif
470
471ifdef CONFIG_EAP_EKE
472L_CFLAGS += -DEAP_SERVER_EKE
473OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
474NEED_DH_GROUPS=y
475NEED_DH_GROUPS_ALL=y
476endif
477
478ifdef CONFIG_EAP_VENDOR_TEST
479L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
480OBJS += src/eap_server/eap_server_vendor_test.c
481endif
482
483ifdef CONFIG_EAP_FAST
484L_CFLAGS += -DEAP_SERVER_FAST
485OBJS += src/eap_server/eap_server_fast.c
486OBJS += src/eap_common/eap_fast_common.c
487TLS_FUNCS=y
488NEED_T_PRF=y
489NEED_AES_UNWRAP=y
490endif
491
492ifdef CONFIG_EAP_TEAP
493L_CFLAGS += -DEAP_SERVER_TEAP
494OBJS += src/eap_server/eap_server_teap.c
495OBJS += src/eap_common/eap_teap_common.c
496TLS_FUNCS=y
497NEED_T_PRF=y
498NEED_SHA384=y
499NEED_TLS_PRF_SHA256=y
500NEED_TLS_PRF_SHA384=y
501NEED_AES_UNWRAP=y
502endif
503
504ifdef CONFIG_WPS
505L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
506OBJS += src/utils/uuid.c
507OBJS += src/ap/wps_hostapd.c
508OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
509OBJS += src/wps/wps.c
510OBJS += src/wps/wps_common.c
511OBJS += src/wps/wps_attr_parse.c
512OBJS += src/wps/wps_attr_build.c
513OBJS += src/wps/wps_attr_process.c
514OBJS += src/wps/wps_dev_attr.c
515OBJS += src/wps/wps_enrollee.c
516OBJS += src/wps/wps_registrar.c
517NEED_DH_GROUPS=y
518NEED_BASE64=y
519NEED_AES_CBC=y
520NEED_MODEXP=y
521CONFIG_EAP=y
522
523ifdef CONFIG_WPS_NFC
524L_CFLAGS += -DCONFIG_WPS_NFC
525OBJS += src/wps/ndef.c
526NEED_WPS_OOB=y
527endif
528
529ifdef NEED_WPS_OOB
530L_CFLAGS += -DCONFIG_WPS_OOB
531endif
532
533ifdef CONFIG_WPS_UPNP
534L_CFLAGS += -DCONFIG_WPS_UPNP
535OBJS += src/wps/wps_upnp.c
536OBJS += src/wps/wps_upnp_ssdp.c
537OBJS += src/wps/wps_upnp_web.c
538OBJS += src/wps/wps_upnp_event.c
539OBJS += src/wps/wps_upnp_ap.c
540OBJS += src/wps/upnp_xml.c
541OBJS += src/wps/httpread.c
542OBJS += src/wps/http_client.c
543OBJS += src/wps/http_server.c
544endif
545
546ifdef CONFIG_WPS_STRICT
547L_CFLAGS += -DCONFIG_WPS_STRICT
548OBJS += src/wps/wps_validate.c
549endif
550
551ifdef CONFIG_WPS_TESTING
552L_CFLAGS += -DCONFIG_WPS_TESTING
553endif
554
555endif
556
557ifdef CONFIG_DPP
558L_CFLAGS += -DCONFIG_DPP
559OBJS += src/common/dpp.c
560OBJS += src/common/dpp_auth.c
561OBJS += src/common/dpp_backup.c
562OBJS += src/common/dpp_crypto.c
563OBJS += src/common/dpp_pkex.c
564OBJS += src/common/dpp_reconfig.c
565OBJS += src/common/dpp_tcp.c
566OBJS += src/ap/dpp_hostapd.c
567OBJS += src/ap/gas_query_ap.c
568NEED_AES_SIV=y
569NEED_HMAC_SHA256_KDF=y
570NEED_HMAC_SHA384_KDF=y
571NEED_HMAC_SHA512_KDF=y
572NEED_SHA384=y
573NEED_SHA512=y
574NEED_ECC=y
575NEED_JSON=y
576NEED_GAS=y
577NEED_BASE64=y
578NEED_ASN1=y
579ifdef CONFIG_DPP2
580L_CFLAGS += -DCONFIG_DPP2
581endif
582endif
583
584ifdef CONFIG_PASN
585L_CFLAGS += -DCONFIG_PASN
586L_CFLAGS += -DCONFIG_PTKSA_CACHE
587NEED_HMAC_SHA256_KDF=y
588NEED_HMAC_SHA384_KDF=y
589NEED_SHA256=y
590NEED_SHA384=y
591OBJS += src/common/ptksa_cache.c
592endif
593
594ifdef CONFIG_EAP_IKEV2
595L_CFLAGS += -DEAP_SERVER_IKEV2
596OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
597OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
598NEED_DH_GROUPS=y
599NEED_DH_GROUPS_ALL=y
600NEED_MODEXP=y
601NEED_CIPHER=y
602endif
603
604ifdef CONFIG_EAP_TNC
605L_CFLAGS += -DEAP_SERVER_TNC
606OBJS += src/eap_server/eap_server_tnc.c
607OBJS += src/eap_server/tncs.c
608NEED_BASE64=y
609ifndef CONFIG_DRIVER_BSD
610LIBS += -ldl
611endif
612endif
613
614# Basic EAP functionality is needed for EAPOL
615OBJS += eap_register.c
616OBJS += src/eap_server/eap_server.c
617OBJS += src/eap_common/eap_common.c
618OBJS += src/eap_server/eap_server_methods.c
619OBJS += src/eap_server/eap_server_identity.c
620L_CFLAGS += -DEAP_SERVER_IDENTITY
621
622ifdef CONFIG_EAP
623L_CFLAGS += -DEAP_SERVER
624endif
625
626ifdef CONFIG_PKCS12
627L_CFLAGS += -DPKCS12_FUNCS
628endif
629
630ifdef NEED_DRAGONFLY
631OBJS += src/common/dragonfly.c
632endif
633
634ifdef MS_FUNCS
635OBJS += src/crypto/ms_funcs.c
636NEED_DES=y
637NEED_MD4=y
638endif
639
640ifdef CHAP
641OBJS += src/eap_common/chap.c
642endif
643
644ifdef TLS_FUNCS
645NEED_DES=y
646# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
647L_CFLAGS += -DEAP_TLS_FUNCS
648OBJS += src/eap_server/eap_server_tls_common.c
649NEED_TLS_PRF=y
650endif
651
652ifndef CONFIG_TLS
653CONFIG_TLS=openssl
654endif
655
656ifdef CONFIG_TLSV11
657L_CFLAGS += -DCONFIG_TLSV11
658endif
659
660ifdef CONFIG_TLSV12
661L_CFLAGS += -DCONFIG_TLSV12
662endif
663
664ifeq ($(CONFIG_TLS), openssl)
665ifdef TLS_FUNCS
666OBJS += src/crypto/tls_openssl.c
667OBJS += src/crypto/tls_openssl_ocsp.c
668LIBS += -lssl
669endif
670OBJS += src/crypto/crypto_openssl.c
671HOBJS += src/crypto/crypto_openssl.c
672ifdef NEED_FIPS186_2_PRF
673OBJS += src/crypto/fips_prf_openssl.c
674endif
675NEED_TLS_PRF_SHA256=y
676LIBS += -lcrypto
677LIBS_h += -lcrypto
678ifndef CONFIG_TLS_DEFAULT_CIPHERS
679CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
680endif
681L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
682endif
683
684ifeq ($(CONFIG_TLS), gnutls)
685ifndef CONFIG_CRYPTO
686# default to libgcrypt
687CONFIG_CRYPTO=gnutls
688endif
689ifdef TLS_FUNCS
690OBJS += src/crypto/tls_gnutls.c
691LIBS += -lgnutls -lgpg-error
692endif
693OBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
694HOBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
695ifdef NEED_FIPS186_2_PRF
696OBJS += src/crypto/fips_prf_internal.c
697OBJS += src/crypto/sha1-internal.c
698endif
699ifeq ($(CONFIG_CRYPTO), gnutls)
700LIBS += -lgcrypt
701LIBS_h += -lgcrypt
702CONFIG_INTERNAL_RC4=y
703CONFIG_INTERNAL_DH_GROUP5=y
704endif
705ifeq ($(CONFIG_CRYPTO), nettle)
706LIBS += -lnettle -lgmp
707LIBS_p += -lnettle -lgmp
708CONFIG_INTERNAL_RC4=y
709CONFIG_INTERNAL_DH_GROUP5=y
710endif
711endif
712
713ifeq ($(CONFIG_TLS), internal)
714ifndef CONFIG_CRYPTO
715CONFIG_CRYPTO=internal
716endif
717ifdef TLS_FUNCS
718OBJS += src/crypto/crypto_internal-rsa.c
719OBJS += src/crypto/tls_internal.c
720OBJS += src/tls/tlsv1_common.c
721OBJS += src/tls/tlsv1_record.c
722OBJS += src/tls/tlsv1_cred.c
723OBJS += src/tls/tlsv1_server.c
724OBJS += src/tls/tlsv1_server_write.c
725OBJS += src/tls/tlsv1_server_read.c
726OBJS += src/tls/rsa.c
727OBJS += src/tls/x509v3.c
728OBJS += src/tls/pkcs1.c
729OBJS += src/tls/pkcs5.c
730OBJS += src/tls/pkcs8.c
731NEED_ASN1=y
732NEED_BASE64=y
733NEED_TLS_PRF=y
734ifdef CONFIG_TLSV12
735NEED_TLS_PRF_SHA256=y
736endif
737NEED_MODEXP=y
738NEED_CIPHER=y
739L_CFLAGS += -DCONFIG_TLS_INTERNAL
740L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
741endif
742ifdef NEED_CIPHER
743NEED_DES=y
744OBJS += src/crypto/crypto_internal-cipher.c
745endif
746ifdef NEED_MODEXP
747OBJS += src/crypto/crypto_internal-modexp.c
748OBJS += src/tls/bignum.c
749endif
750ifeq ($(CONFIG_CRYPTO), libtomcrypt)
751OBJS += src/crypto/crypto_libtomcrypt.c
752LIBS += -ltomcrypt -ltfm
753LIBS_h += -ltomcrypt -ltfm
754CONFIG_INTERNAL_SHA256=y
755CONFIG_INTERNAL_RC4=y
756CONFIG_INTERNAL_DH_GROUP5=y
757endif
758ifeq ($(CONFIG_CRYPTO), internal)
759OBJS += src/crypto/crypto_internal.c
760NEED_AES_DEC=y
761L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
762ifdef CONFIG_INTERNAL_LIBTOMMATH
763L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
764ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
765L_CFLAGS += -DLTM_FAST
766endif
767else
768LIBS += -ltommath
769LIBS_h += -ltommath
770endif
771CONFIG_INTERNAL_AES=y
772CONFIG_INTERNAL_DES=y
773CONFIG_INTERNAL_SHA1=y
774CONFIG_INTERNAL_MD4=y
775CONFIG_INTERNAL_MD5=y
776CONFIG_INTERNAL_SHA256=y
777CONFIG_INTERNAL_SHA384=y
778CONFIG_INTERNAL_SHA512=y
779CONFIG_INTERNAL_RC4=y
780CONFIG_INTERNAL_DH_GROUP5=y
781endif
782ifeq ($(CONFIG_CRYPTO), cryptoapi)
783OBJS += src/crypto/crypto_cryptoapi.c
784OBJS_p += src/crypto/crypto_cryptoapi.c
785L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
786CONFIG_INTERNAL_SHA256=y
787CONFIG_INTERNAL_RC4=y
788endif
789endif
790
791ifeq ($(CONFIG_TLS), none)
792ifdef TLS_FUNCS
793OBJS += src/crypto/tls_none.c
794L_CFLAGS += -DEAP_TLS_NONE
795CONFIG_INTERNAL_AES=y
796CONFIG_INTERNAL_SHA1=y
797CONFIG_INTERNAL_MD5=y
798endif
799OBJS += src/crypto/crypto_none.c
800OBJS_p += src/crypto/crypto_none.c
801CONFIG_INTERNAL_SHA256=y
802CONFIG_INTERNAL_RC4=y
803endif
804
805ifndef TLS_FUNCS
806OBJS += src/crypto/tls_none.c
807ifeq ($(CONFIG_TLS), internal)
808CONFIG_INTERNAL_AES=y
809CONFIG_INTERNAL_SHA1=y
810CONFIG_INTERNAL_MD5=y
811CONFIG_INTERNAL_RC4=y
812endif
813endif
814
815AESOBJS = # none so far
816ifdef CONFIG_INTERNAL_AES
817AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
818endif
819
820ifneq ($(CONFIG_TLS), openssl)
821AESOBJS += src/crypto/aes-wrap.c
822endif
823ifdef NEED_AES_EAX
824AESOBJS += src/crypto/aes-eax.c
825NEED_AES_CTR=y
826endif
827ifdef NEED_AES_SIV
828AESOBJS += src/crypto/aes-siv.c
829NEED_AES_CTR=y
830endif
831ifdef NEED_AES_CTR
832AESOBJS += src/crypto/aes-ctr.c
833endif
834ifdef NEED_AES_ENCBLOCK
835AESOBJS += src/crypto/aes-encblock.c
836endif
837AESOBJS += src/crypto/aes-omac1.c
838ifdef NEED_AES_UNWRAP
839ifneq ($(CONFIG_TLS), openssl)
840NEED_AES_DEC=y
841AESOBJS += src/crypto/aes-unwrap.c
842endif
843endif
844ifdef NEED_AES_CBC
845NEED_AES_DEC=y
846ifneq ($(CONFIG_TLS), openssl)
847AESOBJS += src/crypto/aes-cbc.c
848endif
849endif
850ifdef NEED_AES_DEC
851ifdef CONFIG_INTERNAL_AES
852AESOBJS += src/crypto/aes-internal-dec.c
853endif
854endif
855ifdef NEED_AES
856OBJS += $(AESOBJS)
857endif
858
859SHA1OBJS =
860ifdef NEED_SHA1
861ifneq ($(CONFIG_TLS), openssl)
862ifneq ($(CONFIG_TLS), gnutls)
863SHA1OBJS += src/crypto/sha1.c
864endif
865endif
866SHA1OBJS += src/crypto/sha1-prf.c
867ifdef CONFIG_INTERNAL_SHA1
868SHA1OBJS += src/crypto/sha1-internal.c
869ifdef NEED_FIPS186_2_PRF
870SHA1OBJS += src/crypto/fips_prf_internal.c
871endif
872endif
873ifneq ($(CONFIG_TLS), openssl)
874SHA1OBJS += src/crypto/sha1-pbkdf2.c
875endif
876ifdef NEED_T_PRF
877SHA1OBJS += src/crypto/sha1-tprf.c
878endif
879ifdef NEED_TLS_PRF
880SHA1OBJS += src/crypto/sha1-tlsprf.c
881endif
882endif
883
884ifdef NEED_SHA1
885OBJS += $(SHA1OBJS)
886endif
887
888ifneq ($(CONFIG_TLS), openssl)
889ifneq ($(CONFIG_TLS), gnutls)
890OBJS += src/crypto/md5.c
891endif
892endif
893
894ifdef NEED_MD5
895ifdef CONFIG_INTERNAL_MD5
896OBJS += src/crypto/md5-internal.c
897HOBJS += src/crypto/md5-internal.c
898endif
899endif
900
901ifdef NEED_MD4
902ifdef CONFIG_INTERNAL_MD4
903OBJS += src/crypto/md4-internal.c
904endif
905endif
906
907ifdef NEED_DES
908ifdef CONFIG_INTERNAL_DES
909OBJS += src/crypto/des-internal.c
910endif
911endif
912
913ifdef CONFIG_NO_RC4
914L_CFLAGS += -DCONFIG_NO_RC4
915endif
916
917ifdef NEED_RC4
918ifdef CONFIG_INTERNAL_RC4
919ifndef CONFIG_NO_RC4
920OBJS += src/crypto/rc4.c
921endif
922endif
923endif
924
925L_CFLAGS += -DCONFIG_SHA256
926ifneq ($(CONFIG_TLS), openssl)
927ifneq ($(CONFIG_TLS), gnutls)
928OBJS += src/crypto/sha256.c
929endif
930endif
931OBJS += src/crypto/sha256-prf.c
932ifdef CONFIG_INTERNAL_SHA256
933OBJS += src/crypto/sha256-internal.c
934endif
935ifdef NEED_TLS_PRF_SHA256
936OBJS += src/crypto/sha256-tlsprf.c
937endif
938ifdef NEED_TLS_PRF_SHA384
939OBJS += src/crypto/sha384-tlsprf.c
940endif
941ifdef NEED_HMAC_SHA256_KDF
942OBJS += src/crypto/sha256-kdf.c
943endif
944ifdef NEED_HMAC_SHA384_KDF
945OBJS += src/crypto/sha384-kdf.c
946endif
947ifdef NEED_HMAC_SHA512_KDF
948OBJS += src/crypto/sha512-kdf.c
949endif
950ifdef NEED_SHA384
951L_CFLAGS += -DCONFIG_SHA384
952ifneq ($(CONFIG_TLS), openssl)
953ifneq ($(CONFIG_TLS), gnutls)
954OBJS += src/crypto/sha384.c
955endif
956endif
957OBJS += src/crypto/sha384-prf.c
958endif
959ifdef NEED_SHA512
960L_CFLAGS += -DCONFIG_SHA512
961ifneq ($(CONFIG_TLS), openssl)
962ifneq ($(CONFIG_TLS), linux)
963ifneq ($(CONFIG_TLS), gnutls)
964OBJS += src/crypto/sha512.c
965endif
966endif
967endif
968OBJS += src/crypto/sha512-prf.c
969endif
970
971ifdef CONFIG_INTERNAL_SHA384
972L_CFLAGS += -DCONFIG_INTERNAL_SHA384
973OBJS += src/crypto/sha384-internal.c
974endif
975
976ifdef CONFIG_INTERNAL_SHA512
977L_CFLAGS += -DCONFIG_INTERNAL_SHA512
978OBJS += src/crypto/sha512-internal.c
979endif
980
981ifdef NEED_ASN1
982OBJS += src/tls/asn1.c
983endif
984
985ifdef NEED_DH_GROUPS
986OBJS += src/crypto/dh_groups.c
987endif
988ifdef NEED_DH_GROUPS_ALL
989L_CFLAGS += -DALL_DH_GROUPS
990endif
991ifdef CONFIG_INTERNAL_DH_GROUP5
992ifdef NEED_DH_GROUPS
993OBJS += src/crypto/dh_group5.c
994endif
995endif
996
997ifdef NEED_ECC
998L_CFLAGS += -DCONFIG_ECC
999endif
1000
1001ifdef CONFIG_NO_RANDOM_POOL
1002L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
1003else
1004OBJS += src/crypto/random.c
1005HOBJS += src/crypto/random.c
1006HOBJS += src/utils/eloop.c
1007HOBJS += $(SHA1OBJS)
1008ifneq ($(CONFIG_TLS), openssl)
1009HOBJS += src/crypto/md5.c
1010endif
1011endif
1012
1013ifdef CONFIG_RADIUS_SERVER
1014L_CFLAGS += -DRADIUS_SERVER
1015OBJS += src/radius/radius_server.c
1016endif
1017
1018ifdef CONFIG_IPV6
1019L_CFLAGS += -DCONFIG_IPV6
1020endif
1021
1022ifdef CONFIG_DRIVER_RADIUS_ACL
1023L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
1024endif
1025
1026ifdef NEED_BASE64
1027OBJS += src/utils/base64.c
1028endif
1029
1030ifdef NEED_JSON
1031OBJS += src/utils/json.c
1032L_CFLAGS += -DCONFIG_JSON
1033endif
1034
1035ifdef NEED_AP_MLME
1036OBJS += src/ap/wmm.c
1037OBJS += src/ap/ap_list.c
1038OBJS += src/ap/ieee802_11.c
1039OBJS += src/ap/hw_features.c
1040OBJS += src/ap/dfs.c
1041L_CFLAGS += -DNEED_AP_MLME
1042endif
1043OBJS += src/ap/ieee802_11_ht.c
1044
1045ifdef CONFIG_IEEE80211AC
1046OBJS += src/ap/ieee802_11_vht.c
1047endif
1048
1049ifdef CONFIG_IEEE80211AX
1050OBJS += src/ap/ieee802_11_he.c
1051endif
1052
1053ifdef CONFIG_P2P_MANAGER
1054L_CFLAGS += -DCONFIG_P2P_MANAGER
1055OBJS += src/ap/p2p_hostapd.c
1056endif
1057
1058ifdef CONFIG_HS20
1059L_CFLAGS += -DCONFIG_HS20
1060OBJS += src/ap/hs20.c
1061CONFIG_INTERWORKING=y
1062endif
1063
1064ifdef CONFIG_INTERWORKING
1065L_CFLAGS += -DCONFIG_INTERWORKING
1066NEED_GAS=y
1067endif
1068
1069ifdef NEED_GAS
1070OBJS += src/common/gas.c
1071OBJS += src/ap/gas_serv.c
1072endif
1073
1074ifdef CONFIG_PROXYARP
1075L_CFLAGS += -DCONFIG_PROXYARP
1076OBJS += src/ap/x_snoop.c
1077OBJS += src/ap/dhcp_snoop.c
1078ifdef CONFIG_IPV6
1079OBJS += src/ap/ndisc_snoop.c
1080endif
1081endif
1082
1083OBJS += src/drivers/driver_common.c
1084
1085ifdef CONFIG_ACS
1086L_CFLAGS += -DCONFIG_ACS
1087OBJS += src/ap/acs.c
1088LIBS += -lm
1089endif
1090
1091ifdef CONFIG_NO_STDOUT_DEBUG
1092L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1093endif
1094
1095ifdef CONFIG_DEBUG_SYSLOG
1096L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
1097endif
1098
1099ifdef CONFIG_DEBUG_LINUX_TRACING
1100L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1101endif
1102
1103ifdef CONFIG_DEBUG_FILE
1104L_CFLAGS += -DCONFIG_DEBUG_FILE
1105endif
1106
1107ifdef CONFIG_ANDROID_LOG
1108L_CFLAGS += -DCONFIG_ANDROID_LOG
1109endif
1110
1111OBJS_c = hostapd_cli.c
1112OBJS_c += src/common/wpa_ctrl.c
1113OBJS_c += src/utils/os_$(CONFIG_OS).c
1114OBJS_c += src/common/cli.c
1115OBJS_c += src/utils/eloop.c
1116OBJS_c += src/utils/common.c
1117ifdef CONFIG_WPA_TRACE
1118OBJS_c += src/utils/trace.c
1119endif
1120OBJS_c += src/utils/wpa_debug.c
1121ifdef CONFIG_WPA_CLI_EDIT
1122OBJS_c += src/utils/edit.c
1123else
1124OBJS_c += src/utils/edit_simple.c
1125endif
1126
1127ifeq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
1128ifdef CONFIG_CTRL_IFACE_HIDL
1129HOSTAPD_USE_HIDL=y
1130L_CFLAGS += -DCONFIG_CTRL_IFACE_HIDL
1131L_CPPFLAGS = -Wall -Werror
1132endif
1133endif
1134
1135########################
1136
1137include $(CLEAR_VARS)
1138LOCAL_MODULE := hostapd_cli
1139LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD SPDX-license-identifier-BSD-3-Clause SPDX-license-identifier-ISC legacy_unencumbered
1140LOCAL_LICENSE_CONDITIONS := notice unencumbered
1141LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYING $(LOCAL_PATH)/../NOTICE
1142LOCAL_PROPRIETARY_MODULE := true
1143LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1144LOCAL_CFLAGS := $(L_CFLAGS)
1145LOCAL_SRC_FILES := $(OBJS_c)
1146LOCAL_C_INCLUDES := $(INCLUDES)
1147include $(BUILD_EXECUTABLE)
1148
1149########################
1150include $(CLEAR_VARS)
1151LOCAL_MODULE := hostapd
1152LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD SPDX-license-identifier-BSD-3-Clause SPDX-license-identifier-ISC legacy_unencumbered
1153LOCAL_LICENSE_CONDITIONS := notice unencumbered
1154LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYING $(LOCAL_PATH)/../NOTICE
1155LOCAL_MODULE_TAGS := optional
1156LOCAL_PROPRIETARY_MODULE := true
1157LOCAL_MODULE_RELATIVE_PATH := hw
1158LOCAL_VINTF_FRAGMENTS := android.hardware.wifi.hostapd.xml
1159ifdef CONFIG_DRIVER_CUSTOM
1160LOCAL_STATIC_LIBRARIES := libCustomWifi
1161endif
1162ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
1163LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
1164endif
1165LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
1166ifdef CONFIG_DRIVER_NL80211
1167ifneq ($(wildcard external/libnl),)
1168LOCAL_SHARED_LIBRARIES += libnl
1169else
1170LOCAL_STATIC_LIBRARIES += libnl_2
1171endif
1172endif
1173ifeq ($(HOSTAPD_USE_HIDL), y)
1174LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.0
1175LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.1
1176LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.2
1177LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.3
1178LOCAL_SHARED_LIBRARIES += libbase libhidlbase libutils
1179LOCAL_STATIC_LIBRARIES += libhostapd_hidl
1180endif
1181LOCAL_CFLAGS := $(L_CFLAGS)
1182LOCAL_SRC_FILES := $(OBJS)
1183LOCAL_C_INCLUDES := $(INCLUDES)
1184LOCAL_INIT_RC := hostapd.android.rc
1185include $(BUILD_EXECUTABLE)
1186
1187########################
1188include $(CLEAR_VARS)
1189LOCAL_MODULE := hostapd_nohidl
1190LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD SPDX-license-identifier-BSD-3-Clause SPDX-license-identifier-ISC legacy_unencumbered
1191LOCAL_LICENSE_CONDITIONS := notice unencumbered
1192LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYING $(LOCAL_PATH)/../NOTICE
1193LOCAL_MODULE_TAGS := optional
1194LOCAL_PROPRIETARY_MODULE := true
1195ifdef CONFIG_DRIVER_CUSTOM
1196LOCAL_STATIC_LIBRARIES := libCustomWifi
1197endif
1198ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
1199LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
1200endif
1201LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
1202ifdef CONFIG_DRIVER_NL80211
1203ifneq ($(wildcard external/libnl),)
1204LOCAL_SHARED_LIBRARIES += libnl
1205else
1206LOCAL_STATIC_LIBRARIES += libnl_2
1207endif
1208endif
1209LOCAL_CFLAGS := $(patsubst -DCONFIG_CTRL_IFACE_HIDL,,$(L_CFLAGS))
1210LOCAL_SRC_FILES := $(OBJS)
1211LOCAL_C_INCLUDES := $(INCLUDES)
1212include $(BUILD_EXECUTABLE)
1213
1214ifeq ($(HOSTAPD_USE_HIDL), y)
1215### Hidl service library ###
1216########################
1217include $(CLEAR_VARS)
1218LOCAL_MODULE := libhostapd_hidl
1219LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD SPDX-license-identifier-BSD-3-Clause SPDX-license-identifier-ISC legacy_unencumbered
1220LOCAL_LICENSE_CONDITIONS := notice unencumbered
1221LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../COPYING $(LOCAL_PATH)/../NOTICE
1222LOCAL_VENDOR_MODULE := true
1223LOCAL_CPPFLAGS := $(L_CPPFLAGS)
1224LOCAL_CFLAGS := $(L_CFLAGS)
1225LOCAL_C_INCLUDES := $(INCLUDES)
1226HIDL_INTERFACE_VERSION = 1.3
1227LOCAL_SRC_FILES := \
1228    hidl/$(HIDL_INTERFACE_VERSION)/hidl.cpp \
1229    hidl/$(HIDL_INTERFACE_VERSION)/hostapd.cpp
1230LOCAL_SHARED_LIBRARIES := \
1231    android.hardware.wifi.hostapd@1.0 \
1232    android.hardware.wifi.hostapd@1.1 \
1233    android.hardware.wifi.hostapd@1.2 \
1234    android.hardware.wifi.hostapd@1.3 \
1235    libbase \
1236    libhidlbase \
1237    libutils \
1238    liblog
1239LOCAL_EXPORT_C_INCLUDE_DIRS := \
1240    $(LOCAL_PATH)/hidl/$(HIDL_INTERFACE_VERSION)
1241include $(BUILD_STATIC_LIBRARY)
1242endif # HOSTAPD_USE_HIDL == y
1243endif # ifeq ($(WPA_BUILD_HOSTAPD),true)
1244