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