Home | History | Annotate | Download | only in hostapd
      1 # Copyright (C) 2008 The Android Open Source Project
      2 #
      3 # This software may be distributed under the terms of the BSD license.
      4 # See README for more details.
      5 #
      6 
      7 LOCAL_PATH := $(call my-dir)
      8 
      9 WPA_BUILD_HOSTAPD := false
     10 ifneq ($(BOARD_HOSTAPD_DRIVER),)
     11   WPA_BUILD_HOSTAPD := true
     12   CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
     13 endif
     14 
     15 ifeq ($(WPA_BUILD_HOSTAPD),true)
     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=\"hostapd\"
     26 
     27 # Disable unused parameter warnings
     28 L_CFLAGS += -Wno-unused-parameter
     29 
     30 # Set Android extended P2P functionality
     31 L_CFLAGS += -DANDROID_P2P
     32 
     33 ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
     34 L_CFLAGS += -DANDROID_LIB_STUB
     35 endif
     36 
     37 # Use Android specific directory for control interface sockets
     38 L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
     39 L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/hostapd\"
     40 
     41 # To force sizeof(enum) = 4
     42 ifeq ($(TARGET_ARCH),arm)
     43 L_CFLAGS += -mabi=aapcs-linux
     44 endif
     45 
     46 INCLUDES = $(LOCAL_PATH)
     47 INCLUDES += $(LOCAL_PATH)/src
     48 INCLUDES += $(LOCAL_PATH)/src/utils
     49 INCLUDES += system/security/keystore/include
     50 ifdef CONFIG_DRIVER_NL80211
     51 ifneq ($(wildcard external/libnl),)
     52 INCLUDES += external/libnl/include
     53 else
     54 INCLUDES += external/libnl-headers
     55 endif
     56 endif
     57 
     58 
     59 ifndef CONFIG_OS
     60 ifdef CONFIG_NATIVE_WINDOWS
     61 CONFIG_OS=win32
     62 else
     63 CONFIG_OS=unix
     64 endif
     65 endif
     66 
     67 ifeq ($(CONFIG_OS), internal)
     68 L_CFLAGS += -DOS_NO_C_LIB_DEFINES
     69 endif
     70 
     71 ifdef CONFIG_NATIVE_WINDOWS
     72 L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
     73 LIBS += -lws2_32
     74 endif
     75 
     76 OBJS = main.c
     77 OBJS += config_file.c
     78 
     79 OBJS += src/ap/hostapd.c
     80 OBJS += src/ap/wpa_auth_glue.c
     81 OBJS += src/ap/drv_callbacks.c
     82 OBJS += src/ap/ap_drv_ops.c
     83 OBJS += src/ap/utils.c
     84 OBJS += src/ap/authsrv.c
     85 OBJS += src/ap/ieee802_1x.c
     86 OBJS += src/ap/ap_config.c
     87 OBJS += src/ap/eap_user_db.c
     88 OBJS += src/ap/ieee802_11_auth.c
     89 OBJS += src/ap/sta_info.c
     90 OBJS += src/ap/wpa_auth.c
     91 OBJS += src/ap/tkip_countermeasures.c
     92 OBJS += src/ap/ap_mlme.c
     93 OBJS += src/ap/wpa_auth_ie.c
     94 OBJS += src/ap/preauth_auth.c
     95 OBJS += src/ap/pmksa_cache_auth.c
     96 OBJS += src/ap/ieee802_11_shared.c
     97 OBJS += src/ap/beacon.c
     98 OBJS += src/ap/bss_load.c
     99 OBJS_d =
    100 OBJS_p =
    101 LIBS =
    102 LIBS_c =
    103 HOBJS =
    104 LIBS_h =
    105 
    106 NEED_RC4=y
    107 NEED_AES=y
    108 NEED_MD5=y
    109 NEED_SHA1=y
    110 
    111 OBJS += src/drivers/drivers.c
    112 L_CFLAGS += -DHOSTAPD
    113 
    114 ifdef CONFIG_WPA_TRACE
    115 L_CFLAGS += -DWPA_TRACE
    116 OBJS += src/utils/trace.c
    117 HOBJS += src/utils/trace.c
    118 LDFLAGS += -rdynamic
    119 L_CFLAGS += -funwind-tables
    120 ifdef CONFIG_WPA_TRACE_BFD
    121 L_CFLAGS += -DWPA_TRACE_BFD
    122 LIBS += -lbfd
    123 LIBS_c += -lbfd
    124 LIBS_h += -lbfd
    125 endif
    126 endif
    127 
    128 OBJS += src/utils/eloop.c
    129 
    130 ifdef CONFIG_ELOOP_POLL
    131 L_CFLAGS += -DCONFIG_ELOOP_POLL
    132 endif
    133 
    134 ifdef CONFIG_ELOOP_EPOLL
    135 L_CFLAGS += -DCONFIG_ELOOP_EPOLL
    136 endif
    137 
    138 OBJS += src/utils/common.c
    139 OBJS += src/utils/wpa_debug.c
    140 OBJS += src/utils/wpabuf.c
    141 OBJS += src/utils/os_$(CONFIG_OS).c
    142 OBJS += src/utils/ip_addr.c
    143 
    144 OBJS += src/common/ieee802_11_common.c
    145 OBJS += src/common/wpa_common.c
    146 OBJS += src/common/hw_features_common.c
    147 
    148 OBJS += src/eapol_auth/eapol_auth_sm.c
    149 
    150 
    151 ifndef CONFIG_NO_DUMP_STATE
    152 # define HOSTAPD_DUMP_STATE to include support for dumping internal state
    153 # through control interface commands (undefine it, if you want to save in
    154 # binary size)
    155 L_CFLAGS += -DHOSTAPD_DUMP_STATE
    156 OBJS += src/eapol_auth/eapol_auth_dump.c
    157 endif
    158 
    159 ifdef CONFIG_NO_RADIUS
    160 L_CFLAGS += -DCONFIG_NO_RADIUS
    161 CONFIG_NO_ACCOUNTING=y
    162 else
    163 OBJS += src/radius/radius.c
    164 OBJS += src/radius/radius_client.c
    165 OBJS += src/radius/radius_das.c
    166 endif
    167 
    168 ifdef CONFIG_NO_ACCOUNTING
    169 L_CFLAGS += -DCONFIG_NO_ACCOUNTING
    170 else
    171 OBJS += src/ap/accounting.c
    172 endif
    173 
    174 ifdef CONFIG_NO_VLAN
    175 L_CFLAGS += -DCONFIG_NO_VLAN
    176 else
    177 OBJS += src/ap/vlan_init.c
    178 OBJS += src/ap/vlan_ifconfig.c
    179 OBJS += src/ap/vlan.c
    180 ifdef CONFIG_FULL_DYNAMIC_VLAN
    181 # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
    182 # and VLAN interfaces for the VLAN feature.
    183 L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
    184 OBJS += src/ap/vlan_full.c
    185 ifdef CONFIG_VLAN_NETLINK
    186 OBJS += src/ap/vlan_util.c
    187 else
    188 OBJS += src/ap/vlan_ioctl.c
    189 endif
    190 endif
    191 endif
    192 
    193 ifdef CONFIG_NO_CTRL_IFACE
    194 L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
    195 else
    196 OBJS += src/common/ctrl_iface_common.c
    197 OBJS += ctrl_iface.c
    198 OBJS += src/ap/ctrl_iface_ap.c
    199 endif
    200 
    201 L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
    202 
    203 ifdef CONFIG_IAPP
    204 L_CFLAGS += -DCONFIG_IAPP
    205 OBJS += src/ap/iapp.c
    206 endif
    207 
    208 ifdef CONFIG_RSN_PREAUTH
    209 L_CFLAGS += -DCONFIG_RSN_PREAUTH
    210 CONFIG_L2_PACKET=y
    211 endif
    212 
    213 ifdef CONFIG_PEERKEY
    214 L_CFLAGS += -DCONFIG_PEERKEY
    215 OBJS += src/ap/peerkey_auth.c
    216 endif
    217 
    218 ifdef CONFIG_HS20
    219 NEED_AES_OMAC1=y
    220 CONFIG_PROXYARP=y
    221 endif
    222 
    223 ifdef CONFIG_PROXYARP
    224 CONFIG_L2_PACKET=y
    225 endif
    226 
    227 ifdef CONFIG_SUITEB
    228 L_CFLAGS += -DCONFIG_SUITEB
    229 NEED_SHA256=y
    230 NEED_AES_OMAC1=y
    231 endif
    232 
    233 ifdef CONFIG_SUITEB192
    234 L_CFLAGS += -DCONFIG_SUITEB192
    235 NEED_SHA384=y
    236 endif
    237 
    238 ifdef CONFIG_IEEE80211W
    239 L_CFLAGS += -DCONFIG_IEEE80211W
    240 NEED_SHA256=y
    241 NEED_AES_OMAC1=y
    242 endif
    243 
    244 ifdef CONFIG_IEEE80211R
    245 L_CFLAGS += -DCONFIG_IEEE80211R
    246 OBJS += src/ap/wpa_auth_ft.c
    247 NEED_SHA256=y
    248 NEED_AES_OMAC1=y
    249 NEED_AES_UNWRAP=y
    250 endif
    251 
    252 ifdef CONFIG_SAE
    253 L_CFLAGS += -DCONFIG_SAE
    254 OBJS += src/common/sae.c
    255 NEED_ECC=y
    256 NEED_DH_GROUPS=y
    257 endif
    258 
    259 ifdef CONFIG_WNM
    260 L_CFLAGS += -DCONFIG_WNM
    261 OBJS += src/ap/wnm_ap.c
    262 endif
    263 
    264 ifdef CONFIG_IEEE80211N
    265 L_CFLAGS += -DCONFIG_IEEE80211N
    266 endif
    267 
    268 ifdef CONFIG_IEEE80211AC
    269 L_CFLAGS += -DCONFIG_IEEE80211AC
    270 endif
    271 
    272 ifdef CONFIG_MBO
    273 L_CFLAGS += -DCONFIG_MBO
    274 OBJS += src/ap/mbo_ap.c
    275 endif
    276 
    277 ifdef CONFIG_FST
    278 L_CFLAGS += -DCONFIG_FST
    279 OBJS += src/fst/fst.c
    280 OBJS += src/fst/fst_group.c
    281 OBJS += src/fst/fst_iface.c
    282 OBJS += src/fst/fst_session.c
    283 OBJS += src/fst/fst_ctrl_aux.c
    284 ifdef CONFIG_FST_TEST
    285 L_CFLAGS += -DCONFIG_FST_TEST
    286 endif
    287 ifndef CONFIG_NO_CTRL_IFACE
    288 OBJS += src/fst/fst_ctrl_iface.c
    289 endif
    290 endif
    291 
    292 
    293 include $(LOCAL_PATH)/src/drivers/drivers.mk
    294 
    295 OBJS += $(DRV_AP_OBJS)
    296 L_CFLAGS += $(DRV_AP_CFLAGS)
    297 LDFLAGS += $(DRV_AP_LDFLAGS)
    298 LIBS += $(DRV_AP_LIBS)
    299 
    300 ifdef CONFIG_L2_PACKET
    301 ifdef CONFIG_DNET_PCAP
    302 ifdef CONFIG_L2_FREEBSD
    303 LIBS += -lpcap
    304 OBJS += src/l2_packet/l2_packet_freebsd.c
    305 else
    306 LIBS += -ldnet -lpcap
    307 OBJS += src/l2_packet/l2_packet_pcap.c
    308 endif
    309 else
    310 OBJS += src/l2_packet/l2_packet_linux.c
    311 endif
    312 else
    313 OBJS += src/l2_packet/l2_packet_none.c
    314 endif
    315 
    316 
    317 ifdef CONFIG_EAP_MD5
    318 L_CFLAGS += -DEAP_SERVER_MD5
    319 OBJS += src/eap_server/eap_server_md5.c
    320 CHAP=y
    321 endif
    322 
    323 ifdef CONFIG_EAP_TLS
    324 L_CFLAGS += -DEAP_SERVER_TLS
    325 OBJS += src/eap_server/eap_server_tls.c
    326 TLS_FUNCS=y
    327 endif
    328 
    329 ifdef CONFIG_EAP_UNAUTH_TLS
    330 L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
    331 ifndef CONFIG_EAP_TLS
    332 OBJS += src/eap_server/eap_server_tls.c
    333 TLS_FUNCS=y
    334 endif
    335 endif
    336 
    337 ifdef CONFIG_EAP_PEAP
    338 L_CFLAGS += -DEAP_SERVER_PEAP
    339 OBJS += src/eap_server/eap_server_peap.c
    340 OBJS += src/eap_common/eap_peap_common.c
    341 TLS_FUNCS=y
    342 CONFIG_EAP_MSCHAPV2=y
    343 endif
    344 
    345 ifdef CONFIG_EAP_TTLS
    346 L_CFLAGS += -DEAP_SERVER_TTLS
    347 OBJS += src/eap_server/eap_server_ttls.c
    348 TLS_FUNCS=y
    349 CHAP=y
    350 endif
    351 
    352 ifdef CONFIG_EAP_MSCHAPV2
    353 L_CFLAGS += -DEAP_SERVER_MSCHAPV2
    354 OBJS += src/eap_server/eap_server_mschapv2.c
    355 MS_FUNCS=y
    356 endif
    357 
    358 ifdef CONFIG_EAP_GTC
    359 L_CFLAGS += -DEAP_SERVER_GTC
    360 OBJS += src/eap_server/eap_server_gtc.c
    361 endif
    362 
    363 ifdef CONFIG_EAP_SIM
    364 L_CFLAGS += -DEAP_SERVER_SIM
    365 OBJS += src/eap_server/eap_server_sim.c
    366 CONFIG_EAP_SIM_COMMON=y
    367 NEED_AES_CBC=y
    368 endif
    369 
    370 ifdef CONFIG_EAP_AKA
    371 L_CFLAGS += -DEAP_SERVER_AKA
    372 OBJS += src/eap_server/eap_server_aka.c
    373 CONFIG_EAP_SIM_COMMON=y
    374 NEED_SHA256=y
    375 NEED_AES_CBC=y
    376 endif
    377 
    378 ifdef CONFIG_EAP_AKA_PRIME
    379 L_CFLAGS += -DEAP_SERVER_AKA_PRIME
    380 endif
    381 
    382 ifdef CONFIG_EAP_SIM_COMMON
    383 OBJS += src/eap_common/eap_sim_common.c
    384 # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
    385 # replaced with another file implementating the interface specified in
    386 # eap_sim_db.h.
    387 OBJS += src/eap_server/eap_sim_db.c
    388 NEED_FIPS186_2_PRF=y
    389 endif
    390 
    391 ifdef CONFIG_EAP_PAX
    392 L_CFLAGS += -DEAP_SERVER_PAX
    393 OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
    394 endif
    395 
    396 ifdef CONFIG_EAP_PSK
    397 L_CFLAGS += -DEAP_SERVER_PSK
    398 OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
    399 NEED_AES_OMAC1=y
    400 NEED_AES_ENCBLOCK=y
    401 NEED_AES_EAX=y
    402 endif
    403 
    404 ifdef CONFIG_EAP_SAKE
    405 L_CFLAGS += -DEAP_SERVER_SAKE
    406 OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
    407 endif
    408 
    409 ifdef CONFIG_EAP_GPSK
    410 L_CFLAGS += -DEAP_SERVER_GPSK
    411 OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
    412 ifdef CONFIG_EAP_GPSK_SHA256
    413 L_CFLAGS += -DEAP_GPSK_SHA256
    414 endif
    415 NEED_SHA256=y
    416 NEED_AES_OMAC1=y
    417 endif
    418 
    419 ifdef CONFIG_EAP_PWD
    420 L_CFLAGS += -DEAP_SERVER_PWD
    421 OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
    422 NEED_SHA256=y
    423 endif
    424 
    425 ifdef CONFIG_EAP_EKE
    426 L_CFLAGS += -DEAP_SERVER_EKE
    427 OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
    428 NEED_DH_GROUPS=y
    429 NEED_DH_GROUPS_ALL=y
    430 endif
    431 
    432 ifdef CONFIG_EAP_VENDOR_TEST
    433 L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
    434 OBJS += src/eap_server/eap_server_vendor_test.c
    435 endif
    436 
    437 ifdef CONFIG_EAP_FAST
    438 L_CFLAGS += -DEAP_SERVER_FAST
    439 OBJS += src/eap_server/eap_server_fast.c
    440 OBJS += src/eap_common/eap_fast_common.c
    441 TLS_FUNCS=y
    442 NEED_T_PRF=y
    443 NEED_AES_UNWRAP=y
    444 endif
    445 
    446 ifdef CONFIG_WPS
    447 L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
    448 OBJS += src/utils/uuid.c
    449 OBJS += src/ap/wps_hostapd.c
    450 OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
    451 OBJS += src/wps/wps.c
    452 OBJS += src/wps/wps_common.c
    453 OBJS += src/wps/wps_attr_parse.c
    454 OBJS += src/wps/wps_attr_build.c
    455 OBJS += src/wps/wps_attr_process.c
    456 OBJS += src/wps/wps_dev_attr.c
    457 OBJS += src/wps/wps_enrollee.c
    458 OBJS += src/wps/wps_registrar.c
    459 NEED_DH_GROUPS=y
    460 NEED_SHA256=y
    461 NEED_BASE64=y
    462 NEED_AES_CBC=y
    463 NEED_MODEXP=y
    464 CONFIG_EAP=y
    465 
    466 ifdef CONFIG_WPS_NFC
    467 L_CFLAGS += -DCONFIG_WPS_NFC
    468 OBJS += src/wps/ndef.c
    469 NEED_WPS_OOB=y
    470 endif
    471 
    472 ifdef NEED_WPS_OOB
    473 L_CFLAGS += -DCONFIG_WPS_OOB
    474 endif
    475 
    476 ifdef CONFIG_WPS_UPNP
    477 L_CFLAGS += -DCONFIG_WPS_UPNP
    478 OBJS += src/wps/wps_upnp.c
    479 OBJS += src/wps/wps_upnp_ssdp.c
    480 OBJS += src/wps/wps_upnp_web.c
    481 OBJS += src/wps/wps_upnp_event.c
    482 OBJS += src/wps/wps_upnp_ap.c
    483 OBJS += src/wps/upnp_xml.c
    484 OBJS += src/wps/httpread.c
    485 OBJS += src/wps/http_client.c
    486 OBJS += src/wps/http_server.c
    487 endif
    488 
    489 ifdef CONFIG_WPS_STRICT
    490 L_CFLAGS += -DCONFIG_WPS_STRICT
    491 OBJS += src/wps/wps_validate.c
    492 endif
    493 
    494 ifdef CONFIG_WPS_TESTING
    495 L_CFLAGS += -DCONFIG_WPS_TESTING
    496 endif
    497 
    498 endif
    499 
    500 ifdef CONFIG_EAP_IKEV2
    501 L_CFLAGS += -DEAP_SERVER_IKEV2
    502 OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
    503 OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
    504 NEED_DH_GROUPS=y
    505 NEED_DH_GROUPS_ALL=y
    506 NEED_MODEXP=y
    507 NEED_CIPHER=y
    508 endif
    509 
    510 ifdef CONFIG_EAP_TNC
    511 L_CFLAGS += -DEAP_SERVER_TNC
    512 OBJS += src/eap_server/eap_server_tnc.c
    513 OBJS += src/eap_server/tncs.c
    514 NEED_BASE64=y
    515 ifndef CONFIG_DRIVER_BSD
    516 LIBS += -ldl
    517 endif
    518 endif
    519 
    520 # Basic EAP functionality is needed for EAPOL
    521 OBJS += eap_register.c
    522 OBJS += src/eap_server/eap_server.c
    523 OBJS += src/eap_common/eap_common.c
    524 OBJS += src/eap_server/eap_server_methods.c
    525 OBJS += src/eap_server/eap_server_identity.c
    526 L_CFLAGS += -DEAP_SERVER_IDENTITY
    527 
    528 ifdef CONFIG_EAP
    529 L_CFLAGS += -DEAP_SERVER
    530 endif
    531 
    532 ifdef CONFIG_PKCS12
    533 L_CFLAGS += -DPKCS12_FUNCS
    534 endif
    535 
    536 ifdef MS_FUNCS
    537 OBJS += src/crypto/ms_funcs.c
    538 NEED_DES=y
    539 NEED_MD4=y
    540 endif
    541 
    542 ifdef CHAP
    543 OBJS += src/eap_common/chap.c
    544 endif
    545 
    546 ifdef TLS_FUNCS
    547 NEED_DES=y
    548 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
    549 L_CFLAGS += -DEAP_TLS_FUNCS
    550 OBJS += src/eap_server/eap_server_tls_common.c
    551 NEED_TLS_PRF=y
    552 endif
    553 
    554 ifndef CONFIG_TLS
    555 CONFIG_TLS=openssl
    556 endif
    557 
    558 ifdef CONFIG_TLSV11
    559 L_CFLAGS += -DCONFIG_TLSV11
    560 endif
    561 
    562 ifdef CONFIG_TLSV12
    563 L_CFLAGS += -DCONFIG_TLSV12
    564 NEED_SHA256=y
    565 endif
    566 
    567 ifeq ($(CONFIG_TLS), openssl)
    568 ifdef TLS_FUNCS
    569 OBJS += src/crypto/tls_openssl.c
    570 OBJS += src/crypto/tls_openssl_ocsp.c
    571 LIBS += -lssl
    572 endif
    573 OBJS += src/crypto/crypto_openssl.c
    574 HOBJS += src/crypto/crypto_openssl.c
    575 ifdef NEED_FIPS186_2_PRF
    576 OBJS += src/crypto/fips_prf_openssl.c
    577 endif
    578 NEED_SHA256=y
    579 NEED_TLS_PRF_SHA256=y
    580 LIBS += -lcrypto
    581 LIBS_h += -lcrypto
    582 endif
    583 
    584 ifeq ($(CONFIG_TLS), gnutls)
    585 ifdef TLS_FUNCS
    586 OBJS += src/crypto/tls_gnutls.c
    587 LIBS += -lgnutls -lgpg-error
    588 endif
    589 OBJS += src/crypto/crypto_gnutls.c
    590 HOBJS += src/crypto/crypto_gnutls.c
    591 ifdef NEED_FIPS186_2_PRF
    592 OBJS += src/crypto/fips_prf_internal.c
    593 OBJS += src/crypto/sha1-internal.c
    594 endif
    595 LIBS += -lgcrypt
    596 LIBS_h += -lgcrypt
    597 CONFIG_INTERNAL_SHA256=y
    598 CONFIG_INTERNAL_RC4=y
    599 CONFIG_INTERNAL_DH_GROUP5=y
    600 endif
    601 
    602 ifeq ($(CONFIG_TLS), internal)
    603 ifndef CONFIG_CRYPTO
    604 CONFIG_CRYPTO=internal
    605 endif
    606 ifdef TLS_FUNCS
    607 OBJS += src/crypto/crypto_internal-rsa.c
    608 OBJS += src/crypto/tls_internal.c
    609 OBJS += src/tls/tlsv1_common.c
    610 OBJS += src/tls/tlsv1_record.c
    611 OBJS += src/tls/tlsv1_cred.c
    612 OBJS += src/tls/tlsv1_server.c
    613 OBJS += src/tls/tlsv1_server_write.c
    614 OBJS += src/tls/tlsv1_server_read.c
    615 OBJS += src/tls/asn1.c
    616 OBJS += src/tls/rsa.c
    617 OBJS += src/tls/x509v3.c
    618 OBJS += src/tls/pkcs1.c
    619 OBJS += src/tls/pkcs5.c
    620 OBJS += src/tls/pkcs8.c
    621 NEED_SHA256=y
    622 NEED_BASE64=y
    623 NEED_TLS_PRF=y
    624 ifdef CONFIG_TLSV12
    625 NEED_TLS_PRF_SHA256=y
    626 endif
    627 NEED_MODEXP=y
    628 NEED_CIPHER=y
    629 L_CFLAGS += -DCONFIG_TLS_INTERNAL
    630 L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
    631 endif
    632 ifdef NEED_CIPHER
    633 NEED_DES=y
    634 OBJS += src/crypto/crypto_internal-cipher.c
    635 endif
    636 ifdef NEED_MODEXP
    637 OBJS += src/crypto/crypto_internal-modexp.c
    638 OBJS += src/tls/bignum.c
    639 endif
    640 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    641 OBJS += src/crypto/crypto_libtomcrypt.c
    642 LIBS += -ltomcrypt -ltfm
    643 LIBS_h += -ltomcrypt -ltfm
    644 CONFIG_INTERNAL_SHA256=y
    645 CONFIG_INTERNAL_RC4=y
    646 CONFIG_INTERNAL_DH_GROUP5=y
    647 endif
    648 ifeq ($(CONFIG_CRYPTO), internal)
    649 OBJS += src/crypto/crypto_internal.c
    650 NEED_AES_DEC=y
    651 L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
    652 ifdef CONFIG_INTERNAL_LIBTOMMATH
    653 L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
    654 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
    655 L_CFLAGS += -DLTM_FAST
    656 endif
    657 else
    658 LIBS += -ltommath
    659 LIBS_h += -ltommath
    660 endif
    661 CONFIG_INTERNAL_AES=y
    662 CONFIG_INTERNAL_DES=y
    663 CONFIG_INTERNAL_SHA1=y
    664 CONFIG_INTERNAL_MD4=y
    665 CONFIG_INTERNAL_MD5=y
    666 CONFIG_INTERNAL_SHA256=y
    667 CONFIG_INTERNAL_SHA384=y
    668 CONFIG_INTERNAL_SHA512=y
    669 CONFIG_INTERNAL_RC4=y
    670 CONFIG_INTERNAL_DH_GROUP5=y
    671 endif
    672 ifeq ($(CONFIG_CRYPTO), cryptoapi)
    673 OBJS += src/crypto/crypto_cryptoapi.c
    674 OBJS_p += src/crypto/crypto_cryptoapi.c
    675 L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
    676 CONFIG_INTERNAL_SHA256=y
    677 CONFIG_INTERNAL_RC4=y
    678 endif
    679 endif
    680 
    681 ifeq ($(CONFIG_TLS), none)
    682 ifdef TLS_FUNCS
    683 OBJS += src/crypto/tls_none.c
    684 L_CFLAGS += -DEAP_TLS_NONE
    685 CONFIG_INTERNAL_AES=y
    686 CONFIG_INTERNAL_SHA1=y
    687 CONFIG_INTERNAL_MD5=y
    688 endif
    689 OBJS += src/crypto/crypto_none.c
    690 OBJS_p += src/crypto/crypto_none.c
    691 CONFIG_INTERNAL_SHA256=y
    692 CONFIG_INTERNAL_RC4=y
    693 endif
    694 
    695 ifndef TLS_FUNCS
    696 OBJS += src/crypto/tls_none.c
    697 ifeq ($(CONFIG_TLS), internal)
    698 CONFIG_INTERNAL_AES=y
    699 CONFIG_INTERNAL_SHA1=y
    700 CONFIG_INTERNAL_MD5=y
    701 CONFIG_INTERNAL_RC4=y
    702 endif
    703 endif
    704 
    705 AESOBJS = # none so far
    706 ifdef CONFIG_INTERNAL_AES
    707 AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
    708 endif
    709 
    710 ifneq ($(CONFIG_TLS), openssl)
    711 AESOBJS += src/crypto/aes-wrap.c
    712 endif
    713 ifdef NEED_AES_EAX
    714 AESOBJS += src/crypto/aes-eax.c
    715 NEED_AES_CTR=y
    716 endif
    717 ifdef NEED_AES_CTR
    718 AESOBJS += src/crypto/aes-ctr.c
    719 endif
    720 ifdef NEED_AES_ENCBLOCK
    721 AESOBJS += src/crypto/aes-encblock.c
    722 endif
    723 ifdef NEED_AES_OMAC1
    724 AESOBJS += src/crypto/aes-omac1.c
    725 endif
    726 ifdef NEED_AES_UNWRAP
    727 ifneq ($(CONFIG_TLS), openssl)
    728 NEED_AES_DEC=y
    729 AESOBJS += src/crypto/aes-unwrap.c
    730 endif
    731 endif
    732 ifdef NEED_AES_CBC
    733 NEED_AES_DEC=y
    734 ifneq ($(CONFIG_TLS), openssl)
    735 AESOBJS += src/crypto/aes-cbc.c
    736 endif
    737 endif
    738 ifdef NEED_AES_DEC
    739 ifdef CONFIG_INTERNAL_AES
    740 AESOBJS += src/crypto/aes-internal-dec.c
    741 endif
    742 endif
    743 ifdef NEED_AES
    744 OBJS += $(AESOBJS)
    745 endif
    746 
    747 SHA1OBJS =
    748 ifdef NEED_SHA1
    749 ifneq ($(CONFIG_TLS), openssl)
    750 SHA1OBJS += src/crypto/sha1.c
    751 endif
    752 SHA1OBJS += src/crypto/sha1-prf.c
    753 ifdef CONFIG_INTERNAL_SHA1
    754 SHA1OBJS += src/crypto/sha1-internal.c
    755 ifdef NEED_FIPS186_2_PRF
    756 SHA1OBJS += src/crypto/fips_prf_internal.c
    757 endif
    758 endif
    759 ifneq ($(CONFIG_TLS), openssl)
    760 SHA1OBJS += src/crypto/sha1-pbkdf2.c
    761 endif
    762 ifdef NEED_T_PRF
    763 SHA1OBJS += src/crypto/sha1-tprf.c
    764 endif
    765 ifdef NEED_TLS_PRF
    766 SHA1OBJS += src/crypto/sha1-tlsprf.c
    767 endif
    768 endif
    769 
    770 ifdef NEED_SHA1
    771 OBJS += $(SHA1OBJS)
    772 endif
    773 
    774 ifneq ($(CONFIG_TLS), openssl)
    775 OBJS += src/crypto/md5.c
    776 endif
    777 
    778 ifdef NEED_MD5
    779 ifdef CONFIG_INTERNAL_MD5
    780 OBJS += src/crypto/md5-internal.c
    781 HOBJS += src/crypto/md5-internal.c
    782 endif
    783 endif
    784 
    785 ifdef NEED_MD4
    786 ifdef CONFIG_INTERNAL_MD4
    787 OBJS += src/crypto/md4-internal.c
    788 endif
    789 endif
    790 
    791 ifdef NEED_DES
    792 ifdef CONFIG_INTERNAL_DES
    793 OBJS += src/crypto/des-internal.c
    794 endif
    795 endif
    796 
    797 ifdef CONFIG_NO_RC4
    798 L_CFLAGS += -DCONFIG_NO_RC4
    799 endif
    800 
    801 ifdef NEED_RC4
    802 ifdef CONFIG_INTERNAL_RC4
    803 ifndef CONFIG_NO_RC4
    804 OBJS += src/crypto/rc4.c
    805 endif
    806 endif
    807 endif
    808 
    809 ifdef NEED_SHA256
    810 L_CFLAGS += -DCONFIG_SHA256
    811 ifneq ($(CONFIG_TLS), openssl)
    812 OBJS += src/crypto/sha256.c
    813 endif
    814 OBJS += src/crypto/sha256-prf.c
    815 ifdef CONFIG_INTERNAL_SHA256
    816 OBJS += src/crypto/sha256-internal.c
    817 endif
    818 ifdef NEED_TLS_PRF_SHA256
    819 OBJS += src/crypto/sha256-tlsprf.c
    820 endif
    821 endif
    822 ifdef NEED_SHA384
    823 L_CFLAGS += -DCONFIG_SHA384
    824 OBJS += src/crypto/sha384-prf.c
    825 endif
    826 
    827 ifdef CONFIG_INTERNAL_SHA384
    828 L_CFLAGS += -DCONFIG_INTERNAL_SHA384
    829 OBJS += src/crypto/sha384-internal.c
    830 endif
    831 
    832 ifdef CONFIG_INTERNAL_SHA512
    833 L_CFLAGS += -DCONFIG_INTERNAL_SHA512
    834 OBJS += src/crypto/sha512-internal.c
    835 endif
    836 
    837 ifdef NEED_DH_GROUPS
    838 OBJS += src/crypto/dh_groups.c
    839 endif
    840 ifdef NEED_DH_GROUPS_ALL
    841 L_CFLAGS += -DALL_DH_GROUPS
    842 endif
    843 ifdef CONFIG_INTERNAL_DH_GROUP5
    844 ifdef NEED_DH_GROUPS
    845 OBJS += src/crypto/dh_group5.c
    846 endif
    847 endif
    848 
    849 ifdef NEED_ECC
    850 L_CFLAGS += -DCONFIG_ECC
    851 endif
    852 
    853 ifdef CONFIG_NO_RANDOM_POOL
    854 L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
    855 else
    856 OBJS += src/crypto/random.c
    857 HOBJS += src/crypto/random.c
    858 HOBJS += src/utils/eloop.c
    859 HOBJS += $(SHA1OBJS)
    860 ifneq ($(CONFIG_TLS), openssl)
    861 HOBJS += src/crypto/md5.c
    862 endif
    863 endif
    864 
    865 ifdef CONFIG_RADIUS_SERVER
    866 L_CFLAGS += -DRADIUS_SERVER
    867 OBJS += src/radius/radius_server.c
    868 endif
    869 
    870 ifdef CONFIG_IPV6
    871 L_CFLAGS += -DCONFIG_IPV6
    872 endif
    873 
    874 ifdef CONFIG_DRIVER_RADIUS_ACL
    875 L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
    876 endif
    877 
    878 ifdef NEED_BASE64
    879 OBJS += src/utils/base64.c
    880 endif
    881 
    882 ifdef NEED_AP_MLME
    883 OBJS += src/ap/wmm.c
    884 OBJS += src/ap/ap_list.c
    885 OBJS += src/ap/ieee802_11.c
    886 OBJS += src/ap/hw_features.c
    887 OBJS += src/ap/dfs.c
    888 L_CFLAGS += -DNEED_AP_MLME
    889 endif
    890 ifdef CONFIG_IEEE80211N
    891 OBJS += src/ap/ieee802_11_ht.c
    892 endif
    893 
    894 ifdef CONFIG_IEEE80211AC
    895 OBJS += src/ap/ieee802_11_vht.c
    896 endif
    897 
    898 ifdef CONFIG_P2P_MANAGER
    899 L_CFLAGS += -DCONFIG_P2P_MANAGER
    900 OBJS += src/ap/p2p_hostapd.c
    901 endif
    902 
    903 ifdef CONFIG_HS20
    904 L_CFLAGS += -DCONFIG_HS20
    905 OBJS += src/ap/hs20.c
    906 CONFIG_INTERWORKING=y
    907 endif
    908 
    909 ifdef CONFIG_INTERWORKING
    910 L_CFLAGS += -DCONFIG_INTERWORKING
    911 OBJS += src/common/gas.c
    912 OBJS += src/ap/gas_serv.c
    913 endif
    914 
    915 ifdef CONFIG_PROXYARP
    916 L_CFLAGS += -DCONFIG_PROXYARP
    917 OBJS += src/ap/x_snoop.c
    918 OBJS += src/ap/dhcp_snoop.c
    919 ifdef CONFIG_IPV6
    920 OBJS += src/ap/ndisc_snoop.c
    921 endif
    922 endif
    923 
    924 OBJS += src/drivers/driver_common.c
    925 
    926 ifdef CONFIG_ACS
    927 L_CFLAGS += -DCONFIG_ACS
    928 OBJS += src/ap/acs.c
    929 LIBS += -lm
    930 endif
    931 
    932 ifdef CONFIG_NO_STDOUT_DEBUG
    933 L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
    934 endif
    935 
    936 ifdef CONFIG_DEBUG_LINUX_TRACING
    937 L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
    938 endif
    939 
    940 ifdef CONFIG_DEBUG_FILE
    941 L_CFLAGS += -DCONFIG_DEBUG_FILE
    942 endif
    943 
    944 ifdef CONFIG_ANDROID_LOG
    945 L_CFLAGS += -DCONFIG_ANDROID_LOG
    946 endif
    947 
    948 OBJS_c = hostapd_cli.c src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
    949 OBJS_c += src/utils/eloop.c
    950 OBJS_c += src/utils/common.c
    951 ifdef CONFIG_WPA_TRACE
    952 OBJS_c += src/utils/trace.c
    953 endif
    954 OBJS_c += src/utils/wpa_debug.c
    955 ifdef CONFIG_WPA_CLI_EDIT
    956 OBJS_c += src/utils/edit.c
    957 else
    958 OBJS_c += src/utils/edit_simple.c
    959 endif
    960 
    961 ########################
    962 
    963 include $(CLEAR_VARS)
    964 LOCAL_MODULE := hostapd_cli
    965 LOCAL_MODULE_TAGS := debug
    966 LOCAL_SHARED_LIBRARIES := libc libcutils liblog
    967 LOCAL_CFLAGS := $(L_CFLAGS)
    968 LOCAL_SRC_FILES := $(OBJS_c)
    969 LOCAL_C_INCLUDES := $(INCLUDES)
    970 include $(BUILD_EXECUTABLE)
    971 
    972 ########################
    973 include $(CLEAR_VARS)
    974 LOCAL_MODULE := hostapd
    975 LOCAL_MODULE_TAGS := optional
    976 ifdef CONFIG_DRIVER_CUSTOM
    977 LOCAL_STATIC_LIBRARIES := libCustomWifi
    978 endif
    979 ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
    980 LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
    981 endif
    982 LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
    983 ifdef CONFIG_DRIVER_NL80211
    984 ifneq ($(wildcard external/libnl),)
    985 LOCAL_SHARED_LIBRARIES += libnl
    986 else
    987 LOCAL_STATIC_LIBRARIES += libnl_2
    988 endif
    989 endif
    990 LOCAL_CFLAGS := $(L_CFLAGS)
    991 LOCAL_SRC_FILES := $(OBJS)
    992 LOCAL_C_INCLUDES := $(INCLUDES)
    993 include $(BUILD_EXECUTABLE)
    994 
    995 endif # ifeq ($(WPA_BUILD_HOSTAPD),true)
    996