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