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