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