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