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