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