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