1BINALL=wpa_supplicant wpa_cli 2 3ALL = $(BINALL) 4ALL += systemd/wpa_supplicant.service 5ALL += systemd/wpa_supplicant@.service 6ALL += systemd/wpa_supplicant-nl80211@.service 7ALL += systemd/wpa_supplicant-wired@.service 8ALL += dbus/fi.w1.wpa_supplicant1.service 9 10EXTRA_TARGETS=dynamic_eap_methods 11 12CONFIG_FILE=.config 13include ../src/build.rules 14 15ifdef CONFIG_BUILD_PASN_SO 16# add the dependency this way to allow CONFIG_BUILD_PASN_SO 17# being set in the config which is read by build.rules 18_all: libpasn.so 19endif 20 21ifdef CONFIG_BUILD_WPA_CLIENT_SO 22# add the dependency this way to allow CONFIG_BUILD_WPA_CLIENT_SO 23# being set in the config which is read by build.rules 24_all: libwpa_client.so 25endif 26 27ifndef CONFIG_NO_WPA_PASSPHRASE 28# add the dependency this way to allow CONFIG_NO_WPA_PASSPHRASE 29# being set in the config which is read by build.rules 30_all: wpa_passphrase 31endif 32 33ifdef LIBS 34# If LIBS is set with some global build system defaults, clone those for 35# LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well. 36ifndef LIBS_c 37LIBS_c := $(LIBS) 38endif 39ifndef LIBS_p 40LIBS_p := $(LIBS) 41endif 42endif 43 44export LIBDIR ?= /usr/local/lib 45export INCDIR ?= /usr/local/include 46export BINDIR ?= /usr/local/sbin 47PKG_CONFIG ?= pkg-config 48 49CFLAGS += $(EXTRA_CFLAGS) 50CFLAGS += -I$(abspath ../src) 51CFLAGS += -I$(abspath ../src/utils) 52 53ifndef CONFIG_NO_GITVER 54# Add VERSION_STR postfix for builds from a git repository 55ifeq ($(wildcard ../.git),../.git) 56GITVER := $(shell git describe --dirty=+) 57ifneq ($(GITVER),) 58CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\" 59endif 60endif 61endif 62 63ifdef CONFIG_TESTING_OPTIONS 64CFLAGS += -DCONFIG_TESTING_OPTIONS 65CONFIG_WPS_TESTING=y 66CONFIG_TDLS_TESTING=y 67endif 68 69mkconfig: 70 @if [ -f .config ]; then \ 71 echo '.config exists - did not replace it'; \ 72 exit 1; \ 73 fi 74 echo CONFIG_DRIVER_HOSTAP=y >> .config 75 echo CONFIG_DRIVER_WEXT=y >> .config 76 77$(DESTDIR)$(BINDIR)/%: % 78 install -D $(<) $(@) 79 80install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL)) 81 $(MAKE) -C ../src install 82ifndef CONFIG_NO_WPA_PASSPHRASE 83 install -D wpa_passphrase $(DESTDIR)/$(BINDIR)/wpa_passphrase 84endif 85 86ifdef CONFIG_BUILD_PASN_SO 87 install -m 0644 -D libpasn.so $(DESTDIR)/$(LIBDIR)/libpasn.so 88endif 89 90ifdef CONFIG_BUILD_WPA_CLIENT_SO 91 install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so 92 install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h 93endif 94 if ls eap_*.so >/dev/null 2>&1; then \ 95 install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \ 96 cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \ 97 ; fi 98 99ifdef CONFIG_FIPS 100CONFIG_NO_RANDOM_POOL= 101endif 102 103OBJS = config.o 104OBJS += notify.o 105OBJS += bss.o 106OBJS += eap_register.o 107OBJS += ../src/utils/common.o 108OBJS += ../src/utils/config.o 109OBJS += ../src/utils/wpa_debug.o 110OBJS += ../src/utils/wpabuf.o 111OBJS += ../src/utils/bitfield.o 112OBJS += ../src/utils/ip_addr.o 113OBJS += ../src/utils/crc32.o 114OBJS += op_classes.o 115OBJS += rrm.o 116OBJS += twt.o 117OBJS += robust_av.o 118OBJS_p = wpa_passphrase.o 119OBJS_p += ../src/utils/common.o 120OBJS_p += ../src/utils/wpa_debug.o 121OBJS_p += ../src/utils/wpabuf.o 122OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o 123OBJS_c += ../src/utils/wpa_debug.o 124OBJS_c += ../src/utils/common.o 125OBJS_c += ../src/common/cli.o 126OBJS += wmm_ac.o 127 128ifndef CONFIG_OS 129ifdef CONFIG_NATIVE_WINDOWS 130CONFIG_OS=win32 131else 132CONFIG_OS=unix 133endif 134endif 135 136ifeq ($(CONFIG_OS), internal) 137CFLAGS += -DOS_NO_C_LIB_DEFINES 138endif 139 140OBJS += ../src/utils/os_$(CONFIG_OS).o 141OBJS_p += ../src/utils/os_$(CONFIG_OS).o 142OBJS_c += ../src/utils/os_$(CONFIG_OS).o 143 144ifdef CONFIG_WPA_TRACE 145CFLAGS += -DWPA_TRACE 146OBJS += ../src/utils/trace.o 147OBJS_p += ../src/utils/trace.o 148OBJS_c += ../src/utils/trace.o 149OBJS_priv += ../src/utils/trace.o 150LIBCTRL += ../src/utils/trace.o 151LIBCTRLSO += ../src/utils/trace.c 152LDFLAGS += -rdynamic 153CFLAGS += -funwind-tables 154ifdef CONFIG_WPA_TRACE_BFD 155CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD 156LIBS += -lbfd -ldl -liberty -lz 157LIBS_p += -lbfd -ldl -liberty -lz 158LIBS_c += -lbfd -ldl -liberty -lz 159endif 160endif 161 162ifndef CONFIG_ELOOP 163CONFIG_ELOOP=eloop 164endif 165OBJS += ../src/utils/$(CONFIG_ELOOP).o 166OBJS_c += ../src/utils/$(CONFIG_ELOOP).o 167 168ifndef CONFIG_OSX 169ifeq ($(CONFIG_ELOOP), eloop) 170# Using glibc < 2.17 requires -lrt for clock_gettime() 171# OS X has an alternate implementation 172LIBS += -lrt 173LIBS_c += -lrt 174LIBS_p += -lrt 175endif 176endif 177 178ifdef CONFIG_ELOOP_POLL 179CFLAGS += -DCONFIG_ELOOP_POLL 180endif 181 182ifdef CONFIG_ELOOP_EPOLL 183CFLAGS += -DCONFIG_ELOOP_EPOLL 184endif 185 186ifdef CONFIG_ELOOP_KQUEUE 187CFLAGS += -DCONFIG_ELOOP_KQUEUE 188endif 189 190ifdef CONFIG_EAPOL_TEST 191CFLAGS += -Werror -DEAPOL_TEST 192endif 193 194ifdef CONFIG_CODE_COVERAGE 195CFLAGS += -O0 -fprofile-arcs -ftest-coverage 196LIBS += -lgcov 197LIBS_c += -lgcov 198LIBS_p += -lgcov 199endif 200 201ifdef CONFIG_HT_OVERRIDES 202CFLAGS += -DCONFIG_HT_OVERRIDES 203endif 204 205ifdef CONFIG_VHT_OVERRIDES 206CFLAGS += -DCONFIG_VHT_OVERRIDES 207endif 208 209ifdef CONFIG_HE_OVERRIDES 210CFLAGS += -DCONFIG_HE_OVERRIDES 211endif 212 213ifndef CONFIG_BACKEND 214CONFIG_BACKEND=file 215endif 216 217ifeq ($(CONFIG_BACKEND), file) 218OBJS += config_file.o 219ifndef CONFIG_NO_CONFIG_BLOBS 220NEED_BASE64=y 221endif 222CFLAGS += -DCONFIG_BACKEND_FILE 223endif 224 225ifeq ($(CONFIG_BACKEND), winreg) 226OBJS += config_winreg.o 227endif 228 229ifeq ($(CONFIG_BACKEND), none) 230OBJS += config_none.o 231endif 232 233ifdef CONFIG_NO_CONFIG_WRITE 234CFLAGS += -DCONFIG_NO_CONFIG_WRITE 235endif 236 237ifdef CONFIG_NO_CONFIG_BLOBS 238CFLAGS += -DCONFIG_NO_CONFIG_BLOBS 239endif 240 241ifdef CONFIG_NO_SCAN_PROCESSING 242CFLAGS += -DCONFIG_NO_SCAN_PROCESSING 243endif 244 245ifdef CONFIG_SUITEB 246CFLAGS += -DCONFIG_SUITEB 247endif 248 249ifdef CONFIG_SUITEB192 250CFLAGS += -DCONFIG_SUITEB192 251NEED_SHA384=y 252endif 253 254ifdef CONFIG_OCV 255CFLAGS += -DCONFIG_OCV 256OBJS += ../src/common/ocv.o 257endif 258 259ifdef CONFIG_IEEE80211R 260CFLAGS += -DCONFIG_IEEE80211R 261OBJS += ../src/rsn_supp/wpa_ft.o 262endif 263 264ifdef CONFIG_MESH 265NEED_80211_COMMON=y 266NEED_AES_SIV=y 267CONFIG_SAE=y 268CONFIG_AP=y 269CFLAGS += -DCONFIG_MESH 270OBJS += mesh.o 271OBJS += mesh_mpm.o 272OBJS += mesh_rsn.o 273endif 274 275ifdef CONFIG_SAE 276CFLAGS += -DCONFIG_SAE 277OBJS += ../src/common/sae.o 278ifdef CONFIG_SAE_PK 279CFLAGS += -DCONFIG_SAE_PK 280NEED_AES_SIV=y 281OBJS += ../src/common/sae_pk.o 282endif 283NEED_ECC=y 284NEED_DH_GROUPS=y 285NEED_HMAC_SHA256_KDF=y 286NEED_DRAGONFLY=y 287ifdef CONFIG_TESTING_OPTIONS 288NEED_DH_GROUPS_ALL=y 289endif 290endif 291 292ifdef CONFIG_DPP 293CFLAGS += -DCONFIG_DPP 294OBJS += ../src/common/dpp.o 295OBJS += ../src/common/dpp_auth.o 296OBJS += ../src/common/dpp_backup.o 297OBJS += ../src/common/dpp_crypto.o 298OBJS += ../src/common/dpp_pkex.o 299OBJS += ../src/common/dpp_reconfig.o 300OBJS += ../src/common/dpp_tcp.o 301OBJS += dpp_supplicant.o 302NEED_AES_SIV=y 303NEED_HMAC_SHA256_KDF=y 304NEED_HMAC_SHA384_KDF=y 305NEED_HMAC_SHA512_KDF=y 306NEED_SHA384=y 307NEED_SHA512=y 308NEED_ECC=y 309NEED_JSON=y 310NEED_GAS_SERVER=y 311NEED_BASE64=y 312NEED_ASN1=y 313ifdef CONFIG_DPP2 314CFLAGS += -DCONFIG_DPP2 315endif 316ifdef CONFIG_DPP3 317CFLAGS += -DCONFIG_DPP3 318endif 319endif 320 321ifdef CONFIG_OWE 322CFLAGS += -DCONFIG_OWE 323NEED_ECC=y 324NEED_HMAC_SHA256_KDF=y 325NEED_HMAC_SHA384_KDF=y 326NEED_HMAC_SHA512_KDF=y 327NEED_SHA384=y 328NEED_SHA512=y 329endif 330 331ifdef CONFIG_WAPI_INTERFACE 332L_CFLAGS += -DCONFIG_WAPI_INTERFACE 333endif 334 335ifdef CONFIG_FILS 336CFLAGS += -DCONFIG_FILS 337NEED_SHA384=y 338NEED_AES_SIV=y 339ifdef CONFIG_FILS_SK_PFS 340CFLAGS += -DCONFIG_FILS_SK_PFS 341NEED_ECC=y 342endif 343endif 344 345ifdef CONFIG_MBO 346CONFIG_WNM=y 347endif 348 349ifdef CONFIG_WNM 350CFLAGS += -DCONFIG_WNM 351OBJS += wnm_sta.o 352endif 353 354ifdef CONFIG_TDLS 355CFLAGS += -DCONFIG_TDLS 356OBJS += ../src/rsn_supp/tdls.o 357endif 358 359ifdef CONFIG_TDLS_TESTING 360CFLAGS += -DCONFIG_TDLS_TESTING 361endif 362 363ifdef CONFIG_PMKSA_CACHE_EXTERNAL 364CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL 365endif 366 367ifndef CONFIG_NO_WPA 368OBJS += ../src/rsn_supp/wpa.o 369OBJS += ../src/rsn_supp/preauth.o 370OBJS += ../src/rsn_supp/pmksa_cache.o 371OBJS += ../src/rsn_supp/wpa_ie.o 372OBJS += ../src/common/wpa_common.o 373NEED_AES=y 374NEED_SHA1=y 375NEED_MD5=y 376NEED_RC4=y 377else 378CFLAGS += -DCONFIG_NO_WPA 379ifeq ($(CONFIG_TLS), internal) 380NEED_SHA1=y 381NEED_MD5=y 382endif 383endif 384 385ifdef CONFIG_IBSS_RSN 386NEED_RSN_AUTHENTICATOR=y 387CFLAGS += -DCONFIG_IBSS_RSN 388CFLAGS += -DCONFIG_NO_VLAN 389OBJS += ibss_rsn.o 390endif 391 392ifdef CONFIG_MATCH_IFACE 393CFLAGS += -DCONFIG_MATCH_IFACE 394endif 395 396ifdef CONFIG_P2P 397OBJS += p2p_supplicant.o 398OBJS += p2p_supplicant_sd.o 399OBJS += ../src/p2p/p2p.o 400OBJS += ../src/p2p/p2p_utils.o 401OBJS += ../src/p2p/p2p_parse.o 402OBJS += ../src/p2p/p2p_build.o 403OBJS += ../src/p2p/p2p_go_neg.o 404OBJS += ../src/p2p/p2p_sd.o 405OBJS += ../src/p2p/p2p_pd.o 406OBJS += ../src/p2p/p2p_invitation.o 407OBJS += ../src/p2p/p2p_dev_disc.o 408OBJS += ../src/p2p/p2p_group.o 409OBJS += ../src/ap/p2p_hostapd.o 410CFLAGS += -DCONFIG_P2P 411NEED_GAS=y 412NEED_OFFCHANNEL=y 413CONFIG_WPS=y 414CONFIG_AP=y 415ifdef CONFIG_P2P_STRICT 416CFLAGS += -DCONFIG_P2P_STRICT 417endif 418ifdef CONFIG_WIFI_DISPLAY 419CFLAGS += -DCONFIG_WIFI_DISPLAY 420OBJS += wifi_display.o 421endif 422endif 423 424ifdef CONFIG_PASN 425CFLAGS += -DCONFIG_PASN 426CFLAGS += -DCONFIG_PTKSA_CACHE 427NEED_HMAC_SHA256_KDF=y 428NEED_HMAC_SHA384_KDF=y 429NEED_SHA256=y 430NEED_SHA384=y 431OBJS += ../src/common/ptksa_cache.o 432OBJS += ../src/pasn/pasn_initiator.o 433OBJS += pasn_supplicant.o 434endif 435 436ifdef CONFIG_HS20 437OBJS += hs20_supplicant.o 438CFLAGS += -DCONFIG_HS20 439CONFIG_INTERWORKING=y 440endif 441 442ifdef CONFIG_INTERWORKING 443OBJS += interworking.o 444CFLAGS += -DCONFIG_INTERWORKING 445NEED_GAS=y 446endif 447 448ifdef CONFIG_NO_ROAMING 449CFLAGS += -DCONFIG_NO_ROAMING 450endif 451 452include ../src/drivers/drivers.mak 453ifdef CONFIG_AP 454OBJS_d += $(DRV_BOTH_OBJS) 455CFLAGS += $(DRV_BOTH_CFLAGS) 456LDFLAGS += $(DRV_BOTH_LDFLAGS) 457LIBS += $(DRV_BOTH_LIBS) 458else 459NEED_AP_MLME= 460OBJS_d += $(DRV_WPA_OBJS) 461CFLAGS += $(DRV_WPA_CFLAGS) 462LDFLAGS += $(DRV_WPA_LDFLAGS) 463LIBS += $(DRV_WPA_LIBS) 464endif 465 466ifndef CONFIG_L2_PACKET 467CONFIG_L2_PACKET=linux 468endif 469 470OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o 471 472ifeq ($(CONFIG_L2_PACKET), pcap) 473ifdef CONFIG_WINPCAP 474CFLAGS += -DCONFIG_WINPCAP 475LIBS += -lwpcap -lpacket 476LIBS_w += -lwpcap 477else 478LIBS += -ldnet -lpcap 479endif 480endif 481 482ifeq ($(CONFIG_L2_PACKET), winpcap) 483LIBS += -lwpcap -lpacket 484LIBS_w += -lwpcap 485endif 486 487ifeq ($(CONFIG_L2_PACKET), freebsd) 488LIBS += -lpcap 489endif 490 491ifdef CONFIG_ERP 492CFLAGS += -DCONFIG_ERP 493NEED_HMAC_SHA256_KDF=y 494endif 495 496ifdef CONFIG_EAP_TLS 497# EAP-TLS 498ifeq ($(CONFIG_EAP_TLS), dyn) 499CFLAGS += -DEAP_TLS_DYNAMIC 500EAPDYN += eap_tls.so 501else 502CFLAGS += -DEAP_TLS 503OBJS += ../src/eap_peer/eap_tls.o 504endif 505TLS_FUNCS=y 506CONFIG_IEEE8021X_EAPOL=y 507ifdef CONFIG_EAP_TLSV1_3 508CFLAGS += -DEAP_TLSV1_3 509endif 510endif 511 512ifdef CONFIG_EAP_UNAUTH_TLS 513# EAP-UNAUTH-TLS 514CFLAGS += -DEAP_UNAUTH_TLS 515ifndef CONFIG_EAP_TLS 516OBJS += ../src/eap_peer/eap_tls.o 517TLS_FUNCS=y 518endif 519CONFIG_IEEE8021X_EAPOL=y 520endif 521 522ifdef CONFIG_EAP_PEAP 523# EAP-PEAP 524SRC_EAP_PEAP = ../src/eap_peer/eap_peap.c ../src/eap_common/eap_peap_common.c 525ifeq ($(CONFIG_EAP_PEAP), dyn) 526CFLAGS += -DEAP_PEAP_DYNAMIC 527EAPDYN += eap_peap.so 528else 529CFLAGS += -DEAP_PEAP 530OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PEAP)) 531endif 532TLS_FUNCS=y 533CONFIG_IEEE8021X_EAPOL=y 534endif 535 536ifdef CONFIG_EAP_TTLS 537# EAP-TTLS 538ifeq ($(CONFIG_EAP_TTLS), dyn) 539CFLAGS += -DEAP_TTLS_DYNAMIC 540EAPDYN += eap_ttls.so 541else 542CFLAGS += -DEAP_TTLS 543OBJS += ../src/eap_peer/eap_ttls.o 544endif 545TLS_FUNCS=y 546ifndef CONFIG_FIPS 547MS_FUNCS=y 548CHAP=y 549endif 550CONFIG_IEEE8021X_EAPOL=y 551endif 552 553ifdef CONFIG_EAP_MD5 554# EAP-MD5 555ifeq ($(CONFIG_EAP_MD5), dyn) 556CFLAGS += -DEAP_MD5_DYNAMIC 557EAPDYN += eap_md5.so 558else 559CFLAGS += -DEAP_MD5 560OBJS += ../src/eap_peer/eap_md5.o 561endif 562CHAP=y 563CONFIG_IEEE8021X_EAPOL=y 564endif 565 566# backwards compatibility for old spelling 567ifdef CONFIG_MSCHAPV2 568ifndef CONFIG_EAP_MSCHAPV2 569CONFIG_EAP_MSCHAPV2=y 570endif 571endif 572 573ifdef CONFIG_EAP_MSCHAPV2 574# EAP-MSCHAPv2 575SRC_EAP_MSCHAPV2 = ../src/eap_peer/eap_mschapv2.c ../src/eap_peer/mschapv2.c 576ifeq ($(CONFIG_EAP_MSCHAPV2), dyn) 577CFLAGS += -DEAP_MSCHAPv2_DYNAMIC 578EAPDYN += eap_mschapv2.so 579else 580CFLAGS += -DEAP_MSCHAPv2 581OBJS += $(patsubst %.c, %.o, $(SRC_EAP_MSCHAPV2)) 582endif 583MS_FUNCS=y 584CONFIG_IEEE8021X_EAPOL=y 585endif 586 587ifdef CONFIG_EAP_GTC 588# EAP-GTC 589ifeq ($(CONFIG_EAP_GTC), dyn) 590CFLAGS += -DEAP_GTC_DYNAMIC 591EAPDYN += eap_gtc.so 592else 593CFLAGS += -DEAP_GTC 594OBJS += ../src/eap_peer/eap_gtc.o 595endif 596CONFIG_IEEE8021X_EAPOL=y 597endif 598 599ifdef CONFIG_EAP_OTP 600# EAP-OTP 601ifeq ($(CONFIG_EAP_OTP), dyn) 602CFLAGS += -DEAP_OTP_DYNAMIC 603EAPDYN += eap_otp.so 604else 605CFLAGS += -DEAP_OTP 606OBJS += ../src/eap_peer/eap_otp.o 607endif 608CONFIG_IEEE8021X_EAPOL=y 609endif 610 611ifdef CONFIG_EAP_SIM 612# EAP-SIM 613ifeq ($(CONFIG_EAP_SIM), dyn) 614CFLAGS += -DEAP_SIM_DYNAMIC 615EAPDYN += eap_sim.so 616else 617CFLAGS += -DEAP_SIM 618OBJS += ../src/eap_peer/eap_sim.o 619endif 620CONFIG_IEEE8021X_EAPOL=y 621CONFIG_EAP_SIM_COMMON=y 622NEED_AES_CBC=y 623endif 624 625ifdef CONFIG_EAP_LEAP 626# EAP-LEAP 627ifeq ($(CONFIG_EAP_LEAP), dyn) 628CFLAGS += -DEAP_LEAP_DYNAMIC 629EAPDYN += eap_leap.so 630else 631CFLAGS += -DEAP_LEAP 632OBJS += ../src/eap_peer/eap_leap.o 633endif 634MS_FUNCS=y 635CONFIG_IEEE8021X_EAPOL=y 636endif 637 638ifdef CONFIG_EAP_PSK 639# EAP-PSK 640SRC_EAP_PSK = ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c 641ifeq ($(CONFIG_EAP_PSK), dyn) 642CFLAGS += -DEAP_PSK_DYNAMIC 643EAPDYN += eap_psk.so 644else 645CFLAGS += -DEAP_PSK 646OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PSK)) 647endif 648CONFIG_IEEE8021X_EAPOL=y 649NEED_AES=y 650NEED_AES_ENCBLOCK=y 651NEED_AES_EAX=y 652endif 653 654ifdef CONFIG_EAP_AKA 655# EAP-AKA 656ifeq ($(CONFIG_EAP_AKA), dyn) 657CFLAGS += -DEAP_AKA_DYNAMIC 658EAPDYN += eap_aka.so 659else 660CFLAGS += -DEAP_AKA 661OBJS += ../src/eap_peer/eap_aka.o 662endif 663CONFIG_IEEE8021X_EAPOL=y 664CONFIG_EAP_SIM_COMMON=y 665NEED_AES_CBC=y 666endif 667 668ifdef CONFIG_EAP_PROXY 669CFLAGS += -DCONFIG_EAP_PROXY 670OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o 671include eap_proxy_$(CONFIG_EAP_PROXY).mak 672CONFIG_IEEE8021X_EAPOL=y 673endif 674 675ifdef CONFIG_EAP_AKA_PRIME 676# EAP-AKA' 677ifeq ($(CONFIG_EAP_AKA_PRIME), dyn) 678CFLAGS += -DEAP_AKA_PRIME_DYNAMIC 679else 680CFLAGS += -DEAP_AKA_PRIME 681endif 682endif 683 684ifdef CONFIG_EAP_SIM_COMMON 685OBJS += ../src/eap_common/eap_sim_common.o 686NEED_AES=y 687NEED_FIPS186_2_PRF=y 688endif 689 690ifdef CONFIG_EAP_FAST 691# EAP-FAST 692SRC_EAP_FAST = ../src/eap_peer/eap_fast.c ../src/eap_peer/eap_fast_pac.c 693SRC_EAP_FAST += ../src/eap_common/eap_fast_common.c 694ifeq ($(CONFIG_EAP_FAST), dyn) 695CFLAGS += -DEAP_FAST_DYNAMIC 696EAPDYN += eap_fast.so 697else 698CFLAGS += -DEAP_FAST 699OBJS += $(patsubst %.c, %.o, $(SRC_EAP_FAST)) 700endif 701TLS_FUNCS=y 702CONFIG_IEEE8021X_EAPOL=y 703NEED_T_PRF=y 704endif 705 706ifdef CONFIG_EAP_TEAP 707# EAP-TEAP 708SRC_EAP_TEAP = ../src/eap_peer/eap_teap.c ../src/eap_peer/eap_teap_pac.c 709SRC_EAP_TEAP += ../src/eap_common/eap_teap_common.c 710ifeq ($(CONFIG_EAP_TEAP), dyn) 711CFLAGS += -DEAP_TEAP_DYNAMIC 712EAPDYN += eap_teap.so 713else 714CFLAGS += -DEAP_TEAP 715OBJS += $(patsubst %.c, %.o, $(SRC_EAP_TEAP)) 716endif 717TLS_FUNCS=y 718CONFIG_IEEE8021X_EAPOL=y 719NEED_T_PRF=y 720NEED_SHA384=y 721NEED_TLS_PRF_SHA256=y 722NEED_TLS_PRF_SHA384=y 723endif 724 725ifdef CONFIG_EAP_PAX 726# EAP-PAX 727SRC_EAP_PAX = ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c 728ifeq ($(CONFIG_EAP_PAX), dyn) 729CFLAGS += -DEAP_PAX_DYNAMIC 730EAPDYN += eap_pax.so 731else 732CFLAGS += -DEAP_PAX 733OBJS += $(patsubst %.c, %.o, $(SRC_EAP_PAX)) 734endif 735CONFIG_IEEE8021X_EAPOL=y 736endif 737 738ifdef CONFIG_EAP_SAKE 739# EAP-SAKE 740SRC_EAP_SAKE = ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c 741ifeq ($(CONFIG_EAP_SAKE), dyn) 742CFLAGS += -DEAP_SAKE_DYNAMIC 743EAPDYN += eap_sake.so 744else 745CFLAGS += -DEAP_SAKE 746OBJS += $(patsubst %.c, %.o, $(SRC_EAP_SAKE)) 747endif 748CONFIG_IEEE8021X_EAPOL=y 749endif 750 751ifdef CONFIG_EAP_GPSK 752# EAP-GPSK 753SRC_EAP_GPSK = ../src/eap_peer/eap_gpsk.c ../src/eap_common/eap_gpsk_common.c 754ifeq ($(CONFIG_EAP_GPSK), dyn) 755CFLAGS += -DEAP_GPSK_DYNAMIC 756EAPDYN += eap_gpsk.so 757else 758CFLAGS += -DEAP_GPSK 759OBJS += $(patsubst %.c, %.o, $(SRC_EAP_GPSK)) 760endif 761CONFIG_IEEE8021X_EAPOL=y 762ifdef CONFIG_EAP_GPSK_SHA256 763CFLAGS += -DEAP_GPSK_SHA256 764endif 765endif 766 767ifdef CONFIG_EAP_PWD 768CFLAGS += -DEAP_PWD 769ifeq ($(CONFIG_TLS), wolfssl) 770CFLAGS += -DCONFIG_ECC 771endif 772OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o 773CONFIG_IEEE8021X_EAPOL=y 774NEED_ECC=y 775NEED_DRAGONFLY=y 776MS_FUNCS=y 777endif 778 779ifdef CONFIG_EAP_EKE 780# EAP-EKE 781SRC_EAP_EKE = ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c 782ifeq ($(CONFIG_EAP_EKE), dyn) 783CFLAGS += -DEAP_EKE_DYNAMIC 784EAPDYN += eap_eke.so 785else 786CFLAGS += -DEAP_EKE 787OBJS += $(patsubst %.c, %.o, $(SRC_EAP_EKE)) 788endif 789CONFIG_IEEE8021X_EAPOL=y 790NEED_DH_GROUPS=y 791NEED_DH_GROUPS_ALL=y 792NEED_AES_CBC=y 793endif 794 795ifdef CONFIG_WPS 796# EAP-WSC 797CFLAGS += -DCONFIG_WPS -DEAP_WSC 798OBJS += wps_supplicant.o 799OBJS += ../src/utils/uuid.o 800OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o 801OBJS += ../src/wps/wps.o 802OBJS += ../src/wps/wps_common.o 803OBJS += ../src/wps/wps_attr_parse.o 804OBJS += ../src/wps/wps_attr_build.o 805OBJS += ../src/wps/wps_attr_process.o 806OBJS += ../src/wps/wps_dev_attr.o 807OBJS += ../src/wps/wps_enrollee.o 808OBJS += ../src/wps/wps_registrar.o 809CONFIG_IEEE8021X_EAPOL=y 810NEED_DH_GROUPS=y 811NEED_BASE64=y 812NEED_AES_CBC=y 813NEED_MODEXP=y 814 815ifdef CONFIG_WPS_NFC 816CFLAGS += -DCONFIG_WPS_NFC 817OBJS += ../src/wps/ndef.o 818NEED_WPS_OOB=y 819endif 820 821ifdef NEED_WPS_OOB 822CFLAGS += -DCONFIG_WPS_OOB 823endif 824 825ifdef CONFIG_WPS_ER 826CONFIG_WPS_UPNP=y 827CFLAGS += -DCONFIG_WPS_ER 828OBJS += ../src/wps/wps_er.o 829OBJS += ../src/wps/wps_er_ssdp.o 830endif 831 832ifdef CONFIG_WPS_UPNP 833CFLAGS += -DCONFIG_WPS_UPNP 834OBJS += ../src/wps/wps_upnp.o 835OBJS += ../src/wps/wps_upnp_ssdp.o 836OBJS += ../src/wps/wps_upnp_web.o 837OBJS += ../src/wps/wps_upnp_event.o 838OBJS += ../src/wps/wps_upnp_ap.o 839OBJS += ../src/wps/upnp_xml.o 840OBJS += ../src/wps/httpread.o 841OBJS += ../src/wps/http_client.o 842OBJS += ../src/wps/http_server.o 843endif 844 845ifdef CONFIG_WPS_STRICT 846CFLAGS += -DCONFIG_WPS_STRICT 847OBJS += ../src/wps/wps_validate.o 848endif 849 850ifdef CONFIG_WPS_TESTING 851CFLAGS += -DCONFIG_WPS_TESTING 852endif 853 854ifdef CONFIG_WPS_REG_DISABLE_OPEN 855CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN 856endif 857 858endif 859 860ifdef CONFIG_EAP_IKEV2 861# EAP-IKEv2 862SRC_EAP_IKEV2 = ../src/eap_peer/eap_ikev2.c 863SRC_EAP_IKEV2 += ../src/eap_peer/ikev2.c 864SRC_EAP_IKEV2 += ../src/eap_common/eap_ikev2_common.c 865SRC_EAP_IKEV2 += ../src/eap_common/ikev2_common.c 866ifeq ($(CONFIG_EAP_IKEV2), dyn) 867CFLAGS += -DEAP_IKEV2_DYNAMIC 868EAPDYN += eap_ikev2.so 869else 870CFLAGS += -DEAP_IKEV2 871OBJS += $(patsubst %.c, %.o, $(SRC_EAP_IKEV2)) 872endif 873CONFIG_IEEE8021X_EAPOL=y 874NEED_DH_GROUPS=y 875NEED_DH_GROUPS_ALL=y 876NEED_MODEXP=y 877NEED_CIPHER=y 878endif 879 880ifdef CONFIG_EAP_VENDOR_TEST 881ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn) 882CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC 883EAPDYN += eap_vendor_test.so 884else 885CFLAGS += -DEAP_VENDOR_TEST 886OBJS += ../src/eap_peer/eap_vendor_test.o 887endif 888CONFIG_IEEE8021X_EAPOL=y 889endif 890 891ifdef CONFIG_EAP_TNC 892# EAP-TNC 893CFLAGS += -DEAP_TNC 894OBJS += ../src/eap_peer/eap_tnc.o 895OBJS += ../src/eap_peer/tncc.o 896NEED_BASE64=y 897ifndef CONFIG_NATIVE_WINDOWS 898ifndef CONFIG_DRIVER_BSD 899LIBS += -ldl 900endif 901endif 902endif 903 904ifdef CONFIG_MACSEC 905CFLAGS += -DCONFIG_MACSEC 906CONFIG_IEEE8021X_EAPOL=y 907NEED_AES_ENCBLOCK=y 908NEED_AES_UNWRAP=y 909NEED_AES_WRAP=y 910OBJS += wpas_kay.o 911OBJS += ../src/pae/ieee802_1x_cp.o 912OBJS += ../src/pae/ieee802_1x_kay.o 913OBJS += ../src/pae/ieee802_1x_key.o 914OBJS += ../src/pae/ieee802_1x_secy_ops.o 915ifdef CONFIG_AP 916OBJS += ../src/ap/wpa_auth_kay.o 917endif 918endif 919 920ifdef CONFIG_IEEE8021X_EAPOL 921# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication) 922CFLAGS += -DIEEE8021X_EAPOL 923OBJS += ../src/eapol_supp/eapol_supp_sm.o 924OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o 925NEED_EAP_COMMON=y 926ifdef CONFIG_DYNAMIC_EAP_METHODS 927CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS 928LIBS += -ldl -rdynamic 929endif 930endif 931 932ifdef CONFIG_AP 933NEED_EAP_COMMON=y 934NEED_RSN_AUTHENTICATOR=y 935CFLAGS += -DCONFIG_AP 936OBJS += ap.o 937CFLAGS += -DCONFIG_NO_RADIUS 938CFLAGS += -DCONFIG_NO_ACCOUNTING 939CFLAGS += -DCONFIG_NO_VLAN 940OBJS += ../src/ap/hostapd.o 941OBJS += ../src/ap/wpa_auth_glue.o 942OBJS += ../src/ap/utils.o 943OBJS += ../src/ap/authsrv.o 944OBJS += ../src/ap/ap_config.o 945OBJS += ../src/ap/sta_info.o 946OBJS += ../src/ap/tkip_countermeasures.o 947OBJS += ../src/ap/ap_mlme.o 948OBJS += ../src/ap/ieee802_1x.o 949OBJS += ../src/eapol_auth/eapol_auth_sm.o 950OBJS += ../src/ap/ieee802_11_auth.o 951OBJS += ../src/ap/ieee802_11_shared.o 952OBJS += ../src/ap/drv_callbacks.o 953OBJS += ../src/ap/ap_drv_ops.o 954OBJS += ../src/ap/beacon.o 955OBJS += ../src/ap/bss_load.o 956OBJS += ../src/ap/eap_user_db.o 957OBJS += ../src/ap/neighbor_db.o 958OBJS += ../src/ap/rrm.o 959OBJS += ../src/ap/ieee802_11_ht.o 960ifdef CONFIG_IEEE80211AC 961OBJS += ../src/ap/ieee802_11_vht.o 962endif 963ifdef CONFIG_IEEE80211AX 964OBJS += ../src/ap/ieee802_11_he.o 965endif 966ifdef CONFIG_IEEE80211BE 967OBJS += ../src/ap/ieee802_11_eht.o 968endif 969ifdef CONFIG_WNM_AP 970CFLAGS += -DCONFIG_WNM_AP 971OBJS += ../src/ap/wnm_ap.o 972endif 973ifdef CONFIG_MBO 974OBJS += ../src/ap/mbo_ap.o 975endif 976ifdef CONFIG_FILS 977OBJS += ../src/ap/fils_hlp.o 978endif 979ifdef CONFIG_CTRL_IFACE 980OBJS += ../src/ap/ctrl_iface_ap.o 981endif 982 983CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY 984OBJS += ../src/eap_server/eap_server.o 985OBJS += ../src/eap_server/eap_server_identity.o 986OBJS += ../src/eap_server/eap_server_methods.o 987 988ifdef CONFIG_IEEE80211AC 989CFLAGS += -DCONFIG_IEEE80211AC 990endif 991ifdef CONFIG_IEEE80211BE 992CONFIG_IEEE80211AX=y 993CFLAGS += -DCONFIG_IEEE80211BE 994endif 995ifdef CONFIG_IEEE80211AX 996CFLAGS += -DCONFIG_IEEE80211AX 997endif 998 999ifdef NEED_AP_MLME 1000OBJS += ../src/ap/wmm.o 1001OBJS += ../src/ap/ap_list.o 1002OBJS += ../src/ap/comeback_token.o 1003OBJS += ../src/pasn/pasn_responder.o 1004OBJS += ../src/ap/ieee802_11.o 1005OBJS += ../src/ap/hw_features.o 1006OBJS += ../src/ap/dfs.o 1007CFLAGS += -DNEED_AP_MLME 1008endif 1009ifdef CONFIG_WPS 1010CFLAGS += -DEAP_SERVER_WSC 1011OBJS += ../src/ap/wps_hostapd.o 1012OBJS += ../src/eap_server/eap_server_wsc.o 1013endif 1014ifdef CONFIG_DPP 1015OBJS += ../src/ap/dpp_hostapd.o 1016OBJS += ../src/ap/gas_query_ap.o 1017NEED_AP_GAS_SERV=y 1018endif 1019ifdef CONFIG_INTERWORKING 1020NEED_AP_GAS_SERV=y 1021endif 1022ifdef NEED_AP_GAS_SERV 1023OBJS += ../src/ap/gas_serv.o 1024endif 1025ifdef CONFIG_HS20 1026OBJS += ../src/ap/hs20.o 1027endif 1028endif 1029 1030ifdef CONFIG_MBO 1031OBJS += mbo.o 1032CFLAGS += -DCONFIG_MBO 1033endif 1034 1035ifdef NEED_RSN_AUTHENTICATOR 1036CFLAGS += -DCONFIG_NO_RADIUS 1037NEED_AES_WRAP=y 1038OBJS += ../src/ap/wpa_auth.o 1039OBJS += ../src/ap/wpa_auth_ie.o 1040OBJS += ../src/ap/pmksa_cache_auth.o 1041endif 1042 1043ifdef CONFIG_ACS 1044CFLAGS += -DCONFIG_ACS 1045OBJS += ../src/ap/acs.o 1046LIBS += -lm 1047endif 1048 1049ifdef CONFIG_PCSC 1050# PC/SC interface for smartcards (USIM, GSM SIM) 1051CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC 1052OBJS += ../src/utils/pcsc_funcs.o 1053ifdef CONFIG_NATIVE_WINDOWS 1054#Once MinGW gets support for WinScard, -lwinscard could be used instead of the 1055#dynamic symbol loading that is now used in pcsc_funcs.c 1056#LIBS += -lwinscard 1057else 1058ifdef CONFIG_OSX 1059LIBS += -framework PCSC 1060else 1061LIBS += $(shell $(PKG_CONFIG) --libs libpcsclite) 1062endif 1063endif 1064endif 1065 1066ifdef CONFIG_SIM_SIMULATOR 1067CFLAGS += -DCONFIG_SIM_SIMULATOR 1068NEED_MILENAGE=y 1069endif 1070 1071ifdef CONFIG_USIM_SIMULATOR 1072CFLAGS += -DCONFIG_USIM_SIMULATOR 1073NEED_MILENAGE=y 1074endif 1075 1076ifdef NEED_MILENAGE 1077OBJS += ../src/crypto/milenage.o 1078NEED_AES_ENCBLOCK=y 1079endif 1080 1081ifdef CONFIG_PKCS12 1082CFLAGS += -DPKCS12_FUNCS 1083endif 1084 1085ifdef CONFIG_SMARTCARD 1086CFLAGS += -DCONFIG_SMARTCARD 1087endif 1088 1089ifdef NEED_DRAGONFLY 1090OBJS += ../src/common/dragonfly.o 1091endif 1092 1093ifdef MS_FUNCS 1094OBJS += ../src/crypto/ms_funcs.o 1095NEED_DES=y 1096NEED_MD4=y 1097endif 1098 1099ifdef CHAP 1100OBJS += ../src/eap_common/chap.o 1101endif 1102 1103ifdef TLS_FUNCS 1104NEED_DES=y 1105# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, EAP_FAST, and 1106# EAP_TEAP) 1107OBJS += ../src/eap_peer/eap_tls_common.o 1108ifndef CONFIG_FIPS 1109NEED_TLS_PRF=y 1110NEED_SHA1=y 1111NEED_MD5=y 1112endif 1113endif 1114 1115ifndef CONFIG_TLS 1116CONFIG_TLS=openssl 1117endif 1118 1119ifdef CONFIG_TLSV11 1120CFLAGS += -DCONFIG_TLSV11 1121endif 1122 1123ifdef CONFIG_TLSV12 1124CFLAGS += -DCONFIG_TLSV12 1125endif 1126 1127ifeq ($(CONFIG_TLS), wolfssl) 1128ifdef TLS_FUNCS 1129CFLAGS += -DWOLFSSL_DER_LOAD 1130OBJS += ../src/crypto/tls_wolfssl.o 1131endif 1132OBJS += ../src/crypto/crypto_wolfssl.o 1133OBJS_p += ../src/crypto/crypto_wolfssl.o 1134ifdef NEED_FIPS186_2_PRF 1135OBJS += ../src/crypto/fips_prf_wolfssl.o 1136endif 1137NEED_TLS_PRF_SHA256=y 1138LIBS += -lwolfssl -lm 1139LIBS_p += -lwolfssl -lm 1140endif 1141 1142ifeq ($(CONFIG_TLS), openssl) 1143CFLAGS += -DCRYPTO_RSA_OAEP_SHA256 1144ifdef TLS_FUNCS 1145CFLAGS += -DEAP_TLS_OPENSSL 1146OBJS += ../src/crypto/tls_openssl.o 1147OBJS += ../src/crypto/tls_openssl_ocsp.o 1148LIBS += -lssl 1149endif 1150OBJS += ../src/crypto/crypto_openssl.o 1151OBJS_p += ../src/crypto/crypto_openssl.o 1152OBJS_priv += ../src/crypto/crypto_openssl.o 1153ifdef NEED_FIPS186_2_PRF 1154OBJS += ../src/crypto/fips_prf_openssl.o 1155endif 1156NEED_TLS_PRF_SHA256=y 1157LIBS += -lcrypto 1158LIBS_p += -lcrypto 1159ifdef CONFIG_TLS_ADD_DL 1160LIBS += -ldl 1161LIBS_p += -ldl 1162endif 1163ifndef CONFIG_TLS_DEFAULT_CIPHERS 1164CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW" 1165endif 1166CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\" 1167endif 1168 1169ifeq ($(CONFIG_TLS), gnutls) 1170ifndef CONFIG_CRYPTO 1171# default to libgcrypt 1172CONFIG_CRYPTO=gnutls 1173endif 1174ifdef TLS_FUNCS 1175OBJS += ../src/crypto/tls_gnutls.o 1176LIBS += -lgnutls -lgpg-error 1177endif 1178OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1179OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1180OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o 1181ifdef NEED_FIPS186_2_PRF 1182OBJS += ../src/crypto/fips_prf_internal.o 1183SHA1OBJS += ../src/crypto/sha1-internal.o 1184endif 1185ifeq ($(CONFIG_CRYPTO), gnutls) 1186LIBS += -lgcrypt 1187LIBS_p += -lgcrypt 1188CONFIG_INTERNAL_RC4=y 1189CONFIG_INTERNAL_DH_GROUP5=y 1190endif 1191ifeq ($(CONFIG_CRYPTO), nettle) 1192LIBS += -lnettle -lgmp 1193LIBS_p += -lnettle -lgmp 1194CONFIG_INTERNAL_RC4=y 1195CONFIG_INTERNAL_DH_GROUP5=y 1196endif 1197endif 1198 1199ifeq ($(CONFIG_TLS), internal) 1200ifndef CONFIG_CRYPTO 1201CONFIG_CRYPTO=internal 1202endif 1203ifdef TLS_FUNCS 1204OBJS += ../src/crypto/crypto_internal-rsa.o 1205OBJS += ../src/crypto/tls_internal.o 1206OBJS += ../src/tls/tlsv1_common.o 1207OBJS += ../src/tls/tlsv1_record.o 1208OBJS += ../src/tls/tlsv1_cred.o 1209OBJS += ../src/tls/tlsv1_client.o 1210OBJS += ../src/tls/tlsv1_client_write.o 1211OBJS += ../src/tls/tlsv1_client_read.o 1212OBJS += ../src/tls/tlsv1_client_ocsp.o 1213OBJS += ../src/tls/rsa.o 1214OBJS += ../src/tls/x509v3.o 1215OBJS += ../src/tls/pkcs1.o 1216OBJS += ../src/tls/pkcs5.o 1217OBJS += ../src/tls/pkcs8.o 1218NEED_ASN1=y 1219NEED_BASE64=y 1220NEED_TLS_PRF=y 1221ifdef CONFIG_TLSV12 1222NEED_TLS_PRF_SHA256=y 1223endif 1224NEED_MODEXP=y 1225NEED_CIPHER=y 1226CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 1227endif 1228ifdef NEED_CIPHER 1229NEED_DES=y 1230OBJS += ../src/crypto/crypto_internal-cipher.o 1231endif 1232ifdef NEED_MODEXP 1233OBJS += ../src/crypto/crypto_internal-modexp.o 1234OBJS += ../src/tls/bignum.o 1235endif 1236ifeq ($(CONFIG_CRYPTO), libtomcrypt) 1237OBJS += ../src/crypto/crypto_libtomcrypt.o 1238OBJS_p += ../src/crypto/crypto_libtomcrypt.o 1239LIBS += -ltomcrypt -ltfm 1240LIBS_p += -ltomcrypt -ltfm 1241CONFIG_INTERNAL_SHA256=y 1242CONFIG_INTERNAL_RC4=y 1243CONFIG_INTERNAL_DH_GROUP5=y 1244endif 1245ifeq ($(CONFIG_CRYPTO), internal) 1246OBJS += ../src/crypto/crypto_internal.o 1247OBJS_p += ../src/crypto/crypto_internal.o 1248NEED_AES_ENC=y 1249CFLAGS += -DCONFIG_CRYPTO_INTERNAL 1250ifdef CONFIG_INTERNAL_LIBTOMMATH 1251CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 1252ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST 1253CFLAGS += -DLTM_FAST 1254endif 1255else 1256LIBS += -ltommath 1257LIBS_p += -ltommath 1258endif 1259CONFIG_INTERNAL_AES=y 1260CONFIG_INTERNAL_DES=y 1261CONFIG_INTERNAL_SHA1=y 1262CONFIG_INTERNAL_MD4=y 1263CONFIG_INTERNAL_MD5=y 1264CONFIG_INTERNAL_SHA256=y 1265CONFIG_INTERNAL_SHA384=y 1266CONFIG_INTERNAL_SHA512=y 1267CONFIG_INTERNAL_RC4=y 1268CONFIG_INTERNAL_DH_GROUP5=y 1269endif 1270ifeq ($(CONFIG_CRYPTO), cryptoapi) 1271OBJS += ../src/crypto/crypto_cryptoapi.o 1272OBJS_p += ../src/crypto/crypto_cryptoapi.o 1273CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI 1274CONFIG_INTERNAL_SHA256=y 1275CONFIG_INTERNAL_RC4=y 1276endif 1277endif 1278 1279ifeq ($(CONFIG_TLS), linux) 1280OBJS += ../src/crypto/crypto_linux.o 1281OBJS_p += ../src/crypto/crypto_linux.o 1282ifdef TLS_FUNCS 1283OBJS += ../src/crypto/crypto_internal-rsa.o 1284OBJS += ../src/crypto/tls_internal.o 1285OBJS += ../src/tls/tlsv1_common.o 1286OBJS += ../src/tls/tlsv1_record.o 1287OBJS += ../src/tls/tlsv1_cred.o 1288OBJS += ../src/tls/tlsv1_client.o 1289OBJS += ../src/tls/tlsv1_client_write.o 1290OBJS += ../src/tls/tlsv1_client_read.o 1291OBJS += ../src/tls/tlsv1_client_ocsp.o 1292OBJS += ../src/tls/rsa.o 1293OBJS += ../src/tls/x509v3.o 1294OBJS += ../src/tls/pkcs1.o 1295OBJS += ../src/tls/pkcs5.o 1296OBJS += ../src/tls/pkcs8.o 1297NEED_ASN1=y 1298NEED_BASE64=y 1299NEED_TLS_PRF=y 1300ifdef CONFIG_TLSV12 1301NEED_TLS_PRF_SHA256=y 1302endif 1303NEED_MODEXP=y 1304NEED_CIPHER=y 1305CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 1306endif 1307ifdef NEED_MODEXP 1308OBJS += ../src/crypto/crypto_internal-modexp.o 1309OBJS += ../src/tls/bignum.o 1310CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 1311CFLAGS += -DLTM_FAST 1312endif 1313CONFIG_INTERNAL_DH_GROUP5=y 1314ifdef NEED_FIPS186_2_PRF 1315OBJS += ../src/crypto/fips_prf_internal.o 1316OBJS += ../src/crypto/sha1-internal.o 1317endif 1318endif 1319 1320ifeq ($(CONFIG_TLS), none) 1321ifdef TLS_FUNCS 1322OBJS += ../src/crypto/tls_none.o 1323CFLAGS += -DEAP_TLS_NONE 1324CONFIG_INTERNAL_AES=y 1325CONFIG_INTERNAL_SHA1=y 1326CONFIG_INTERNAL_MD5=y 1327endif 1328OBJS += ../src/crypto/crypto_none.o 1329OBJS_p += ../src/crypto/crypto_none.o 1330CONFIG_INTERNAL_SHA256=y 1331CONFIG_INTERNAL_RC4=y 1332endif 1333 1334ifdef TLS_FUNCS 1335ifdef CONFIG_SMARTCARD 1336ifndef CONFIG_NATIVE_WINDOWS 1337ifneq ($(CONFIG_L2_PACKET), freebsd) 1338LIBS += -ldl 1339endif 1340endif 1341endif 1342endif 1343 1344ifndef TLS_FUNCS 1345OBJS += ../src/crypto/tls_none.o 1346ifeq ($(CONFIG_TLS), internal) 1347CONFIG_INTERNAL_AES=y 1348CONFIG_INTERNAL_SHA1=y 1349CONFIG_INTERNAL_MD5=y 1350CONFIG_INTERNAL_RC4=y 1351endif 1352endif 1353 1354AESOBJS = # none so far (see below) 1355ifdef CONFIG_INTERNAL_AES 1356AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o 1357endif 1358 1359ifneq ($(CONFIG_TLS), openssl) 1360ifneq ($(CONFIG_TLS), wolfssl) 1361NEED_INTERNAL_AES_WRAP=y 1362endif 1363endif 1364ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP 1365# Seems to be needed at least with BoringSSL 1366NEED_INTERNAL_AES_WRAP=y 1367CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP 1368endif 1369ifdef CONFIG_FIPS 1370# Have to use internal AES key wrap routines to use OpenSSL EVP since the 1371# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode. 1372NEED_INTERNAL_AES_WRAP=y 1373endif 1374 1375ifdef NEED_INTERNAL_AES_WRAP 1376ifneq ($(CONFIG_TLS), linux) 1377AESOBJS += ../src/crypto/aes-unwrap.o 1378endif 1379endif 1380ifdef NEED_AES_EAX 1381AESOBJS += ../src/crypto/aes-eax.o 1382NEED_AES_CTR=y 1383endif 1384ifdef NEED_AES_SIV 1385AESOBJS += ../src/crypto/aes-siv.o 1386NEED_AES_CTR=y 1387endif 1388ifdef NEED_AES_CTR 1389AESOBJS += ../src/crypto/aes-ctr.o 1390endif 1391ifdef NEED_AES_ENCBLOCK 1392AESOBJS += ../src/crypto/aes-encblock.o 1393endif 1394NEED_AES_ENC=y 1395ifneq ($(CONFIG_TLS), openssl) 1396ifneq ($(CONFIG_TLS), linux) 1397ifneq ($(CONFIG_TLS), wolfssl) 1398AESOBJS += ../src/crypto/aes-omac1.o 1399endif 1400endif 1401endif 1402ifdef NEED_AES_WRAP 1403NEED_AES_ENC=y 1404ifdef NEED_INTERNAL_AES_WRAP 1405AESOBJS += ../src/crypto/aes-wrap.o 1406endif 1407endif 1408ifdef NEED_AES_CBC 1409NEED_AES_ENC=y 1410ifneq ($(CONFIG_TLS), openssl) 1411ifneq ($(CONFIG_TLS), linux) 1412ifneq ($(CONFIG_TLS), wolfssl) 1413AESOBJS += ../src/crypto/aes-cbc.o 1414endif 1415endif 1416endif 1417endif 1418ifdef NEED_AES_ENC 1419ifdef CONFIG_INTERNAL_AES 1420AESOBJS += ../src/crypto/aes-internal-enc.o 1421endif 1422endif 1423ifdef NEED_AES 1424OBJS += $(AESOBJS) 1425endif 1426 1427ifdef NEED_SHA1 1428ifneq ($(CONFIG_TLS), openssl) 1429ifneq ($(CONFIG_TLS), linux) 1430ifneq ($(CONFIG_TLS), gnutls) 1431ifneq ($(CONFIG_TLS), wolfssl) 1432SHA1OBJS += ../src/crypto/sha1.o 1433endif 1434endif 1435endif 1436endif 1437SHA1OBJS += ../src/crypto/sha1-prf.o 1438ifdef CONFIG_INTERNAL_SHA1 1439SHA1OBJS += ../src/crypto/sha1-internal.o 1440ifdef NEED_FIPS186_2_PRF 1441SHA1OBJS += ../src/crypto/fips_prf_internal.o 1442endif 1443endif 1444ifdef CONFIG_NO_WPA_PASSPHRASE 1445CFLAGS += -DCONFIG_NO_PBKDF2 1446else 1447ifneq ($(CONFIG_TLS), openssl) 1448ifneq ($(CONFIG_TLS), wolfssl) 1449SHA1OBJS += ../src/crypto/sha1-pbkdf2.o 1450endif 1451endif 1452endif 1453ifdef NEED_T_PRF 1454SHA1OBJS += ../src/crypto/sha1-tprf.o 1455endif 1456ifdef NEED_TLS_PRF 1457SHA1OBJS += ../src/crypto/sha1-tlsprf.o 1458endif 1459endif 1460 1461ifndef CONFIG_FIPS 1462ifneq ($(CONFIG_TLS), openssl) 1463ifneq ($(CONFIG_TLS), linux) 1464ifneq ($(CONFIG_TLS), gnutls) 1465ifneq ($(CONFIG_TLS), wolfssl) 1466MD5OBJS += ../src/crypto/md5.o 1467endif 1468endif 1469endif 1470endif 1471endif 1472ifdef NEED_MD5 1473ifdef CONFIG_INTERNAL_MD5 1474MD5OBJS += ../src/crypto/md5-internal.o 1475endif 1476OBJS += $(MD5OBJS) 1477OBJS_p += $(MD5OBJS) 1478OBJS_priv += $(MD5OBJS) 1479endif 1480 1481ifdef NEED_MD4 1482ifdef CONFIG_INTERNAL_MD4 1483OBJS += ../src/crypto/md4-internal.o 1484endif 1485endif 1486 1487DESOBJS = # none needed when not internal 1488ifdef NEED_DES 1489ifndef CONFIG_FIPS 1490CFLAGS += -DCONFIG_DES 1491endif 1492ifdef CONFIG_INTERNAL_DES 1493DESOBJS += ../src/crypto/des-internal.o 1494endif 1495endif 1496 1497ifdef CONFIG_NO_RC4 1498CFLAGS += -DCONFIG_NO_RC4 1499endif 1500 1501ifdef NEED_RC4 1502ifdef CONFIG_INTERNAL_RC4 1503ifndef CONFIG_NO_RC4 1504OBJS += ../src/crypto/rc4.o 1505endif 1506endif 1507endif 1508 1509ifdef CONFIG_SAE 1510ifdef NEED_SHA384 1511# Need to add HMAC-SHA384 KDF as well, if SHA384 was enabled. 1512NEED_HMAC_SHA384_KDF=y 1513endif 1514ifdef NEED_SHA512 1515# Need to add HMAC-SHA512 KDF as well, if SHA512 was enabled. 1516NEED_HMAC_SHA512_KDF=y 1517endif 1518endif 1519 1520SHA256OBJS = # none by default 1521CFLAGS += -DCONFIG_SHA256 1522ifneq ($(CONFIG_TLS), openssl) 1523ifneq ($(CONFIG_TLS), linux) 1524ifneq ($(CONFIG_TLS), gnutls) 1525ifneq ($(CONFIG_TLS), wolfssl) 1526SHA256OBJS += ../src/crypto/sha256.o 1527endif 1528endif 1529endif 1530endif 1531SHA256OBJS += ../src/crypto/sha256-prf.o 1532ifdef CONFIG_INTERNAL_SHA256 1533SHA256OBJS += ../src/crypto/sha256-internal.o 1534endif 1535ifdef CONFIG_INTERNAL_SHA384 1536CFLAGS += -DCONFIG_INTERNAL_SHA384 1537SHA256OBJS += ../src/crypto/sha384-internal.o 1538endif 1539ifdef CONFIG_INTERNAL_SHA512 1540CFLAGS += -DCONFIG_INTERNAL_SHA512 1541SHA256OBJS += ../src/crypto/sha512-internal.o 1542endif 1543ifdef NEED_TLS_PRF_SHA256 1544SHA256OBJS += ../src/crypto/sha256-tlsprf.o 1545endif 1546ifdef NEED_TLS_PRF_SHA384 1547SHA256OBJS += ../src/crypto/sha384-tlsprf.o 1548endif 1549ifdef NEED_HMAC_SHA256_KDF 1550CFLAGS += -DCONFIG_HMAC_SHA256_KDF 1551OBJS += ../src/crypto/sha256-kdf.o 1552endif 1553ifdef NEED_HMAC_SHA384_KDF 1554CFLAGS += -DCONFIG_HMAC_SHA384_KDF 1555OBJS += ../src/crypto/sha384-kdf.o 1556endif 1557ifdef NEED_HMAC_SHA512_KDF 1558CFLAGS += -DCONFIG_HMAC_SHA512_KDF 1559OBJS += ../src/crypto/sha512-kdf.o 1560endif 1561OBJS += $(SHA256OBJS) 1562ifdef NEED_SHA384 1563ifneq ($(CONFIG_TLS), openssl) 1564ifneq ($(CONFIG_TLS), linux) 1565ifneq ($(CONFIG_TLS), gnutls) 1566ifneq ($(CONFIG_TLS), wolfssl) 1567OBJS += ../src/crypto/sha384.o 1568endif 1569endif 1570endif 1571endif 1572CFLAGS += -DCONFIG_SHA384 1573OBJS += ../src/crypto/sha384-prf.o 1574endif 1575ifdef NEED_SHA512 1576ifneq ($(CONFIG_TLS), openssl) 1577ifneq ($(CONFIG_TLS), linux) 1578ifneq ($(CONFIG_TLS), gnutls) 1579ifneq ($(CONFIG_TLS), wolfssl) 1580OBJS += ../src/crypto/sha512.o 1581endif 1582endif 1583endif 1584endif 1585CFLAGS += -DCONFIG_SHA512 1586OBJS += ../src/crypto/sha512-prf.o 1587endif 1588 1589ifdef NEED_ASN1 1590OBJS += ../src/tls/asn1.o 1591endif 1592 1593ifdef NEED_DH_GROUPS 1594OBJS += ../src/crypto/dh_groups.o 1595endif 1596ifdef NEED_DH_GROUPS_ALL 1597CFLAGS += -DALL_DH_GROUPS 1598endif 1599ifdef CONFIG_INTERNAL_DH_GROUP5 1600ifdef NEED_DH_GROUPS 1601OBJS += ../src/crypto/dh_group5.o 1602endif 1603endif 1604 1605ifdef NEED_ECC 1606CFLAGS += -DCONFIG_ECC 1607endif 1608 1609ifdef CONFIG_NO_RANDOM_POOL 1610CFLAGS += -DCONFIG_NO_RANDOM_POOL 1611else 1612ifdef CONFIG_GETRANDOM 1613CFLAGS += -DCONFIG_GETRANDOM 1614endif 1615OBJS += ../src/crypto/random.o 1616endif 1617 1618ifdef CONFIG_CTRL_IFACE 1619ifeq ($(CONFIG_CTRL_IFACE), y) 1620ifdef CONFIG_NATIVE_WINDOWS 1621CONFIG_CTRL_IFACE=named_pipe 1622else 1623CONFIG_CTRL_IFACE=unix 1624endif 1625endif 1626CFLAGS += -DCONFIG_CTRL_IFACE 1627ifeq ($(CONFIG_CTRL_IFACE), unix) 1628CFLAGS += -DCONFIG_CTRL_IFACE_UNIX 1629OBJS += ../src/common/ctrl_iface_common.o 1630endif 1631ifeq ($(CONFIG_CTRL_IFACE), udp) 1632CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1633endif 1634ifeq ($(CONFIG_CTRL_IFACE), udp6) 1635CONFIG_CTRL_IFACE=udp 1636CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1637CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 1638endif 1639ifeq ($(CONFIG_CTRL_IFACE), named_pipe) 1640CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE 1641endif 1642ifeq ($(CONFIG_CTRL_IFACE), udp-remote) 1643CONFIG_CTRL_IFACE=udp 1644CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1645CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 1646endif 1647ifeq ($(CONFIG_CTRL_IFACE), udp6-remote) 1648CONFIG_CTRL_IFACE=udp 1649CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1650CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 1651CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6 1652endif 1653OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o 1654endif 1655 1656ifdef CONFIG_CTRL_IFACE_DBUS_NEW 1657CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW 1658OBJS += dbus/dbus_dict_helpers.o 1659OBJS += dbus/dbus_new_helpers.o 1660OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o 1661OBJS += dbus/dbus_common.o 1662ifdef CONFIG_WPS 1663OBJS += dbus/dbus_new_handlers_wps.o 1664endif 1665ifdef CONFIG_P2P 1666OBJS += dbus/dbus_new_handlers_p2p.o 1667endif 1668ifndef DBUS_LIBS 1669DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1) 1670endif 1671ifndef DBUS_INCLUDE 1672DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1) 1673endif 1674ifdef CONFIG_CTRL_IFACE_DBUS_INTRO 1675OBJS += dbus/dbus_new_introspect.o 1676CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO 1677endif 1678CFLAGS += $(DBUS_INCLUDE) 1679LIBS += $(DBUS_LIBS) 1680endif 1681 1682ifdef CONFIG_READLINE 1683OBJS_c += ../src/utils/edit_readline.o 1684LIBS_c += -lreadline -lncurses 1685else 1686ifdef CONFIG_WPA_CLI_EDIT 1687OBJS_c += ../src/utils/edit.o 1688else 1689OBJS_c += ../src/utils/edit_simple.o 1690endif 1691endif 1692 1693ifdef CONFIG_NATIVE_WINDOWS 1694CFLAGS += -DCONFIG_NATIVE_WINDOWS 1695LIBS += -lws2_32 -lgdi32 -lcrypt32 1696LIBS_c += -lws2_32 1697LIBS_p += -lws2_32 -lgdi32 1698ifeq ($(CONFIG_CRYPTO), cryptoapi) 1699LIBS_p += -lcrypt32 1700endif 1701endif 1702 1703ifdef CONFIG_NO_STDOUT_DEBUG 1704CFLAGS += -DCONFIG_NO_STDOUT_DEBUG 1705ifndef CONFIG_CTRL_IFACE 1706CFLAGS += -DCONFIG_NO_WPA_MSG 1707endif 1708endif 1709 1710ifdef CONFIG_IPV6 1711# for eapol_test only 1712CFLAGS += -DCONFIG_IPV6 1713endif 1714 1715ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR 1716CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR 1717endif 1718 1719ifdef NEED_BASE64 1720OBJS += ../src/utils/base64.o 1721endif 1722 1723ifdef NEED_SME 1724OBJS += sme.o 1725CFLAGS += -DCONFIG_SME 1726endif 1727 1728OBJS += ../src/common/ieee802_11_common.o 1729OBJS += ../src/common/hw_features_common.o 1730 1731ifdef NEED_EAP_COMMON 1732OBJS += ../src/eap_common/eap_common.o 1733endif 1734 1735ifndef CONFIG_MAIN 1736CONFIG_MAIN=main 1737endif 1738 1739ifdef CONFIG_DEBUG_SYSLOG 1740CFLAGS += -DCONFIG_DEBUG_SYSLOG 1741ifdef CONFIG_DEBUG_SYSLOG_FACILITY 1742CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)" 1743endif 1744endif 1745 1746ifdef CONFIG_DEBUG_LINUX_TRACING 1747CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING 1748endif 1749 1750ifdef CONFIG_DEBUG_FILE 1751CFLAGS += -DCONFIG_DEBUG_FILE 1752endif 1753 1754ifdef CONFIG_DELAYED_MIC_ERROR_REPORT 1755CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT 1756endif 1757 1758ifdef CONFIG_FIPS 1759CFLAGS += -DCONFIG_FIPS 1760ifneq ($(CONFIG_TLS), openssl) 1761ifneq ($(CONFIG_TLS), wolfssl) 1762$(error CONFIG_FIPS=y requires CONFIG_TLS=openssl) 1763endif 1764endif 1765endif 1766 1767OBJS += $(SHA1OBJS) $(DESOBJS) 1768 1769OBJS_p += $(SHA1OBJS) 1770OBJS_p += $(SHA256OBJS) 1771OBJS_priv += $(SHA1OBJS) 1772 1773ifdef CONFIG_BGSCAN_SIMPLE 1774CFLAGS += -DCONFIG_BGSCAN_SIMPLE 1775OBJS += bgscan_simple.o 1776NEED_BGSCAN=y 1777endif 1778 1779ifdef CONFIG_BGSCAN_LEARN 1780CFLAGS += -DCONFIG_BGSCAN_LEARN 1781OBJS += bgscan_learn.o 1782NEED_BGSCAN=y 1783endif 1784 1785ifdef NEED_BGSCAN 1786CFLAGS += -DCONFIG_BGSCAN 1787OBJS += bgscan.o 1788endif 1789 1790ifdef CONFIG_AUTOSCAN_EXPONENTIAL 1791CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL 1792OBJS += autoscan_exponential.o 1793NEED_AUTOSCAN=y 1794endif 1795 1796ifdef CONFIG_AUTOSCAN_PERIODIC 1797CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC 1798OBJS += autoscan_periodic.o 1799NEED_AUTOSCAN=y 1800endif 1801 1802ifdef NEED_AUTOSCAN 1803CFLAGS += -DCONFIG_AUTOSCAN 1804OBJS += autoscan.o 1805endif 1806 1807ifdef CONFIG_EXT_PASSWORD_TEST 1808OBJS += ../src/utils/ext_password_test.o 1809CFLAGS += -DCONFIG_EXT_PASSWORD_TEST 1810NEED_EXT_PASSWORD=y 1811endif 1812 1813ifdef CONFIG_EXT_PASSWORD_FILE 1814OBJS += ../src/utils/ext_password_file.o 1815CFLAGS += -DCONFIG_EXT_PASSWORD_FILE 1816NEED_EXT_PASSWORD=y 1817endif 1818 1819ifdef NEED_EXT_PASSWORD 1820OBJS += ../src/utils/ext_password.o 1821CFLAGS += -DCONFIG_EXT_PASSWORD 1822endif 1823 1824ifdef NEED_GAS_SERVER 1825OBJS += ../src/common/gas_server.o 1826CFLAGS += -DCONFIG_GAS_SERVER 1827NEED_GAS=y 1828endif 1829 1830ifdef NEED_GAS 1831OBJS += ../src/common/gas.o 1832OBJS += gas_query.o 1833CFLAGS += -DCONFIG_GAS 1834NEED_OFFCHANNEL=y 1835endif 1836 1837ifdef NEED_OFFCHANNEL 1838OBJS += offchannel.o 1839CFLAGS += -DCONFIG_OFFCHANNEL 1840endif 1841 1842ifdef NEED_JSON 1843OBJS += ../src/utils/json.o 1844CFLAGS += -DCONFIG_JSON 1845endif 1846 1847ifdef CONFIG_MODULE_TESTS 1848CFLAGS += -DCONFIG_MODULE_TESTS 1849OBJS += wpas_module_tests.o 1850OBJS += ../src/utils/utils_module_tests.o 1851OBJS += ../src/common/common_module_tests.o 1852OBJS += ../src/crypto/crypto_module_tests.o 1853ifdef CONFIG_WPS 1854OBJS += ../src/wps/wps_module_tests.o 1855endif 1856endif 1857 1858OBJS += ../src/drivers/driver_common.o 1859OBJS_priv += ../src/drivers/driver_common.o 1860 1861OBJS += wpa_supplicant.o events.o bssid_ignore.o wpas_glue.o scan.o 1862OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o 1863OBJS_t += ../src/radius/radius_client.o 1864OBJS_t += ../src/radius/radius.o 1865OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o 1866 1867OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o 1868OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o 1869 1870OBJS += $(CONFIG_MAIN).o 1871 1872ifdef CONFIG_PRIVSEP 1873OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o 1874OBJS_priv += $(OBJS_l2) 1875OBJS_priv += ../src/utils/os_$(CONFIG_OS).o 1876OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o 1877OBJS_priv += ../src/utils/common.o 1878OBJS_priv += ../src/utils/wpa_debug.o 1879OBJS_priv += ../src/utils/wpabuf.o 1880OBJS_priv += wpa_priv.o 1881ifdef CONFIG_DRIVER_NL80211 1882OBJS_priv += ../src/common/ieee802_11_common.o 1883endif 1884OBJS += ../src/l2_packet/l2_packet_privsep.o 1885OBJS += ../src/drivers/driver_privsep.o 1886EXTRA_progs += wpa_priv 1887else 1888OBJS += $(OBJS_d) ../src/drivers/drivers.o 1889OBJS += $(OBJS_l2) 1890endif 1891 1892ifdef CONFIG_NDIS_EVENTS_INTEGRATED 1893CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED 1894OBJS += ../src/drivers/ndis_events.o 1895EXTRALIBS += -loleaut32 -lole32 -luuid 1896ifdef PLATFORMSDKLIB 1897EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib 1898else 1899EXTRALIBS += WbemUuid.Lib 1900endif 1901endif 1902 1903ifdef CONFIG_FST 1904CFLAGS += -DCONFIG_FST 1905ifdef CONFIG_FST_TEST 1906CFLAGS += -DCONFIG_FST_TEST 1907endif 1908FST_OBJS += ../src/fst/fst.o 1909FST_OBJS += ../src/fst/fst_session.o 1910FST_OBJS += ../src/fst/fst_iface.o 1911FST_OBJS += ../src/fst/fst_group.o 1912FST_OBJS += ../src/fst/fst_ctrl_aux.o 1913ifdef CONFIG_CTRL_IFACE 1914FST_OBJS += ../src/fst/fst_ctrl_iface.o 1915endif 1916OBJS += $(FST_OBJS) 1917OBJS_t += $(FST_OBJS) 1918OBJS_t2 += $(FST_OBJS) 1919OBJS_nfc += $(FST_OBJS) 1920endif 1921 1922ifdef CONFIG_WEP 1923CFLAGS += -DCONFIG_WEP 1924endif 1925 1926ifdef CONFIG_NO_TKIP 1927CFLAGS += -DCONFIG_NO_TKIP 1928endif 1929 1930dynamic_eap_methods: $(EAPDYN) 1931 1932_OBJS_VAR := OBJS_priv 1933include ../src/objs.mk 1934wpa_priv: $(BCHECK) $(OBJS_priv) 1935 $(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) 1936 @$(E) " LD " $@ 1937 1938_OBJS_VAR := OBJS 1939include ../src/objs.mk 1940wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) 1941 $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) 1942 @$(E) " LD " $@ 1943 1944_OBJS_VAR := OBJS_t 1945include ../src/objs.mk 1946eapol_test: $(OBJS_t) 1947 $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) 1948 @$(E) " LD " $@ 1949 1950_OBJS_VAR := OBJS_t2 1951include ../src/objs.mk 1952preauth_test: $(OBJS_t2) 1953 $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) 1954 @$(E) " LD " $@ 1955 1956_OBJS_VAR := OBJS_p 1957include ../src/objs.mk 1958wpa_passphrase: $(OBJS_p) 1959 $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) 1960 @$(E) " LD " $@ 1961 1962_OBJS_VAR := OBJS_c 1963include ../src/objs.mk 1964wpa_cli: $(OBJS_c) 1965 $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) 1966 @$(E) " LD " $@ 1967 1968LIBCTRL += ../src/common/wpa_ctrl.o 1969LIBCTRL += ../src/utils/os_$(CONFIG_OS).o 1970LIBCTRL += ../src/utils/common.o 1971LIBCTRL += ../src/utils/wpa_debug.o 1972LIBCTRLSO += ../src/common/wpa_ctrl.c 1973LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c 1974LIBCTRLSO += ../src/utils/common.c 1975LIBCTRLSO += ../src/utils/wpa_debug.c 1976 1977_OBJS_VAR := LIBCTRL 1978include ../src/objs.mk 1979libwpa_client.a: $(LIBCTRL) 1980 $(Q)rm -f $@ 1981 $(Q)$(AR) crs $@ $? 1982 @$(E) " AR " $@ 1983 1984libwpa_client.so: $(LIBCTRLSO) 1985 @$(E) " CC $@ ($^)" 1986 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^ 1987 1988OBJS_wpatest := libwpa_test.o 1989_OBJS_VAR := OBJS_wpatest 1990include ../src/objs.mk 1991libwpa_test1: $(OBJS_wpatest) libwpa_client.a 1992 $(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 $(OBJS_wpatest) libwpa_client.a $(LIBS_c) 1993 @$(E) " LD " $@ 1994 1995libwpa_test2: $(OBJS_wpatest) libwpa_client.so 1996 $(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 $(OBJS_wpatest) -L. -lwpa_client $(LIBS_c) 1997 @$(E) " LD " $@ 1998 1999_OBJS_VAR := OBJS_nfc 2000include ../src/objs.mk 2001nfc_pw_token: $(OBJS_nfc) 2002 $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS) 2003 @$(E) " LD " $@ 2004 2005win_if_list: win_if_list.c 2006 $(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w) 2007 @$(E) " LD " $@ 2008 2009eap_psk.so: $(SRC_EAP_PSK) 2010 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2011 -Deap_peer_psk_register=eap_peer_method_dynamic_init 2012 @$(E) " CC/LD " $@ 2013 2014eap_pax.so: $(SRC_EAP_PAX) 2015 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2016 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2017 @$(E) " CC/LD " $@ 2018 2019eap_peap.so: $(SRC_EAP_PEAP) 2020 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2021 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2022 @$(E) " CC/LD " $@ 2023 2024eap_sake.so: $(SRC_EAP_SAKE) 2025 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2026 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2027 @$(E) " CC/LD " $@ 2028 2029eap_ikev2.so: $(SRC_EAP_IKEV2) 2030 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2031 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2032 @$(E) " CC/LD " $@ 2033 2034eap_eke.so: $(SRC_EAP_EKE) 2035 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2036 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2037 @$(E) " CC/LD " $@ 2038 2039eap_mschapv2.so: $(SRC_EAP_MSCHAPV2) 2040 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2041 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2042 @$(E) " CC/LD " $@ 2043 2044eap_fast.so: $(SRC_EAP_FAST) 2045 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2046 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2047 @$(E) " CC/LD " $@ 2048 2049eap_teap.so: $(SRC_EAP_TEAP) 2050 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2051 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2052 @$(E) " CC/LD " $@ 2053 2054eap_gpsk.so: $(SRC_EAP_GPSK) 2055 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \ 2056 -D$(@F:eap_%.so=eap_peer_%)_register=eap_peer_method_dynamic_init 2057 @$(E) " CC/LD " $@ 2058 2059%.so: ../src/eap_peer/%.c 2060 $(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \ 2061 -D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init 2062 @$(E) " CC/LD " $@ 2063 2064%.service: %.service.in 2065 $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ 2066 @$(E) " sed" $< 2067 2068%@.service: %.service.arg.in 2069 $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ 2070 @$(E) " sed" $< 2071 2072wpa_supplicant.exe: wpa_supplicant 2073 mv -f $< $@ 2074wpa_cli.exe: wpa_cli 2075 mv -f $< $@ 2076wpa_passphrase.exe: wpa_passphrase 2077 mv -f $< $@ 2078win_if_list.exe: win_if_list 2079 mv -f $< $@ 2080eapol_test.exe: eapol_test 2081 mv -f $< $@ 2082 2083WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe 2084 2085windows-bin: $(WINALL) 2086 $(STRIP) $(WINALL) 2087 2088wpa_gui: 2089 @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement" 2090 2091wpa_gui-qt4/Makefile: 2092 qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro 2093 2094wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts 2095 lrelease wpa_gui-qt4/wpa_gui.pro 2096 2097wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm 2098 $(MAKE) -C wpa_gui-qt4 2099 2100FIPSDIR=/usr/local/ssl/fips-2.0 2101FIPSLD=$(FIPSDIR)/bin/fipsld 2102fips: 2103 $(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)" 2104 2105.PHONY: lcov-html 2106lcov-html: $(call BUILDOBJ,wpa_supplicant.gcda) 2107 lcov -c -d $(BUILDDIR) > lcov.info 2108 genhtml lcov.info --output-directory lcov-html 2109 2110PASN_CFLAGS := $(CFLAGS) 2111PASN_CFLAGS += -DCONFIG_PASN 2112 2113LIBPASNSO := ../src/utils/$(CONFIG_ELOOP).c 2114LIBPASNSO += ../src/utils/wpa_debug.c 2115LIBPASNSO += ../src/utils/wpabuf.c 2116LIBPASNSO += ../src/utils/os_$(CONFIG_OS).c 2117LIBPASNSO += ../src/utils/config.c 2118LIBPASNSO += ../src/utils/common.c 2119 2120ifdef NEED_BASE64 2121LIBPASNSO += ../src/utils/base64.c 2122endif 2123 2124ifdef CONFIG_WPA_TRACE 2125LIBPASNSO += ../src/utils/trace.c 2126endif 2127 2128ifdef CONFIG_EXT_PASSWORD_FILE 2129LIBPASNSO += ../src/utils/ext_password_file.c 2130endif 2131 2132ifdef CONFIG_EXT_PASSWORD_TEST 2133LIBPASNSO += ../src/utils/ext_password_test.c 2134endif 2135 2136ifdef NEED_EXT_PASSWORD 2137LIBPASNSO += ../src/utils/ext_password.c 2138endif 2139 2140ifdef CONFIG_SAE 2141LIBPASNSO += ../src/common/sae.c 2142endif 2143 2144ifdef CONFIG_SAE_PK 2145LIBPASNSO += ../src/common/sae_pk.c 2146endif 2147 2148ifndef CONFIG_NO_WPA 2149LIBPASNSO += ../src/common/wpa_common.c 2150endif 2151 2152LIBPASNSO += ../src/common/ieee802_11_common.c 2153 2154ifdef NEED_DRAGONFLY 2155LIBPASNSO += ../src/common/dragonfly.c 2156endif 2157 2158LIBPASNSO += ../src/common/ptksa_cache.c 2159 2160ifndef CONFIG_NO_WPA 2161LIBPASNSO += ../src/rsn_supp/pmksa_cache.c 2162LIBPASNSO += ../src/rsn_supp/wpa_ie.c 2163endif 2164 2165LIBPASNSO += ../src/ap/comeback_token.c 2166LIBPASNSO += ../src/ap/pmksa_cache_auth.c 2167 2168ifdef NEED_EAP_COMMON 2169LIBPASNSO += ../src/eap_common/eap_common.c 2170endif 2171 2172ifdef CHAP 2173LIBPASNSO += ../src/eap_common/chap.c 2174endif 2175 2176ifdef CONFIG_IEEE8021X_EAPOL 2177LIBPASNSO += ../src/eap_peer/eap.c 2178LIBPASNSO += ../src/eap_peer/eap_methods.c 2179LIBPASNSO += ../src/eapol_supp/eapol_supp_sm.c 2180endif 2181 2182ifeq ($(CONFIG_TLS), wolfssl) 2183LIBPASNSO += ../src/crypto/crypto_wolfssl.c 2184ifdef TLS_FUNCS 2185LIBPASNSO += ../src/crypto/tls_wolfssl.c 2186NEED_TLS_PRF_SHA256=y 2187LIBPASNSO += -lwolfssl -lm 2188endif 2189endif 2190 2191ifeq ($(CONFIG_TLS), openssl) 2192LIBPASNSO += ../src/crypto/crypto_openssl.c 2193ifdef TLS_FUNCS 2194LIBPASNSO += ../src/crypto/tls_openssl.c 2195LIBPASNSO += -lssl -lcrypto 2196NEED_TLS_PRF_SHA256=y 2197endif 2198endif 2199 2200ifeq ($(CONFIG_TLS), gnutls) 2201LIBPASNSO += ../src/crypto/crypto_$(CONFIG_CRYPTO).c 2202ifdef TLS_FUNCS 2203LIBPASNSO += ../src/crypto/tls_gnutls.c 2204LIBPASNSO += -lgnutls -lgpg-error 2205LIBPASNSO += -lgcrypt 2206endif 2207endif 2208 2209ifdef NEED_TLS_PRF_SHA256 2210LIBPASNSO += ../src/crypto/sha256-tlsprf.c 2211endif 2212 2213ifdef NEED_SHA512 2214LIBPASNSO += ../src/crypto/sha512-prf.c 2215endif 2216 2217ifdef NEED_SHA384 2218LIBPASNSO += ../src/crypto/sha384-prf.c 2219endif 2220 2221LIBPASNSO += ../src/crypto/sha256-prf.c 2222 2223ifdef NEED_HMAC_SHA512_KDF 2224LIBPASNSO += ../src/crypto/sha512-kdf.c 2225endif 2226 2227ifdef NEED_HMAC_SHA384_KDF 2228LIBPASNSO += ../src/crypto/sha384-kdf.c 2229endif 2230 2231ifdef NEED_HMAC_SHA256_KDF 2232LIBPASNSO += ../src/crypto/sha256-kdf.c 2233endif 2234 2235ifdef NEED_DH_GROUPS 2236LIBPASNSO += ../src/crypto/dh_groups.c 2237endif 2238 2239ifdef NEED_AES_SIV 2240LIBPASNSO += ../src/crypto/aes-siv.c 2241endif 2242 2243ifdef NEED_AES_CTR 2244LIBPASNSO += ../src/crypto/aes-ctr.c 2245endif 2246 2247ifdef NEED_SHA1 2248LIBPASNSO += ../src/crypto/sha1-prf.c 2249ifdef NEED_TLS_PRF 2250LIBPASNSO += ../src/crypto/sha1-tlsprf.c 2251endif 2252endif 2253 2254LIBPASNSO += ../src/pasn/pasn_initiator.c 2255LIBPASNSO += ../src/pasn/pasn_responder.c 2256 2257libpasn.so: $(LIBPASNSO) 2258 @$(E) " CC $@ ($^)" 2259 $(Q)$(CC) $(LDFLAGS) -o $@ $(PASN_CFLAGS) -shared -fPIC -lcrypto $^ 2260 2261clean: common-clean 2262 $(MAKE) -C ../src clean 2263 $(MAKE) -C dbus clean 2264 rm -f core *~ *.o *.d *.gcno *.gcda *.gcov 2265 rm -f eap_*.so $(WINALL) eapol_test preauth_test 2266 rm -f wpa_priv 2267 rm -f nfc_pw_token 2268 rm -f lcov.info 2269 rm -rf lcov-html 2270 rm -f libwpa_client.a 2271 rm -f libpasn.so 2272 rm -f libwpa_client.so 2273 rm -f libwpa_test1 libwpa_test2 2274 rm -f wpa_passphrase 2275