mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
mesh: bump mesh network key version if key with same netkey index already exists
This commit is contained in:
parent
c82bae6612
commit
b0a92bc4f6
@ -845,6 +845,11 @@ static void config_netkey_add_handler(mesh_model_t * mesh_model, mesh_pdu_t * pd
|
||||
new_network_key->internal_index = internal_index;
|
||||
new_network_key->netkey_index = new_netkey_index;
|
||||
memcpy(new_network_key->net_key, new_netkey, 16);
|
||||
// update version if key with same netkey index exists
|
||||
mesh_network_key_t * old_key = mesh_network_key_list_get(new_netkey_index);
|
||||
if (old_key){
|
||||
new_network_key->version = (uint8_t) (old_key->version + 1);
|
||||
}
|
||||
mesh_network_key_derive(&configuration_server_cmac_request, new_network_key, config_netkey_add_or_update_derived, new_network_key);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user