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