Skip to content

Commit fc4fe09

Browse files
trond-snekvikMaureenHelm
authored andcommitted
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 <[email protected]>
1 parent e363dec commit fc4fe09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subsys/bluetooth/mesh/prov.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,12 @@ static void prov_random(const uint8_t *data)
905905

906906
BT_DBG("Remote Random: %s", bt_hex(data, 16));
907907

908+
if (!memcmp(data, link.rand, 16)) {
909+
BT_ERR("Random value is identical to ours, rejecting.");
910+
prov_fail(PROV_ERR_CFM_FAILED);
911+
return;
912+
}
913+
908914
if (bt_mesh_prov_conf(link.conf_key, data, link.auth, conf_verify)) {
909915
BT_ERR("Unable to calculate confirmation verification");
910916
prov_fail(PROV_ERR_UNEXP_ERR);

0 commit comments

Comments
 (0)