Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Mesh: instantiate cdb and core keys #59816

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

alxelax
Copy link
Collaborator

@alxelax alxelax commented Jun 28, 2023

PR instantiates cdb and core keys to prevent scenario when key is changed over cdb APIand gets new ID but core still operates with old ID(potentially invalid).

Known issue the keys will be desynchronized during\after key refresh procedure.

subsys/bluetooth/mesh/app_keys.c Outdated Show resolved Hide resolved
subsys/bluetooth/mesh/main.c Outdated Show resolved Hide resolved
PavelVPV
PavelVPV previously approved these changes Jun 29, 2023
@Andrewpini
Copy link
Collaborator

Minor nitpick: there is a typo in the commit message "APIand" where I belive there is missing a space char. No big deal, up to you if you want to fix it.

@@ -101,16 +102,15 @@ int bt_mesh_provision(const uint8_t net_key[16], uint16_t net_idx,
subnet->kr_phase = BT_MESH_KR_NORMAL;
}

/* The network key has already been existed. Importing leaves it 'as is'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* The network key has already been existed. Importing leaves it 'as is'
/* The network key has already been exported. Importing leaves it 'as is'

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't exported. The primary network key is imported during cdb creation. Never mind, I'll clarify it.

Comment on lines 106 to 108
* if key is the same. Otherwise, cdb replaces the old one by the new one.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* if key is the same. Otherwise, cdb replaces the old one by the new one.
*/
* if the key is the same. Otherwise, cdb replaces the old one with the new one.
*/

PR instantiates cdb and core keys to prevent scenario
when key is changed over cdb API and gets new ID but
core still operates with old ID(potentially invalid).

Known issue the keys will be desynchronized
during\after key refresh procedure.

Signed-off-by: Aleksandr Khromykh <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 25bfbb1 into zephyrproject-rtos:main Jul 4, 2023
17 checks passed
@alxelax alxelax deleted the optomize_cdb_psa branch July 4, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants