Skip to content

Commit f01dc5d

Browse files
Michał Narajowskitrond-snekvik
authored andcommitted
[nrf fromtree] Bluetooth: mesh: Fail provisioning when RFU values are
...used When Public Key field is set to RFU value then we should send Provisioning Fail with Invalid Format error. Signed-off-by: Michał Narajowski <[email protected]> (cherry picked from commit f51cf9a) Signed-off-by: Trond Einar Snekvik <[email protected]>
1 parent f19ebe4 commit f01dc5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subsys/bluetooth/mesh/prov_device.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ static void prov_start(const uint8_t *data)
137137
return;
138138
}
139139

140-
if (data[1] == PUB_KEY_OOB &&
141-
!(IS_ENABLED(CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY) &&
142-
bt_mesh_prov->public_key_be)) {
140+
if (data[1] > PUB_KEY_OOB ||
141+
(data[1] == PUB_KEY_OOB &&
142+
(!IS_ENABLED(CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY) || !bt_mesh_prov->public_key_be))) {
143143
BT_ERR("Invalid public key type: 0x%02x", data[1]);
144144
prov_fail(PROV_ERR_NVAL_FMT);
145145
return;

0 commit comments

Comments
 (0)