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