Skip to content

Commit 10ef3b4

Browse files
alxelaxcarlescufi
authored andcommitted
Bluetooth: Mesh: fix provisionee public key usage
Provisionee shall fail if provisioner sent public key identicall to OOB public key back. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent 3bef10f commit 10ef3b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

subsys/bluetooth/mesh/prov_device.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@ static void prov_pub_key(const uint8_t *data)
357357
return;
358358
}
359359

360+
if (!memcmp(bt_mesh_prov->public_key_be,
361+
bt_mesh_prov_link.conf_inputs.pub_key_provisioner, PDU_LEN_PUB_KEY)) {
362+
LOG_ERR("Public keys are identical");
363+
prov_fail(PROV_ERR_NVAL_FMT);
364+
return;
365+
}
366+
360367
/* No swap needed since user provides public key in big-endian */
361368
memcpy(bt_mesh_prov_link.conf_inputs.pub_key_device, bt_mesh_prov->public_key_be,
362369
PDU_LEN_PUB_KEY);

0 commit comments

Comments
 (0)