mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-12 12:10:03 +00:00
mesh: Fix restore when revoke keys
Store keys again after revokes keys this is port of 8c71de24a5060d335f8ece10117218c721973167
This commit is contained in:
committed by
Łukasz Rymanowski
parent
7b15f67b45
commit
05b30afd4a
@@ -476,6 +476,10 @@ void bt_mesh_net_revoke_keys(struct bt_mesh_subnet *sub)
|
||||
BT_DBG("idx 0x%04x", sub->net_idx);
|
||||
|
||||
memcpy(&sub->keys[0], &sub->keys[1], sizeof(sub->keys[0]));
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||
BT_DBG("Storing Updated NetKey persistently");
|
||||
bt_mesh_store_subnet(sub);
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(bt_mesh.app_keys); i++) {
|
||||
struct bt_mesh_app_key *key = &bt_mesh.app_keys[i];
|
||||
@@ -486,6 +490,10 @@ void bt_mesh_net_revoke_keys(struct bt_mesh_subnet *sub)
|
||||
|
||||
memcpy(&key->keys[0], &key->keys[1], sizeof(key->keys[0]));
|
||||
key->updated = false;
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||
BT_DBG("Storing Updated AppKey persistently");
|
||||
bt_mesh_store_app_key(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user