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