Bluetooth: Mesh: Provisioning: Reject identical random
Adds check for provisioning random values that are identical to our own, and terminates the provisioning procedure. Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
parent
e363decf1c
commit
fc4fe09966
1 changed files with 6 additions and 0 deletions
|
@ -905,6 +905,12 @@ static void prov_random(const uint8_t *data)
|
||||||
|
|
||||||
BT_DBG("Remote Random: %s", bt_hex(data, 16));
|
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)) {
|
if (bt_mesh_prov_conf(link.conf_key, data, link.auth, conf_verify)) {
|
||||||
BT_ERR("Unable to calculate confirmation verification");
|
BT_ERR("Unable to calculate confirmation verification");
|
||||||
prov_fail(PROV_ERR_UNEXP_ERR);
|
prov_fail(PROV_ERR_UNEXP_ERR);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue