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