kv_config: create an internal TDB to store DeviceKey Root of Trust #13986
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Fixes: #11788
Without this PR, an internal TDBStore is created for the use of KV Global API only when Rollback Protection (RBP) is enabled, to store CMAC data used for Rollback checks. It's not created when Rollback Protection is disabled, but we still need one in order to store the DeviceKey Root of Trust (RoT) for
SecureStore
's basic encryption. The lack of an internal TDBStore leads toDEVICEKEY_SAVE_FAILED
error inDeviceKey::write_key_to_kvstore()
:mbed-os/drivers/device_key/source/DeviceKey.cpp
Lines 127 to 131 in 33a7e66
This happens when
storage.storage_type
is configured toTDB_EXTERNAL_NO_RBP
orFILESYSTEM_NO_RBP
, both of which are based onSecureStore
. To fix the issue, this PR creates an internal TDBStore of the default/auto-calculated size.Impact of changes
With
storage.storage_type
configured toTDB_EXTERNAL_NO_RBP
orFILESYSTEM_NO_RBP
, generated DeviceKey RoT can now be stored successfully, allowing KV global API (e.g.kv_set()
) to function properly.Migration actions required
None.
Documentation
None.
Pull request type
Test results
Reviewers
@ARMmbed/mbed-os-core