Skip to content

Commit 69e8c4a

Browse files
committed
Merge branch 'bugfix/add_aa_check_on_esp32c2_and_esp32c6_v5.3' into 'release/v5.3'
Bugfix/add aa check on esp32c2 and esp32c6 (v5.3) See merge request espressif/esp-idf!35233
2 parents 3a3396d + f776fa7 commit 69e8c4a

File tree

8 files changed

+42
-7
lines changed

8 files changed

+42
-7
lines changed

components/bt/controller/esp32c6/Kconfig.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,11 @@ config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
689689
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
690690
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
691691
default 0
692+
693+
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
694+
bool "Enable enhanced Access Address check in CONNECT_IND"
695+
default n
696+
help
697+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
698+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
699+
If disabled, only basic checks are applied, improving compatibility.

components/bt/controller/esp32c6/esp_bt_cfg.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ extern "C" {
148148

149149
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
150150

151+
#ifdef CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
152+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS)
153+
#else
154+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
155+
#endif
156+
151157
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
152158
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
153159
#else
@@ -218,7 +224,6 @@ extern "C" {
218224

219225
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
220226

221-
222227
#define RUN_BQB_TEST (0)
223228
#define RUN_QA_TEST (0)
224229
#define NIMBLE_DISABLE_SCAN_BACKOFF (0)

components/bt/controller/esp32h2/Kconfig.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,3 +690,11 @@ config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
690690
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
691691
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
692692
default 0
693+
694+
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
695+
bool "Enable enhanced Access Address check in CONNECT_IND"
696+
default n
697+
help
698+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
699+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
700+
If disabled, only basic checks are applied, improving compatibility.

components/bt/controller/esp32h2/esp_bt_cfg.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ extern "C" {
148148

149149
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
150150

151+
#ifdef CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
152+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (CONFIG_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS)
153+
#else
154+
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
155+
#endif
156+
151157
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
152158
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
153159
#else

components/bt/include/esp32c6/include/esp_bt.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
156156
*/
157157
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
158158

159-
#define CONFIG_VERSION 0x20240422
159+
#define CONFIG_VERSION 0x20241121
160160
#define CONFIG_MAGIC 0x5A5AA5A5
161161

162162
/**
@@ -211,6 +211,8 @@ typedef struct {
211211
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the whitelist for direct advertising */
212212
uint8_t enable_pcl; /*!< Enable power control */
213213
uint8_t csa2_select; /*!< Select CSA#2*/
214+
uint8_t enable_csr; /*!< Enable CSR */
215+
uint8_t ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
214216
uint32_t config_magic; /*!< Magic number for configuration validation */
215217
} esp_bt_controller_config_t;
216218

@@ -259,6 +261,8 @@ typedef struct {
259261
.ignore_wl_for_direct_adv = 0, \
260262
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
261263
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
264+
.enable_csr = 0, \
265+
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
262266
.config_magic = CONFIG_MAGIC, \
263267
}
264268

components/bt/include/esp32h2/include/esp_bt.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
161161
*/
162162
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
163163

164-
#define CONFIG_VERSION 0x20240422
164+
#define CONFIG_VERSION 0x20241121
165165
#define CONFIG_MAGIC 0x5A5AA5A5
166166

167167
/**
@@ -214,7 +214,9 @@ typedef struct {
214214
uint8_t cpu_freq_mhz; /*!< CPU frequency in megahertz */
215215
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the white list for directed advertising */
216216
uint8_t enable_pcl; /*!< Enable power control */
217-
uint8_t csa2_select; /*!< Select CSA#2*/
217+
uint8_t csa2_select; /*!< Select CSA#2*/
218+
uint8_t enable_csr; /*!< Enable CSR */
219+
uint8_t ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
218220
uint32_t config_magic; /*!< Configuration magic value */
219221
} esp_bt_controller_config_t;
220222

@@ -262,7 +264,9 @@ typedef struct {
262264
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
263265
.ignore_wl_for_direct_adv = 0, \
264266
.enable_pcl = 0, \
265-
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
267+
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
268+
.enable_csr = 0, \
269+
.ble_aa_check = DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS, \
266270
.config_magic = CONFIG_MAGIC, \
267271
}
268272

0 commit comments

Comments
 (0)