Merge branch 'bugfix/sig_ble_mesh_errata_e16350_v4.3' into 'release/v4.3'

ble_mesh: stack: Apply the errata E16350 from Bluetooth SIG (v4.3)

See merge request espressif/esp-idf!15784
pull/7964/head
Jiang Jiang Jian 2021-11-23 06:30:46 +00:00
commit e8153a3cd5
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -840,6 +840,7 @@ static void prov_start(const uint8_t *data)
static void send_confirm(void)
{
uint8_t *local_conf = NULL;
PROV_BUF(cfm, 17);
BT_DBG("ConfInputs[0] %s", bt_hex(link.conf_inputs, 64));
@ -872,13 +873,21 @@ static void send_confirm(void)
prov_buf_init(&cfm, PROV_CONFIRM);
local_conf = net_buf_simple_add(&cfm, 16);
if (bt_mesh_prov_conf(link.conf_key, link.rand, link.auth,
net_buf_simple_add(&cfm, 16))) {
local_conf)) {
BT_ERR("Unable to generate confirmation value");
prov_send_fail_msg(PROV_ERR_UNEXP_ERR);
return;
}
if (!memcmp(link.conf, local_conf, 16)) {
BT_ERR("Confirmation value is identical to ours, rejecting.");
prov_send_fail_msg(PROV_ERR_NVAL_FMT);
return;
}
if (prov_send(&cfm)) {
BT_ERR("Unable to send Provisioning Confirm");
return;