Dmitry Shmidt | c81d5b6 | 2012-05-14 13:35:02 -0700 | [diff] [blame] | 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 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | LOCAL_PATH := $(call my-dir) |
| 8 | |
| 9 | WPA_BUILD_HOSTAPD := false |
Jeff Brown | bbda627 | 2011-07-11 22:12:15 -0700 | [diff] [blame] | 10 | ifneq ($(BOARD_HOSTAPD_DRIVER),) |
| 11 | WPA_BUILD_HOSTAPD := true |
| 12 | CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 13 | endif |
| 14 | |
Dmitry Shmidt | e61a2d6 | 2011-06-27 10:59:51 -0700 | [diff] [blame] | 15 | ifeq ($(WPA_BUILD_HOSTAPD),true) |
| 16 | |
Dmitry Shmidt | 7dd0f20 | 2012-02-21 16:49:00 -0800 | [diff] [blame] | 17 | include $(LOCAL_PATH)/android.config |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 18 | |
| 19 | # To ignore possible wrong network configurations |
| 20 | L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS |
| 21 | |
Dmitry Shmidt | 95613e4 | 2011-10-25 10:50:42 -0700 | [diff] [blame] | 22 | L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\" |
| 23 | |
Dmitry Shmidt | 648b749 | 2011-09-30 15:03:42 -0700 | [diff] [blame] | 24 | # Set Android log name |
| 25 | L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\" |
| 26 | |
Chih-Hung Hsieh | 0220b4c | 2017-11-07 11:08:08 -0800 | [diff] [blame] | 27 | L_CFLAGS += -Wall -Werror |
| 28 | |
Elliott Hughes | 17cb3c1 | 2018-01-22 13:31:46 -0800 | [diff] [blame] | 29 | # TODO: move off readdir_r upstream, pull fix back (http://b/72326431). |
| 30 | L_CFLAGS += -Wno-error-deprecated-declarations |
| 31 | |
Dmitry Shmidt | f9bdef9 | 2014-04-25 10:46:36 -0700 | [diff] [blame] | 32 | # Disable unused parameter warnings |
| 33 | L_CFLAGS += -Wno-unused-parameter |
| 34 | |
Chih-Hung Hsieh | 0220b4c | 2017-11-07 11:08:08 -0800 | [diff] [blame] | 35 | # Disable unused variable warnings |
| 36 | L_CFLAGS += -Wno-unused-variable |
| 37 | |
Christopher Ferris | b6c19e0 | 2017-02-23 15:50:04 -0800 | [diff] [blame] | 38 | # Disable macro redefined warnings |
| 39 | L_CFLAGS += -Wno-macro-redefined |
| 40 | |
Dmitry Shmidt | b58836e | 2014-04-29 14:35:56 -0700 | [diff] [blame] | 41 | # Set Android extended P2P functionality |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 42 | L_CFLAGS += -DANDROID_P2P |
Dmitry Shmidt | 4171258 | 2015-06-29 11:02:15 -0700 | [diff] [blame] | 43 | |
Dmitry Shmidt | b58836e | 2014-04-29 14:35:56 -0700 | [diff] [blame] | 44 | ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),) |
Dmitry Shmidt | 4171258 | 2015-06-29 11:02:15 -0700 | [diff] [blame] | 45 | L_CFLAGS += -DANDROID_LIB_STUB |
Mike J. Chen | 0cc49e8 | 2012-12-05 11:20:29 -0800 | [diff] [blame] | 46 | endif |
| 47 | |
Jeff Johnson | 205f214 | 2012-09-03 22:12:17 -0700 | [diff] [blame] | 48 | # Use Android specific directory for control interface sockets |
Huajun Tong | 527b3ba | 2018-04-20 16:29:50 +0800 | [diff] [blame] | 49 | L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/vendor/wifi/hostapd/sockets\" |
| 50 | L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/vendor/wifi/hostapd/ctrl\" |
Jeff Johnson | 205f214 | 2012-09-03 22:12:17 -0700 | [diff] [blame] | 51 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 52 | # Use Android specific directory for hostapd_cli command completion history |
Huajun Tong | 527b3ba | 2018-04-20 16:29:50 +0800 | [diff] [blame] | 53 | L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/vendor/wifi/hostapd\" |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 54 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 55 | # To force sizeof(enum) = 4 |
| 56 | ifeq ($(TARGET_ARCH),arm) |
| 57 | L_CFLAGS += -mabi=aapcs-linux |
| 58 | endif |
| 59 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 60 | INCLUDES = $(LOCAL_PATH) |
| 61 | INCLUDES += $(LOCAL_PATH)/src |
| 62 | INCLUDES += $(LOCAL_PATH)/src/utils |
Stephen Smalley | f1396b4 | 2012-11-16 12:50:03 -0500 | [diff] [blame] | 63 | INCLUDES += system/security/keystore/include |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 64 | ifdef CONFIG_DRIVER_NL80211 |
Dmitry Shmidt | cd44645 | 2014-02-18 16:03:35 -0800 | [diff] [blame] | 65 | ifneq ($(wildcard external/libnl),) |
Dmitry Shmidt | d620e6d | 2014-02-18 11:07:59 -0800 | [diff] [blame] | 66 | INCLUDES += external/libnl/include |
Dmitry Shmidt | cd44645 | 2014-02-18 16:03:35 -0800 | [diff] [blame] | 67 | else |
| 68 | INCLUDES += external/libnl-headers |
| 69 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 70 | endif |
| 71 | |
Kai Shi | e75b065 | 2020-11-24 20:31:29 -0800 | [diff] [blame^] | 72 | ifdef CONFIG_TESTING_OPTIONS |
| 73 | L_CFLAGS += -DCONFIG_TESTING_OPTIONS |
| 74 | CONFIG_WPS_TESTING=y |
| 75 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 76 | |
| 77 | ifndef CONFIG_OS |
| 78 | ifdef CONFIG_NATIVE_WINDOWS |
| 79 | CONFIG_OS=win32 |
| 80 | else |
| 81 | CONFIG_OS=unix |
| 82 | endif |
| 83 | endif |
| 84 | |
| 85 | ifeq ($(CONFIG_OS), internal) |
| 86 | L_CFLAGS += -DOS_NO_C_LIB_DEFINES |
| 87 | endif |
| 88 | |
| 89 | ifdef CONFIG_NATIVE_WINDOWS |
| 90 | L_CFLAGS += -DCONFIG_NATIVE_WINDOWS |
| 91 | LIBS += -lws2_32 |
| 92 | endif |
| 93 | |
| 94 | OBJS = main.c |
| 95 | OBJS += config_file.c |
| 96 | |
| 97 | OBJS += src/ap/hostapd.c |
| 98 | OBJS += src/ap/wpa_auth_glue.c |
| 99 | OBJS += src/ap/drv_callbacks.c |
| 100 | OBJS += src/ap/ap_drv_ops.c |
| 101 | OBJS += src/ap/utils.c |
| 102 | OBJS += src/ap/authsrv.c |
| 103 | OBJS += src/ap/ieee802_1x.c |
| 104 | OBJS += src/ap/ap_config.c |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 105 | OBJS += src/ap/eap_user_db.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 106 | OBJS += src/ap/ieee802_11_auth.c |
| 107 | OBJS += src/ap/sta_info.c |
| 108 | OBJS += src/ap/wpa_auth.c |
| 109 | OBJS += src/ap/tkip_countermeasures.c |
| 110 | OBJS += src/ap/ap_mlme.c |
| 111 | OBJS += src/ap/wpa_auth_ie.c |
| 112 | OBJS += src/ap/preauth_auth.c |
| 113 | OBJS += src/ap/pmksa_cache_auth.c |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 114 | OBJS += src/ap/ieee802_11_shared.c |
| 115 | OBJS += src/ap/beacon.c |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 116 | OBJS += src/ap/bss_load.c |
Dmitry Shmidt | 849734c | 2016-05-27 09:59:01 -0700 | [diff] [blame] | 117 | OBJS += src/ap/neighbor_db.c |
| 118 | OBJS += src/ap/rrm.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 119 | OBJS_d = |
| 120 | OBJS_p = |
| 121 | LIBS = |
| 122 | LIBS_c = |
| 123 | HOBJS = |
| 124 | LIBS_h = |
| 125 | |
| 126 | NEED_RC4=y |
| 127 | NEED_AES=y |
| 128 | NEED_MD5=y |
| 129 | NEED_SHA1=y |
| 130 | |
| 131 | OBJS += src/drivers/drivers.c |
| 132 | L_CFLAGS += -DHOSTAPD |
| 133 | |
| 134 | ifdef CONFIG_WPA_TRACE |
| 135 | L_CFLAGS += -DWPA_TRACE |
| 136 | OBJS += src/utils/trace.c |
| 137 | HOBJS += src/utils/trace.c |
| 138 | LDFLAGS += -rdynamic |
| 139 | L_CFLAGS += -funwind-tables |
| 140 | ifdef CONFIG_WPA_TRACE_BFD |
| 141 | L_CFLAGS += -DWPA_TRACE_BFD |
| 142 | LIBS += -lbfd |
| 143 | LIBS_c += -lbfd |
| 144 | LIBS_h += -lbfd |
| 145 | endif |
| 146 | endif |
| 147 | |
| 148 | OBJS += src/utils/eloop.c |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 149 | |
| 150 | ifdef CONFIG_ELOOP_POLL |
| 151 | L_CFLAGS += -DCONFIG_ELOOP_POLL |
| 152 | endif |
| 153 | |
| 154 | ifdef CONFIG_ELOOP_EPOLL |
| 155 | L_CFLAGS += -DCONFIG_ELOOP_EPOLL |
| 156 | endif |
| 157 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 158 | OBJS += src/utils/common.c |
| 159 | OBJS += src/utils/wpa_debug.c |
| 160 | OBJS += src/utils/wpabuf.c |
| 161 | OBJS += src/utils/os_$(CONFIG_OS).c |
| 162 | OBJS += src/utils/ip_addr.c |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 163 | OBJS += src/utils/crc32.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 164 | |
| 165 | OBJS += src/common/ieee802_11_common.c |
| 166 | OBJS += src/common/wpa_common.c |
Dmitry Shmidt | 746bde5 | 2015-01-12 13:01:47 -0800 | [diff] [blame] | 167 | OBJS += src/common/hw_features_common.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 168 | |
| 169 | OBJS += src/eapol_auth/eapol_auth_sm.c |
| 170 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 171 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 172 | ifndef CONFIG_NO_DUMP_STATE |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 173 | # define HOSTAPD_DUMP_STATE to include support for dumping internal state |
| 174 | # through control interface commands (undefine it, if you want to save in |
| 175 | # binary size) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 176 | L_CFLAGS += -DHOSTAPD_DUMP_STATE |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 177 | OBJS += src/eapol_auth/eapol_auth_dump.c |
| 178 | endif |
| 179 | |
| 180 | ifdef CONFIG_NO_RADIUS |
| 181 | L_CFLAGS += -DCONFIG_NO_RADIUS |
| 182 | CONFIG_NO_ACCOUNTING=y |
| 183 | else |
| 184 | OBJS += src/radius/radius.c |
| 185 | OBJS += src/radius/radius_client.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 186 | OBJS += src/radius/radius_das.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 187 | endif |
| 188 | |
| 189 | ifdef CONFIG_NO_ACCOUNTING |
| 190 | L_CFLAGS += -DCONFIG_NO_ACCOUNTING |
| 191 | else |
| 192 | OBJS += src/ap/accounting.c |
| 193 | endif |
| 194 | |
| 195 | ifdef CONFIG_NO_VLAN |
| 196 | L_CFLAGS += -DCONFIG_NO_VLAN |
| 197 | else |
| 198 | OBJS += src/ap/vlan_init.c |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 199 | OBJS += src/ap/vlan_ifconfig.c |
Dmitry Shmidt | 57c2d39 | 2016-02-23 13:40:19 -0800 | [diff] [blame] | 200 | OBJS += src/ap/vlan.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 201 | ifdef CONFIG_FULL_DYNAMIC_VLAN |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 202 | # Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges |
| 203 | # and VLAN interfaces for the VLAN feature. |
| 204 | L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN |
| 205 | OBJS += src/ap/vlan_full.c |
| 206 | ifdef CONFIG_VLAN_NETLINK |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 207 | OBJS += src/ap/vlan_util.c |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 208 | else |
| 209 | OBJS += src/ap/vlan_ioctl.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 210 | endif |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 211 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 212 | endif |
| 213 | |
| 214 | ifdef CONFIG_NO_CTRL_IFACE |
| 215 | L_CFLAGS += -DCONFIG_NO_CTRL_IFACE |
| 216 | else |
Dmitry Shmidt | 31a29cc | 2016-03-09 15:58:17 -0800 | [diff] [blame] | 217 | OBJS += src/common/ctrl_iface_common.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 218 | OBJS += ctrl_iface.c |
| 219 | OBJS += src/ap/ctrl_iface_ap.c |
| 220 | endif |
| 221 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 222 | L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX |
| 223 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 224 | ifdef CONFIG_RSN_PREAUTH |
| 225 | L_CFLAGS += -DCONFIG_RSN_PREAUTH |
| 226 | CONFIG_L2_PACKET=y |
| 227 | endif |
| 228 | |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 229 | ifdef CONFIG_HS20 |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 230 | CONFIG_PROXYARP=y |
| 231 | endif |
| 232 | |
| 233 | ifdef CONFIG_PROXYARP |
| 234 | CONFIG_L2_PACKET=y |
| 235 | endif |
| 236 | |
| 237 | ifdef CONFIG_SUITEB |
| 238 | L_CFLAGS += -DCONFIG_SUITEB |
Dmitry Shmidt | f21452a | 2014-02-26 10:55:25 -0800 | [diff] [blame] | 239 | endif |
| 240 | |
Dmitry Shmidt | 40b0720 | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 241 | ifdef CONFIG_SUITEB192 |
| 242 | L_CFLAGS += -DCONFIG_SUITEB192 |
| 243 | NEED_SHA384=y |
| 244 | endif |
| 245 | |
Hai Shalom | 74f70d4 | 2019-02-11 14:42:39 -0800 | [diff] [blame] | 246 | ifdef CONFIG_OCV |
| 247 | L_CFLAGS += -DCONFIG_OCV |
| 248 | OBJS += src/common/ocv.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 249 | endif |
| 250 | |
| 251 | ifdef CONFIG_IEEE80211R |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 252 | L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 253 | OBJS += src/ap/wpa_auth_ft.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 254 | NEED_AES_UNWRAP=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 255 | NEED_AES_SIV=y |
| 256 | NEED_ETH_P_OUI=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 257 | NEED_HMAC_SHA256_KDF=y |
| 258 | endif |
| 259 | |
| 260 | ifdef NEED_ETH_P_OUI |
| 261 | L_CFLAGS += -DCONFIG_ETH_P_OUI |
| 262 | OBJS += src/ap/eth_p_oui.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 263 | endif |
| 264 | |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 265 | ifdef CONFIG_SAE |
| 266 | L_CFLAGS += -DCONFIG_SAE |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 267 | OBJS += src/common/sae.c |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 268 | ifdef CONFIG_SAE_PK |
| 269 | L_CFLAGS += -DCONFIG_SAE_PK |
| 270 | OBJS += src/common/sae_pk.c |
| 271 | endif |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 272 | NEED_ECC=y |
| 273 | NEED_DH_GROUPS=y |
Hai Shalom | b755a2a | 2020-04-23 21:49:02 -0700 | [diff] [blame] | 274 | NEED_HMAC_SHA256_KDF=y |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 275 | NEED_DRAGONFLY=y |
Dmitry Shmidt | d5e4923 | 2012-12-03 15:08:10 -0800 | [diff] [blame] | 276 | endif |
| 277 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 278 | ifdef CONFIG_OWE |
| 279 | L_CFLAGS += -DCONFIG_OWE |
| 280 | NEED_ECC=y |
| 281 | NEED_HMAC_SHA256_KDF=y |
| 282 | NEED_HMAC_SHA384_KDF=y |
| 283 | NEED_HMAC_SHA512_KDF=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 284 | NEED_SHA384=y |
| 285 | NEED_SHA512=y |
| 286 | endif |
| 287 | |
Jimmy Chen | caaac07 | 2019-09-16 16:36:06 +0800 | [diff] [blame] | 288 | ifdef CONFIG_WAPI_INTERFACE |
| 289 | L_CFLAGS += -DCONFIG_WAPI_INTERFACE |
| 290 | endif |
| 291 | |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 292 | ifdef CONFIG_FILS |
| 293 | L_CFLAGS += -DCONFIG_FILS |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 294 | OBJS += src/ap/fils_hlp.c |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 295 | NEED_SHA384=y |
| 296 | NEED_AES_SIV=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 297 | ifdef CONFIG_FILS_SK_PFS |
| 298 | L_CFLAGS += -DCONFIG_FILS_SK_PFS |
| 299 | NEED_ECC=y |
| 300 | endif |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 301 | endif |
| 302 | |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 303 | ifdef CONFIG_WNM |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 304 | L_CFLAGS += -DCONFIG_WNM -DCONFIG_WNM_AP |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 305 | OBJS += src/ap/wnm_ap.c |
| 306 | endif |
| 307 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 308 | ifdef CONFIG_IEEE80211AC |
| 309 | L_CFLAGS += -DCONFIG_IEEE80211AC |
| 310 | endif |
| 311 | |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 312 | ifdef CONFIG_IEEE80211AX |
| 313 | L_CFLAGS += -DCONFIG_IEEE80211AX |
| 314 | endif |
| 315 | |
Dmitry Shmidt | 57c2d39 | 2016-02-23 13:40:19 -0800 | [diff] [blame] | 316 | ifdef CONFIG_MBO |
| 317 | L_CFLAGS += -DCONFIG_MBO |
| 318 | OBJS += src/ap/mbo_ap.c |
| 319 | endif |
| 320 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 321 | ifdef CONFIG_FST |
| 322 | L_CFLAGS += -DCONFIG_FST |
| 323 | OBJS += src/fst/fst.c |
| 324 | OBJS += src/fst/fst_group.c |
| 325 | OBJS += src/fst/fst_iface.c |
| 326 | OBJS += src/fst/fst_session.c |
| 327 | OBJS += src/fst/fst_ctrl_aux.c |
| 328 | ifdef CONFIG_FST_TEST |
| 329 | L_CFLAGS += -DCONFIG_FST_TEST |
| 330 | endif |
| 331 | ifndef CONFIG_NO_CTRL_IFACE |
| 332 | OBJS += src/fst/fst_ctrl_iface.c |
| 333 | endif |
| 334 | endif |
| 335 | |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 336 | ifdef CONFIG_WEP |
| 337 | L_CFLAGS += -DCONFIG_WEP |
| 338 | endif |
| 339 | |
Hai Shalom | b755a2a | 2020-04-23 21:49:02 -0700 | [diff] [blame] | 340 | ifdef CONFIG_NO_TKIP |
| 341 | L_CFLAGS += -DCONFIG_NO_TKIP |
| 342 | endif |
| 343 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 344 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 345 | include $(LOCAL_PATH)/src/drivers/drivers.mk |
| 346 | |
| 347 | OBJS += $(DRV_AP_OBJS) |
| 348 | L_CFLAGS += $(DRV_AP_CFLAGS) |
| 349 | LDFLAGS += $(DRV_AP_LDFLAGS) |
| 350 | LIBS += $(DRV_AP_LIBS) |
| 351 | |
| 352 | ifdef CONFIG_L2_PACKET |
| 353 | ifdef CONFIG_DNET_PCAP |
| 354 | ifdef CONFIG_L2_FREEBSD |
| 355 | LIBS += -lpcap |
| 356 | OBJS += src/l2_packet/l2_packet_freebsd.c |
| 357 | else |
| 358 | LIBS += -ldnet -lpcap |
| 359 | OBJS += src/l2_packet/l2_packet_pcap.c |
| 360 | endif |
| 361 | else |
| 362 | OBJS += src/l2_packet/l2_packet_linux.c |
| 363 | endif |
| 364 | else |
| 365 | OBJS += src/l2_packet/l2_packet_none.c |
| 366 | endif |
| 367 | |
| 368 | |
| 369 | ifdef CONFIG_EAP_MD5 |
| 370 | L_CFLAGS += -DEAP_SERVER_MD5 |
| 371 | OBJS += src/eap_server/eap_server_md5.c |
| 372 | CHAP=y |
| 373 | endif |
| 374 | |
| 375 | ifdef CONFIG_EAP_TLS |
| 376 | L_CFLAGS += -DEAP_SERVER_TLS |
| 377 | OBJS += src/eap_server/eap_server_tls.c |
| 378 | TLS_FUNCS=y |
| 379 | endif |
| 380 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 381 | ifdef CONFIG_EAP_UNAUTH_TLS |
| 382 | L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS |
| 383 | ifndef CONFIG_EAP_TLS |
| 384 | OBJS += src/eap_server/eap_server_tls.c |
| 385 | TLS_FUNCS=y |
| 386 | endif |
| 387 | endif |
| 388 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 389 | ifdef CONFIG_EAP_PEAP |
| 390 | L_CFLAGS += -DEAP_SERVER_PEAP |
| 391 | OBJS += src/eap_server/eap_server_peap.c |
| 392 | OBJS += src/eap_common/eap_peap_common.c |
| 393 | TLS_FUNCS=y |
| 394 | CONFIG_EAP_MSCHAPV2=y |
| 395 | endif |
| 396 | |
| 397 | ifdef CONFIG_EAP_TTLS |
| 398 | L_CFLAGS += -DEAP_SERVER_TTLS |
| 399 | OBJS += src/eap_server/eap_server_ttls.c |
| 400 | TLS_FUNCS=y |
| 401 | CHAP=y |
| 402 | endif |
| 403 | |
| 404 | ifdef CONFIG_EAP_MSCHAPV2 |
| 405 | L_CFLAGS += -DEAP_SERVER_MSCHAPV2 |
| 406 | OBJS += src/eap_server/eap_server_mschapv2.c |
| 407 | MS_FUNCS=y |
| 408 | endif |
| 409 | |
| 410 | ifdef CONFIG_EAP_GTC |
| 411 | L_CFLAGS += -DEAP_SERVER_GTC |
| 412 | OBJS += src/eap_server/eap_server_gtc.c |
| 413 | endif |
| 414 | |
| 415 | ifdef CONFIG_EAP_SIM |
| 416 | L_CFLAGS += -DEAP_SERVER_SIM |
| 417 | OBJS += src/eap_server/eap_server_sim.c |
| 418 | CONFIG_EAP_SIM_COMMON=y |
| 419 | NEED_AES_CBC=y |
| 420 | endif |
| 421 | |
| 422 | ifdef CONFIG_EAP_AKA |
| 423 | L_CFLAGS += -DEAP_SERVER_AKA |
| 424 | OBJS += src/eap_server/eap_server_aka.c |
| 425 | CONFIG_EAP_SIM_COMMON=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 426 | NEED_AES_CBC=y |
| 427 | endif |
| 428 | |
| 429 | ifdef CONFIG_EAP_AKA_PRIME |
| 430 | L_CFLAGS += -DEAP_SERVER_AKA_PRIME |
| 431 | endif |
| 432 | |
| 433 | ifdef CONFIG_EAP_SIM_COMMON |
| 434 | OBJS += src/eap_common/eap_sim_common.c |
| 435 | # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 436 | # replaced with another file implementing the interface specified in |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 437 | # eap_sim_db.h. |
| 438 | OBJS += src/eap_server/eap_sim_db.c |
| 439 | NEED_FIPS186_2_PRF=y |
| 440 | endif |
| 441 | |
| 442 | ifdef CONFIG_EAP_PAX |
| 443 | L_CFLAGS += -DEAP_SERVER_PAX |
| 444 | OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c |
| 445 | endif |
| 446 | |
| 447 | ifdef CONFIG_EAP_PSK |
| 448 | L_CFLAGS += -DEAP_SERVER_PSK |
| 449 | OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 450 | NEED_AES_ENCBLOCK=y |
| 451 | NEED_AES_EAX=y |
| 452 | endif |
| 453 | |
| 454 | ifdef CONFIG_EAP_SAKE |
| 455 | L_CFLAGS += -DEAP_SERVER_SAKE |
| 456 | OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c |
| 457 | endif |
| 458 | |
| 459 | ifdef CONFIG_EAP_GPSK |
| 460 | L_CFLAGS += -DEAP_SERVER_GPSK |
| 461 | OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c |
| 462 | ifdef CONFIG_EAP_GPSK_SHA256 |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 463 | L_CFLAGS += -DEAP_GPSK_SHA256 |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 464 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 465 | endif |
| 466 | |
| 467 | ifdef CONFIG_EAP_PWD |
| 468 | L_CFLAGS += -DEAP_SERVER_PWD |
| 469 | OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 470 | NEED_ECC=y |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 471 | NEED_DRAGONFLY=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 472 | endif |
| 473 | |
Dmitry Shmidt | 34af306 | 2013-07-11 10:46:32 -0700 | [diff] [blame] | 474 | ifdef CONFIG_EAP_EKE |
| 475 | L_CFLAGS += -DEAP_SERVER_EKE |
| 476 | OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c |
| 477 | NEED_DH_GROUPS=y |
| 478 | NEED_DH_GROUPS_ALL=y |
| 479 | endif |
| 480 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 481 | ifdef CONFIG_EAP_VENDOR_TEST |
| 482 | L_CFLAGS += -DEAP_SERVER_VENDOR_TEST |
| 483 | OBJS += src/eap_server/eap_server_vendor_test.c |
| 484 | endif |
| 485 | |
| 486 | ifdef CONFIG_EAP_FAST |
| 487 | L_CFLAGS += -DEAP_SERVER_FAST |
| 488 | OBJS += src/eap_server/eap_server_fast.c |
| 489 | OBJS += src/eap_common/eap_fast_common.c |
| 490 | TLS_FUNCS=y |
| 491 | NEED_T_PRF=y |
| 492 | NEED_AES_UNWRAP=y |
| 493 | endif |
| 494 | |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 495 | ifdef CONFIG_EAP_TEAP |
| 496 | L_CFLAGS += -DEAP_SERVER_TEAP |
| 497 | OBJS += src/eap_server/eap_server_teap.c |
| 498 | OBJS += src/eap_common/eap_teap_common.c |
| 499 | TLS_FUNCS=y |
| 500 | NEED_T_PRF=y |
| 501 | NEED_SHA384=y |
Hai Shalom | c356592 | 2019-10-28 11:58:20 -0700 | [diff] [blame] | 502 | NEED_TLS_PRF_SHA256=y |
| 503 | NEED_TLS_PRF_SHA384=y |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 504 | NEED_AES_UNWRAP=y |
| 505 | endif |
| 506 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 507 | ifdef CONFIG_WPS |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 508 | L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC |
| 509 | OBJS += src/utils/uuid.c |
| 510 | OBJS += src/ap/wps_hostapd.c |
| 511 | OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c |
| 512 | OBJS += src/wps/wps.c |
| 513 | OBJS += src/wps/wps_common.c |
| 514 | OBJS += src/wps/wps_attr_parse.c |
| 515 | OBJS += src/wps/wps_attr_build.c |
| 516 | OBJS += src/wps/wps_attr_process.c |
| 517 | OBJS += src/wps/wps_dev_attr.c |
| 518 | OBJS += src/wps/wps_enrollee.c |
| 519 | OBJS += src/wps/wps_registrar.c |
| 520 | NEED_DH_GROUPS=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 521 | NEED_BASE64=y |
| 522 | NEED_AES_CBC=y |
| 523 | NEED_MODEXP=y |
| 524 | CONFIG_EAP=y |
| 525 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 526 | ifdef CONFIG_WPS_NFC |
| 527 | L_CFLAGS += -DCONFIG_WPS_NFC |
| 528 | OBJS += src/wps/ndef.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 529 | NEED_WPS_OOB=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 530 | endif |
| 531 | |
| 532 | ifdef NEED_WPS_OOB |
| 533 | L_CFLAGS += -DCONFIG_WPS_OOB |
| 534 | endif |
| 535 | |
| 536 | ifdef CONFIG_WPS_UPNP |
| 537 | L_CFLAGS += -DCONFIG_WPS_UPNP |
| 538 | OBJS += src/wps/wps_upnp.c |
| 539 | OBJS += src/wps/wps_upnp_ssdp.c |
| 540 | OBJS += src/wps/wps_upnp_web.c |
| 541 | OBJS += src/wps/wps_upnp_event.c |
| 542 | OBJS += src/wps/wps_upnp_ap.c |
| 543 | OBJS += src/wps/upnp_xml.c |
| 544 | OBJS += src/wps/httpread.c |
| 545 | OBJS += src/wps/http_client.c |
| 546 | OBJS += src/wps/http_server.c |
| 547 | endif |
| 548 | |
| 549 | ifdef CONFIG_WPS_STRICT |
| 550 | L_CFLAGS += -DCONFIG_WPS_STRICT |
| 551 | OBJS += src/wps/wps_validate.c |
| 552 | endif |
| 553 | |
| 554 | ifdef CONFIG_WPS_TESTING |
| 555 | L_CFLAGS += -DCONFIG_WPS_TESTING |
| 556 | endif |
| 557 | |
| 558 | endif |
| 559 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 560 | ifdef CONFIG_DPP |
| 561 | L_CFLAGS += -DCONFIG_DPP |
| 562 | OBJS += src/common/dpp.c |
Hai Shalom | 4fbc08f | 2020-05-18 12:37:00 -0700 | [diff] [blame] | 563 | OBJS += src/common/dpp_auth.c |
| 564 | OBJS += src/common/dpp_backup.c |
| 565 | OBJS += src/common/dpp_crypto.c |
| 566 | OBJS += src/common/dpp_pkex.c |
| 567 | OBJS += src/common/dpp_reconfig.c |
| 568 | OBJS += src/common/dpp_tcp.c |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 569 | OBJS += src/ap/dpp_hostapd.c |
| 570 | OBJS += src/ap/gas_query_ap.c |
| 571 | NEED_AES_SIV=y |
| 572 | NEED_HMAC_SHA256_KDF=y |
| 573 | NEED_HMAC_SHA384_KDF=y |
| 574 | NEED_HMAC_SHA512_KDF=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 575 | NEED_SHA384=y |
| 576 | NEED_SHA512=y |
Hai Shalom | c356592 | 2019-10-28 11:58:20 -0700 | [diff] [blame] | 577 | NEED_ECC=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 578 | NEED_JSON=y |
| 579 | NEED_GAS=y |
| 580 | NEED_BASE64=y |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 581 | NEED_ASN1=y |
Hai Shalom | 021b0b5 | 2019-04-10 11:17:58 -0700 | [diff] [blame] | 582 | ifdef CONFIG_DPP2 |
| 583 | L_CFLAGS += -DCONFIG_DPP2 |
| 584 | endif |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 585 | endif |
| 586 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 587 | ifdef CONFIG_EAP_IKEV2 |
| 588 | L_CFLAGS += -DEAP_SERVER_IKEV2 |
| 589 | OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c |
| 590 | OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c |
| 591 | NEED_DH_GROUPS=y |
| 592 | NEED_DH_GROUPS_ALL=y |
| 593 | NEED_MODEXP=y |
| 594 | NEED_CIPHER=y |
| 595 | endif |
| 596 | |
| 597 | ifdef CONFIG_EAP_TNC |
| 598 | L_CFLAGS += -DEAP_SERVER_TNC |
| 599 | OBJS += src/eap_server/eap_server_tnc.c |
| 600 | OBJS += src/eap_server/tncs.c |
| 601 | NEED_BASE64=y |
| 602 | ifndef CONFIG_DRIVER_BSD |
| 603 | LIBS += -ldl |
| 604 | endif |
| 605 | endif |
| 606 | |
| 607 | # Basic EAP functionality is needed for EAPOL |
| 608 | OBJS += eap_register.c |
| 609 | OBJS += src/eap_server/eap_server.c |
| 610 | OBJS += src/eap_common/eap_common.c |
| 611 | OBJS += src/eap_server/eap_server_methods.c |
| 612 | OBJS += src/eap_server/eap_server_identity.c |
| 613 | L_CFLAGS += -DEAP_SERVER_IDENTITY |
| 614 | |
| 615 | ifdef CONFIG_EAP |
| 616 | L_CFLAGS += -DEAP_SERVER |
| 617 | endif |
| 618 | |
| 619 | ifdef CONFIG_PKCS12 |
| 620 | L_CFLAGS += -DPKCS12_FUNCS |
| 621 | endif |
| 622 | |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 623 | ifdef NEED_DRAGONFLY |
| 624 | OBJS += src/common/dragonfly.c |
| 625 | endif |
| 626 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 627 | ifdef MS_FUNCS |
| 628 | OBJS += src/crypto/ms_funcs.c |
| 629 | NEED_DES=y |
| 630 | NEED_MD4=y |
| 631 | endif |
| 632 | |
| 633 | ifdef CHAP |
| 634 | OBJS += src/eap_common/chap.c |
| 635 | endif |
| 636 | |
| 637 | ifdef TLS_FUNCS |
| 638 | NEED_DES=y |
| 639 | # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS) |
| 640 | L_CFLAGS += -DEAP_TLS_FUNCS |
| 641 | OBJS += src/eap_server/eap_server_tls_common.c |
| 642 | NEED_TLS_PRF=y |
| 643 | endif |
| 644 | |
| 645 | ifndef CONFIG_TLS |
| 646 | CONFIG_TLS=openssl |
| 647 | endif |
| 648 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 649 | ifdef CONFIG_TLSV11 |
| 650 | L_CFLAGS += -DCONFIG_TLSV11 |
| 651 | endif |
| 652 | |
| 653 | ifdef CONFIG_TLSV12 |
| 654 | L_CFLAGS += -DCONFIG_TLSV12 |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 655 | endif |
| 656 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 657 | ifeq ($(CONFIG_TLS), openssl) |
| 658 | ifdef TLS_FUNCS |
| 659 | OBJS += src/crypto/tls_openssl.c |
Dmitry Shmidt | d7ff03d | 2015-12-04 14:49:35 -0800 | [diff] [blame] | 660 | OBJS += src/crypto/tls_openssl_ocsp.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 661 | LIBS += -lssl |
| 662 | endif |
| 663 | OBJS += src/crypto/crypto_openssl.c |
| 664 | HOBJS += src/crypto/crypto_openssl.c |
| 665 | ifdef NEED_FIPS186_2_PRF |
| 666 | OBJS += src/crypto/fips_prf_openssl.c |
| 667 | endif |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 668 | NEED_TLS_PRF_SHA256=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 669 | LIBS += -lcrypto |
| 670 | LIBS_h += -lcrypto |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 671 | ifndef CONFIG_TLS_DEFAULT_CIPHERS |
| 672 | CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW" |
| 673 | endif |
| 674 | L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\" |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 675 | endif |
| 676 | |
| 677 | ifeq ($(CONFIG_TLS), gnutls) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 678 | ifndef CONFIG_CRYPTO |
| 679 | # default to libgcrypt |
| 680 | CONFIG_CRYPTO=gnutls |
| 681 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 682 | ifdef TLS_FUNCS |
| 683 | OBJS += src/crypto/tls_gnutls.c |
| 684 | LIBS += -lgnutls -lgpg-error |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 685 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 686 | OBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c |
| 687 | HOBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 688 | ifdef NEED_FIPS186_2_PRF |
Dmitry Shmidt | 9866086 | 2014-03-11 17:26:21 -0700 | [diff] [blame] | 689 | OBJS += src/crypto/fips_prf_internal.c |
| 690 | OBJS += src/crypto/sha1-internal.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 691 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 692 | ifeq ($(CONFIG_CRYPTO), gnutls) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 693 | LIBS += -lgcrypt |
| 694 | LIBS_h += -lgcrypt |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 695 | CONFIG_INTERNAL_RC4=y |
| 696 | CONFIG_INTERNAL_DH_GROUP5=y |
| 697 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 698 | ifeq ($(CONFIG_CRYPTO), nettle) |
| 699 | LIBS += -lnettle -lgmp |
| 700 | LIBS_p += -lnettle -lgmp |
| 701 | CONFIG_INTERNAL_RC4=y |
| 702 | CONFIG_INTERNAL_DH_GROUP5=y |
| 703 | endif |
| 704 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 705 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 706 | ifeq ($(CONFIG_TLS), internal) |
| 707 | ifndef CONFIG_CRYPTO |
| 708 | CONFIG_CRYPTO=internal |
| 709 | endif |
| 710 | ifdef TLS_FUNCS |
| 711 | OBJS += src/crypto/crypto_internal-rsa.c |
| 712 | OBJS += src/crypto/tls_internal.c |
| 713 | OBJS += src/tls/tlsv1_common.c |
| 714 | OBJS += src/tls/tlsv1_record.c |
| 715 | OBJS += src/tls/tlsv1_cred.c |
| 716 | OBJS += src/tls/tlsv1_server.c |
| 717 | OBJS += src/tls/tlsv1_server_write.c |
| 718 | OBJS += src/tls/tlsv1_server_read.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 719 | OBJS += src/tls/rsa.c |
| 720 | OBJS += src/tls/x509v3.c |
| 721 | OBJS += src/tls/pkcs1.c |
| 722 | OBJS += src/tls/pkcs5.c |
| 723 | OBJS += src/tls/pkcs8.c |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 724 | NEED_ASN1=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 725 | NEED_BASE64=y |
| 726 | NEED_TLS_PRF=y |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 727 | ifdef CONFIG_TLSV12 |
| 728 | NEED_TLS_PRF_SHA256=y |
| 729 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 730 | NEED_MODEXP=y |
| 731 | NEED_CIPHER=y |
| 732 | L_CFLAGS += -DCONFIG_TLS_INTERNAL |
| 733 | L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER |
| 734 | endif |
| 735 | ifdef NEED_CIPHER |
| 736 | NEED_DES=y |
| 737 | OBJS += src/crypto/crypto_internal-cipher.c |
| 738 | endif |
| 739 | ifdef NEED_MODEXP |
| 740 | OBJS += src/crypto/crypto_internal-modexp.c |
| 741 | OBJS += src/tls/bignum.c |
| 742 | endif |
| 743 | ifeq ($(CONFIG_CRYPTO), libtomcrypt) |
| 744 | OBJS += src/crypto/crypto_libtomcrypt.c |
| 745 | LIBS += -ltomcrypt -ltfm |
| 746 | LIBS_h += -ltomcrypt -ltfm |
| 747 | CONFIG_INTERNAL_SHA256=y |
| 748 | CONFIG_INTERNAL_RC4=y |
| 749 | CONFIG_INTERNAL_DH_GROUP5=y |
| 750 | endif |
| 751 | ifeq ($(CONFIG_CRYPTO), internal) |
| 752 | OBJS += src/crypto/crypto_internal.c |
| 753 | NEED_AES_DEC=y |
| 754 | L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL |
| 755 | ifdef CONFIG_INTERNAL_LIBTOMMATH |
| 756 | L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH |
| 757 | ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST |
| 758 | L_CFLAGS += -DLTM_FAST |
| 759 | endif |
| 760 | else |
| 761 | LIBS += -ltommath |
| 762 | LIBS_h += -ltommath |
| 763 | endif |
| 764 | CONFIG_INTERNAL_AES=y |
| 765 | CONFIG_INTERNAL_DES=y |
| 766 | CONFIG_INTERNAL_SHA1=y |
| 767 | CONFIG_INTERNAL_MD4=y |
| 768 | CONFIG_INTERNAL_MD5=y |
| 769 | CONFIG_INTERNAL_SHA256=y |
Dmitry Shmidt | d7ff03d | 2015-12-04 14:49:35 -0800 | [diff] [blame] | 770 | CONFIG_INTERNAL_SHA384=y |
| 771 | CONFIG_INTERNAL_SHA512=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 772 | CONFIG_INTERNAL_RC4=y |
| 773 | CONFIG_INTERNAL_DH_GROUP5=y |
| 774 | endif |
| 775 | ifeq ($(CONFIG_CRYPTO), cryptoapi) |
| 776 | OBJS += src/crypto/crypto_cryptoapi.c |
| 777 | OBJS_p += src/crypto/crypto_cryptoapi.c |
| 778 | L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI |
| 779 | CONFIG_INTERNAL_SHA256=y |
| 780 | CONFIG_INTERNAL_RC4=y |
| 781 | endif |
| 782 | endif |
| 783 | |
| 784 | ifeq ($(CONFIG_TLS), none) |
| 785 | ifdef TLS_FUNCS |
| 786 | OBJS += src/crypto/tls_none.c |
| 787 | L_CFLAGS += -DEAP_TLS_NONE |
| 788 | CONFIG_INTERNAL_AES=y |
| 789 | CONFIG_INTERNAL_SHA1=y |
| 790 | CONFIG_INTERNAL_MD5=y |
| 791 | endif |
| 792 | OBJS += src/crypto/crypto_none.c |
| 793 | OBJS_p += src/crypto/crypto_none.c |
| 794 | CONFIG_INTERNAL_SHA256=y |
| 795 | CONFIG_INTERNAL_RC4=y |
| 796 | endif |
| 797 | |
| 798 | ifndef TLS_FUNCS |
| 799 | OBJS += src/crypto/tls_none.c |
| 800 | ifeq ($(CONFIG_TLS), internal) |
| 801 | CONFIG_INTERNAL_AES=y |
| 802 | CONFIG_INTERNAL_SHA1=y |
| 803 | CONFIG_INTERNAL_MD5=y |
| 804 | CONFIG_INTERNAL_RC4=y |
| 805 | endif |
| 806 | endif |
| 807 | |
| 808 | AESOBJS = # none so far |
| 809 | ifdef CONFIG_INTERNAL_AES |
| 810 | AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c |
| 811 | endif |
| 812 | |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 813 | ifneq ($(CONFIG_TLS), openssl) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 814 | AESOBJS += src/crypto/aes-wrap.c |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 815 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 816 | ifdef NEED_AES_EAX |
| 817 | AESOBJS += src/crypto/aes-eax.c |
| 818 | NEED_AES_CTR=y |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 819 | endif |
| 820 | ifdef NEED_AES_SIV |
| 821 | AESOBJS += src/crypto/aes-siv.c |
| 822 | NEED_AES_CTR=y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 823 | endif |
| 824 | ifdef NEED_AES_CTR |
| 825 | AESOBJS += src/crypto/aes-ctr.c |
| 826 | endif |
| 827 | ifdef NEED_AES_ENCBLOCK |
| 828 | AESOBJS += src/crypto/aes-encblock.c |
| 829 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 830 | AESOBJS += src/crypto/aes-omac1.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 831 | ifdef NEED_AES_UNWRAP |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 832 | ifneq ($(CONFIG_TLS), openssl) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 833 | NEED_AES_DEC=y |
| 834 | AESOBJS += src/crypto/aes-unwrap.c |
| 835 | endif |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 836 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 837 | ifdef NEED_AES_CBC |
| 838 | NEED_AES_DEC=y |
Dmitry Shmidt | 912c6ec | 2015-03-30 13:16:51 -0700 | [diff] [blame] | 839 | ifneq ($(CONFIG_TLS), openssl) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 840 | AESOBJS += src/crypto/aes-cbc.c |
| 841 | endif |
Dmitry Shmidt | 912c6ec | 2015-03-30 13:16:51 -0700 | [diff] [blame] | 842 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 843 | ifdef NEED_AES_DEC |
| 844 | ifdef CONFIG_INTERNAL_AES |
| 845 | AESOBJS += src/crypto/aes-internal-dec.c |
| 846 | endif |
| 847 | endif |
| 848 | ifdef NEED_AES |
| 849 | OBJS += $(AESOBJS) |
| 850 | endif |
| 851 | |
| 852 | SHA1OBJS = |
| 853 | ifdef NEED_SHA1 |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 854 | ifneq ($(CONFIG_TLS), openssl) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 855 | ifneq ($(CONFIG_TLS), gnutls) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 856 | SHA1OBJS += src/crypto/sha1.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 857 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 858 | endif |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 859 | SHA1OBJS += src/crypto/sha1-prf.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 860 | ifdef CONFIG_INTERNAL_SHA1 |
| 861 | SHA1OBJS += src/crypto/sha1-internal.c |
| 862 | ifdef NEED_FIPS186_2_PRF |
| 863 | SHA1OBJS += src/crypto/fips_prf_internal.c |
| 864 | endif |
| 865 | endif |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 866 | ifneq ($(CONFIG_TLS), openssl) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 867 | SHA1OBJS += src/crypto/sha1-pbkdf2.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 868 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 869 | ifdef NEED_T_PRF |
| 870 | SHA1OBJS += src/crypto/sha1-tprf.c |
| 871 | endif |
| 872 | ifdef NEED_TLS_PRF |
| 873 | SHA1OBJS += src/crypto/sha1-tlsprf.c |
| 874 | endif |
| 875 | endif |
| 876 | |
| 877 | ifdef NEED_SHA1 |
| 878 | OBJS += $(SHA1OBJS) |
| 879 | endif |
| 880 | |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 881 | ifneq ($(CONFIG_TLS), openssl) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 882 | ifneq ($(CONFIG_TLS), gnutls) |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 883 | OBJS += src/crypto/md5.c |
| 884 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 885 | endif |
Dmitry Shmidt | aff761d | 2015-02-06 10:50:36 -0800 | [diff] [blame] | 886 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 887 | ifdef NEED_MD5 |
| 888 | ifdef CONFIG_INTERNAL_MD5 |
| 889 | OBJS += src/crypto/md5-internal.c |
| 890 | HOBJS += src/crypto/md5-internal.c |
| 891 | endif |
| 892 | endif |
| 893 | |
| 894 | ifdef NEED_MD4 |
| 895 | ifdef CONFIG_INTERNAL_MD4 |
| 896 | OBJS += src/crypto/md4-internal.c |
| 897 | endif |
| 898 | endif |
| 899 | |
| 900 | ifdef NEED_DES |
| 901 | ifdef CONFIG_INTERNAL_DES |
| 902 | OBJS += src/crypto/des-internal.c |
| 903 | endif |
| 904 | endif |
| 905 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 906 | ifdef CONFIG_NO_RC4 |
| 907 | L_CFLAGS += -DCONFIG_NO_RC4 |
| 908 | endif |
| 909 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 910 | ifdef NEED_RC4 |
| 911 | ifdef CONFIG_INTERNAL_RC4 |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 912 | ifndef CONFIG_NO_RC4 |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 913 | OBJS += src/crypto/rc4.c |
| 914 | endif |
| 915 | endif |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 916 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 917 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 918 | L_CFLAGS += -DCONFIG_SHA256 |
| 919 | ifneq ($(CONFIG_TLS), openssl) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 920 | ifneq ($(CONFIG_TLS), gnutls) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 921 | OBJS += src/crypto/sha256.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 922 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 923 | endif |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 924 | OBJS += src/crypto/sha256-prf.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 925 | ifdef CONFIG_INTERNAL_SHA256 |
| 926 | OBJS += src/crypto/sha256-internal.c |
| 927 | endif |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 928 | ifdef NEED_TLS_PRF_SHA256 |
| 929 | OBJS += src/crypto/sha256-tlsprf.c |
| 930 | endif |
Hai Shalom | c356592 | 2019-10-28 11:58:20 -0700 | [diff] [blame] | 931 | ifdef NEED_TLS_PRF_SHA384 |
| 932 | OBJS += src/crypto/sha384-tlsprf.c |
| 933 | endif |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 934 | ifdef NEED_HMAC_SHA256_KDF |
| 935 | OBJS += src/crypto/sha256-kdf.c |
| 936 | endif |
| 937 | ifdef NEED_HMAC_SHA384_KDF |
| 938 | OBJS += src/crypto/sha384-kdf.c |
| 939 | endif |
| 940 | ifdef NEED_HMAC_SHA512_KDF |
| 941 | OBJS += src/crypto/sha512-kdf.c |
| 942 | endif |
Dmitry Shmidt | 40b0720 | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 943 | ifdef NEED_SHA384 |
| 944 | L_CFLAGS += -DCONFIG_SHA384 |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 945 | ifneq ($(CONFIG_TLS), openssl) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 946 | ifneq ($(CONFIG_TLS), gnutls) |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 947 | OBJS += src/crypto/sha384.c |
| 948 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 949 | endif |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 950 | OBJS += src/crypto/sha384-prf.c |
Dmitry Shmidt | 40b0720 | 2015-01-27 13:40:23 -0800 | [diff] [blame] | 951 | endif |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 952 | ifdef NEED_SHA512 |
| 953 | L_CFLAGS += -DCONFIG_SHA512 |
| 954 | ifneq ($(CONFIG_TLS), openssl) |
| 955 | ifneq ($(CONFIG_TLS), linux) |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 956 | ifneq ($(CONFIG_TLS), gnutls) |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 957 | OBJS += src/crypto/sha512.c |
| 958 | endif |
| 959 | endif |
Roshan Pius | 3a1667e | 2018-07-03 15:17:14 -0700 | [diff] [blame] | 960 | endif |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 961 | OBJS += src/crypto/sha512-prf.c |
| 962 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 963 | |
Dmitry Shmidt | d7ff03d | 2015-12-04 14:49:35 -0800 | [diff] [blame] | 964 | ifdef CONFIG_INTERNAL_SHA384 |
| 965 | L_CFLAGS += -DCONFIG_INTERNAL_SHA384 |
| 966 | OBJS += src/crypto/sha384-internal.c |
| 967 | endif |
| 968 | |
| 969 | ifdef CONFIG_INTERNAL_SHA512 |
| 970 | L_CFLAGS += -DCONFIG_INTERNAL_SHA512 |
| 971 | OBJS += src/crypto/sha512-internal.c |
| 972 | endif |
| 973 | |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 974 | ifdef NEED_ASN1 |
| 975 | OBJS += src/tls/asn1.c |
| 976 | endif |
| 977 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 978 | ifdef NEED_DH_GROUPS |
| 979 | OBJS += src/crypto/dh_groups.c |
| 980 | endif |
| 981 | ifdef NEED_DH_GROUPS_ALL |
| 982 | L_CFLAGS += -DALL_DH_GROUPS |
| 983 | endif |
| 984 | ifdef CONFIG_INTERNAL_DH_GROUP5 |
| 985 | ifdef NEED_DH_GROUPS |
| 986 | OBJS += src/crypto/dh_group5.c |
| 987 | endif |
| 988 | endif |
| 989 | |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 990 | ifdef NEED_ECC |
| 991 | L_CFLAGS += -DCONFIG_ECC |
| 992 | endif |
| 993 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 994 | ifdef CONFIG_NO_RANDOM_POOL |
| 995 | L_CFLAGS += -DCONFIG_NO_RANDOM_POOL |
| 996 | else |
| 997 | OBJS += src/crypto/random.c |
| 998 | HOBJS += src/crypto/random.c |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 999 | HOBJS += src/utils/eloop.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1000 | HOBJS += $(SHA1OBJS) |
Dmitry Shmidt | dda10c2 | 2015-03-24 16:05:01 -0700 | [diff] [blame] | 1001 | ifneq ($(CONFIG_TLS), openssl) |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1002 | HOBJS += src/crypto/md5.c |
| 1003 | endif |
Dmitry Shmidt | dda10c2 | 2015-03-24 16:05:01 -0700 | [diff] [blame] | 1004 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1005 | |
| 1006 | ifdef CONFIG_RADIUS_SERVER |
| 1007 | L_CFLAGS += -DRADIUS_SERVER |
| 1008 | OBJS += src/radius/radius_server.c |
| 1009 | endif |
| 1010 | |
| 1011 | ifdef CONFIG_IPV6 |
| 1012 | L_CFLAGS += -DCONFIG_IPV6 |
| 1013 | endif |
| 1014 | |
| 1015 | ifdef CONFIG_DRIVER_RADIUS_ACL |
| 1016 | L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL |
| 1017 | endif |
| 1018 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1019 | ifdef NEED_BASE64 |
| 1020 | OBJS += src/utils/base64.c |
| 1021 | endif |
| 1022 | |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 1023 | ifdef NEED_JSON |
| 1024 | OBJS += src/utils/json.c |
| 1025 | L_CFLAGS += -DCONFIG_JSON |
| 1026 | endif |
| 1027 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1028 | ifdef NEED_AP_MLME |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1029 | OBJS += src/ap/wmm.c |
| 1030 | OBJS += src/ap/ap_list.c |
| 1031 | OBJS += src/ap/ieee802_11.c |
| 1032 | OBJS += src/ap/hw_features.c |
Dmitry Shmidt | 051af73 | 2013-10-22 13:52:46 -0700 | [diff] [blame] | 1033 | OBJS += src/ap/dfs.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1034 | L_CFLAGS += -DNEED_AP_MLME |
| 1035 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1036 | OBJS += src/ap/ieee802_11_ht.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1037 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 1038 | ifdef CONFIG_IEEE80211AC |
| 1039 | OBJS += src/ap/ieee802_11_vht.c |
| 1040 | endif |
| 1041 | |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 1042 | ifdef CONFIG_IEEE80211AX |
| 1043 | OBJS += src/ap/ieee802_11_he.c |
| 1044 | endif |
| 1045 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1046 | ifdef CONFIG_P2P_MANAGER |
| 1047 | L_CFLAGS += -DCONFIG_P2P_MANAGER |
| 1048 | OBJS += src/ap/p2p_hostapd.c |
| 1049 | endif |
| 1050 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 1051 | ifdef CONFIG_HS20 |
| 1052 | L_CFLAGS += -DCONFIG_HS20 |
| 1053 | OBJS += src/ap/hs20.c |
| 1054 | CONFIG_INTERWORKING=y |
| 1055 | endif |
| 1056 | |
| 1057 | ifdef CONFIG_INTERWORKING |
| 1058 | L_CFLAGS += -DCONFIG_INTERWORKING |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 1059 | NEED_GAS=y |
| 1060 | endif |
| 1061 | |
| 1062 | ifdef NEED_GAS |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 1063 | OBJS += src/common/gas.c |
| 1064 | OBJS += src/ap/gas_serv.c |
| 1065 | endif |
| 1066 | |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 1067 | ifdef CONFIG_PROXYARP |
| 1068 | L_CFLAGS += -DCONFIG_PROXYARP |
| 1069 | OBJS += src/ap/x_snoop.c |
| 1070 | OBJS += src/ap/dhcp_snoop.c |
| 1071 | ifdef CONFIG_IPV6 |
| 1072 | OBJS += src/ap/ndisc_snoop.c |
| 1073 | endif |
| 1074 | endif |
| 1075 | |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 1076 | OBJS += src/drivers/driver_common.c |
| 1077 | |
Dmitry Shmidt | 5460547 | 2013-11-08 11:10:19 -0800 | [diff] [blame] | 1078 | ifdef CONFIG_ACS |
| 1079 | L_CFLAGS += -DCONFIG_ACS |
| 1080 | OBJS += src/ap/acs.c |
| 1081 | LIBS += -lm |
| 1082 | endif |
| 1083 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1084 | ifdef CONFIG_NO_STDOUT_DEBUG |
| 1085 | L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG |
| 1086 | endif |
| 1087 | |
Paul Stewart | 092955c | 2017-02-06 09:13:09 -0800 | [diff] [blame] | 1088 | ifdef CONFIG_DEBUG_SYSLOG |
| 1089 | L_CFLAGS += -DCONFIG_DEBUG_SYSLOG |
| 1090 | endif |
| 1091 | |
Dmitry Shmidt | 5460547 | 2013-11-08 11:10:19 -0800 | [diff] [blame] | 1092 | ifdef CONFIG_DEBUG_LINUX_TRACING |
| 1093 | L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING |
| 1094 | endif |
| 1095 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1096 | ifdef CONFIG_DEBUG_FILE |
| 1097 | L_CFLAGS += -DCONFIG_DEBUG_FILE |
| 1098 | endif |
| 1099 | |
| 1100 | ifdef CONFIG_ANDROID_LOG |
| 1101 | L_CFLAGS += -DCONFIG_ANDROID_LOG |
| 1102 | endif |
| 1103 | |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 1104 | OBJS_c = hostapd_cli.c |
| 1105 | OBJS_c += src/common/wpa_ctrl.c |
| 1106 | OBJS_c += src/utils/os_$(CONFIG_OS).c |
| 1107 | OBJS_c += src/common/cli.c |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 1108 | OBJS_c += src/utils/eloop.c |
Dmitry Shmidt | a3dc309 | 2015-06-23 11:21:28 -0700 | [diff] [blame] | 1109 | OBJS_c += src/utils/common.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1110 | ifdef CONFIG_WPA_TRACE |
| 1111 | OBJS_c += src/utils/trace.c |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 1112 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1113 | OBJS_c += src/utils/wpa_debug.c |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 1114 | ifdef CONFIG_WPA_CLI_EDIT |
| 1115 | OBJS_c += src/utils/edit.c |
| 1116 | else |
| 1117 | OBJS_c += src/utils/edit_simple.c |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1118 | endif |
| 1119 | |
Bjoern Johansson | 05c7f27 | 2018-05-15 14:58:52 -0700 | [diff] [blame] | 1120 | ifeq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),) |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1121 | ifdef CONFIG_CTRL_IFACE_HIDL |
| 1122 | HOSTAPD_USE_HIDL=y |
| 1123 | L_CFLAGS += -DCONFIG_CTRL_IFACE_HIDL |
| 1124 | L_CPPFLAGS = -Wall -Werror |
| 1125 | endif |
Roshan Pius | 35ecec4 | 2018-01-16 17:49:00 -0800 | [diff] [blame] | 1126 | endif |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1127 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1128 | ######################## |
| 1129 | |
| 1130 | include $(CLEAR_VARS) |
| 1131 | LOCAL_MODULE := hostapd_cli |
Po-Chien Hsueh | 2051e4b | 2017-02-10 11:34:58 +0800 | [diff] [blame] | 1132 | LOCAL_PROPRIETARY_MODULE := true |
Ying Wang | e93dd11 | 2013-04-09 21:53:29 -0700 | [diff] [blame] | 1133 | LOCAL_SHARED_LIBRARIES := libc libcutils liblog |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1134 | LOCAL_CFLAGS := $(L_CFLAGS) |
| 1135 | LOCAL_SRC_FILES := $(OBJS_c) |
| 1136 | LOCAL_C_INCLUDES := $(INCLUDES) |
| 1137 | include $(BUILD_EXECUTABLE) |
| 1138 | |
| 1139 | ######################## |
| 1140 | include $(CLEAR_VARS) |
| 1141 | LOCAL_MODULE := hostapd |
| 1142 | LOCAL_MODULE_TAGS := optional |
Po-Chien Hsueh | 2051e4b | 2017-02-10 11:34:58 +0800 | [diff] [blame] | 1143 | LOCAL_PROPRIETARY_MODULE := true |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1144 | LOCAL_MODULE_RELATIVE_PATH := hw |
Ahmed ElArabawy | 1832fd3 | 2019-12-05 20:12:54 -0800 | [diff] [blame] | 1145 | LOCAL_VINTF_FRAGMENTS := android.hardware.wifi.hostapd.xml |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1146 | ifdef CONFIG_DRIVER_CUSTOM |
| 1147 | LOCAL_STATIC_LIBRARIES := libCustomWifi |
| 1148 | endif |
| 1149 | ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),) |
| 1150 | LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB) |
| 1151 | endif |
Ying Wang | e93dd11 | 2013-04-09 21:53:29 -0700 | [diff] [blame] | 1152 | LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1153 | ifdef CONFIG_DRIVER_NL80211 |
Dmitry Shmidt | cd44645 | 2014-02-18 16:03:35 -0800 | [diff] [blame] | 1154 | ifneq ($(wildcard external/libnl),) |
Dmitry Shmidt | d620e6d | 2014-02-18 11:07:59 -0800 | [diff] [blame] | 1155 | LOCAL_SHARED_LIBRARIES += libnl |
Dmitry Shmidt | cd44645 | 2014-02-18 16:03:35 -0800 | [diff] [blame] | 1156 | else |
| 1157 | LOCAL_STATIC_LIBRARIES += libnl_2 |
| 1158 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1159 | endif |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1160 | ifeq ($(HOSTAPD_USE_HIDL), y) |
| 1161 | LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.0 |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 1162 | LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.1 |
lesl | 1a842e6 | 2019-12-02 19:00:37 +0800 | [diff] [blame] | 1163 | LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.2 |
lesl | f8b1b40 | 2020-08-04 17:09:39 +0800 | [diff] [blame] | 1164 | LOCAL_SHARED_LIBRARIES += android.hardware.wifi.hostapd@1.3 |
Steven Moreland | 423bc96 | 2019-10-04 10:29:53 -0700 | [diff] [blame] | 1165 | LOCAL_SHARED_LIBRARIES += libbase libhidlbase libutils |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1166 | LOCAL_STATIC_LIBRARIES += libhostapd_hidl |
| 1167 | endif |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1168 | LOCAL_CFLAGS := $(L_CFLAGS) |
| 1169 | LOCAL_SRC_FILES := $(OBJS) |
| 1170 | LOCAL_C_INCLUDES := $(INCLUDES) |
Christopher Wiley | 5ec9510 | 2016-07-13 10:34:47 -0700 | [diff] [blame] | 1171 | LOCAL_INIT_RC := hostapd.android.rc |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1172 | include $(BUILD_EXECUTABLE) |
| 1173 | |
Bjoern Johansson | 05c7f27 | 2018-05-15 14:58:52 -0700 | [diff] [blame] | 1174 | ######################## |
| 1175 | include $(CLEAR_VARS) |
| 1176 | LOCAL_MODULE := hostapd_nohidl |
| 1177 | LOCAL_MODULE_TAGS := optional |
| 1178 | LOCAL_PROPRIETARY_MODULE := true |
| 1179 | ifdef CONFIG_DRIVER_CUSTOM |
| 1180 | LOCAL_STATIC_LIBRARIES := libCustomWifi |
| 1181 | endif |
| 1182 | ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),) |
| 1183 | LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB) |
| 1184 | endif |
| 1185 | LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl |
| 1186 | ifdef CONFIG_DRIVER_NL80211 |
| 1187 | ifneq ($(wildcard external/libnl),) |
| 1188 | LOCAL_SHARED_LIBRARIES += libnl |
| 1189 | else |
| 1190 | LOCAL_STATIC_LIBRARIES += libnl_2 |
| 1191 | endif |
| 1192 | endif |
| 1193 | LOCAL_CFLAGS := $(patsubst -DCONFIG_CTRL_IFACE_HIDL,,$(L_CFLAGS)) |
| 1194 | LOCAL_SRC_FILES := $(OBJS) |
| 1195 | LOCAL_C_INCLUDES := $(INCLUDES) |
| 1196 | include $(BUILD_EXECUTABLE) |
| 1197 | |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1198 | ifeq ($(HOSTAPD_USE_HIDL), y) |
| 1199 | ### Hidl service library ### |
| 1200 | ######################## |
| 1201 | include $(CLEAR_VARS) |
| 1202 | LOCAL_MODULE := libhostapd_hidl |
| 1203 | LOCAL_VENDOR_MODULE := true |
| 1204 | LOCAL_CPPFLAGS := $(L_CPPFLAGS) |
| 1205 | LOCAL_CFLAGS := $(L_CFLAGS) |
| 1206 | LOCAL_C_INCLUDES := $(INCLUDES) |
lesl | f8b1b40 | 2020-08-04 17:09:39 +0800 | [diff] [blame] | 1207 | HIDL_INTERFACE_VERSION = 1.3 |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1208 | LOCAL_SRC_FILES := \ |
| 1209 | hidl/$(HIDL_INTERFACE_VERSION)/hidl.cpp \ |
| 1210 | hidl/$(HIDL_INTERFACE_VERSION)/hostapd.cpp |
| 1211 | LOCAL_SHARED_LIBRARIES := \ |
| 1212 | android.hardware.wifi.hostapd@1.0 \ |
Roshan Pius | e2d2101 | 2018-08-17 11:22:06 -0700 | [diff] [blame] | 1213 | android.hardware.wifi.hostapd@1.1 \ |
lesl | 1a842e6 | 2019-12-02 19:00:37 +0800 | [diff] [blame] | 1214 | android.hardware.wifi.hostapd@1.2 \ |
lesl | f8b1b40 | 2020-08-04 17:09:39 +0800 | [diff] [blame] | 1215 | android.hardware.wifi.hostapd@1.3 \ |
Roshan Pius | 30b452e | 2017-12-27 13:36:21 -0800 | [diff] [blame] | 1216 | libbase \ |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1217 | libhidlbase \ |
Roshan Pius | cc81756 | 2017-12-22 14:45:05 -0800 | [diff] [blame] | 1218 | libutils \ |
| 1219 | liblog |
| 1220 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
| 1221 | $(LOCAL_PATH)/hidl/$(HIDL_INTERFACE_VERSION) |
| 1222 | include $(BUILD_STATIC_LIBRARY) |
| 1223 | endif # HOSTAPD_USE_HIDL == y |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1224 | endif # ifeq ($(WPA_BUILD_HOSTAPD),true) |