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