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