mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-26 10:47:23 +00:00
mesh: Provisioning: Reject identical random
Adds check for provisioning random values that are identical to our own, and terminates the provisioning procedure. this is port of fc4fe09966059e79182279da5d8dd4348f5b513d
This commit is contained in:
committed by
Łukasz Rymanowski
parent
f0a80d06e8
commit
bf4560e454
@@ -919,6 +919,12 @@ static void prov_random(const uint8_t *data)
|
||||
|
||||
BT_DBG("Remote Random: %s", bt_hex(data, 16));
|
||||
|
||||
if (!memcmp(data, link.rand, 16)) {
|
||||
BT_ERR("Random value is identical to ours, rejecting.");
|
||||
prov_fail(PROV_ERR_CFM_FAILED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bt_mesh_prov_conf(link.conf_key, data, link.auth, conf_verify)) {
|
||||
BT_ERR("Unable to calculate confirmation verification");
|
||||
prov_fail(PROV_ERR_UNEXP_ERR);
|
||||
|
||||
Reference in New Issue
Block a user