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