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