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