diff --git a/subsys/bluetooth/mesh/prov_device.c b/subsys/bluetooth/mesh/prov_device.c index fe861ee155..2bba13aa64 100644 --- a/subsys/bluetooth/mesh/prov_device.c +++ b/subsys/bluetooth/mesh/prov_device.c @@ -137,9 +137,9 @@ static void prov_start(const uint8_t *data) return; } - if (data[1] == PUB_KEY_OOB && - !(IS_ENABLED(CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY) && - bt_mesh_prov->public_key_be)) { + if (data[1] > PUB_KEY_OOB || + (data[1] == PUB_KEY_OOB && + (!IS_ENABLED(CONFIG_BT_MESH_PROV_OOB_PUBLIC_KEY) || !bt_mesh_prov->public_key_be))) { BT_ERR("Invalid public key type: 0x%02x", data[1]); prov_fail(PROV_ERR_NVAL_FMT); return;