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

Inconsistency between PersistentStorageDelegate::SyncGetKeyValue and KeyValueStoreManager #20163

Closed
tehampson opened this issue Jun 30, 2022 · 0 comments · Fixed by #20164
Closed
Assignees
Labels

Comments

@tehampson
Copy link
Contributor

Problem

  • Some implementation of PersistentStorageDelegate use KeyValueStoreManager which is not capable of giving the size of for the time being, which makes this obligation of SyncGetKeyValue impossible.
    • After performing a code audit no one is currently using the functionality to get the size, so this change is safe, but we need platforms to adhear to the this updated description.
  • PersistentStorageDelegate::SyncGetKeyValue should fill up the buffer up to size when CHIP_ERROR_BUFFER_TOO_SMALL is returned
    • This allows cases where fw downgrade happens (due to OTA revert, security reason, or any other reason) to be able to read initial part of potentially critical data (assuming that data is stored in TLV format where structure of TLV is only ever expanded)

Proposed Solution

  • Change PersistentStorageDelegate::SyncGetKeyValue API documentation such that we fill up the buffer as much as we can and no longer provide size of the buffer needed when returning CHIP_ERROR_BUFFER_TOO_SMALL
@tehampson tehampson self-assigned this Jun 30, 2022
@tcarmelveilleux tcarmelveilleux changed the title Inconsistency between PersistentStorageDelegate::SyncGetKeyValue and Inconsistency between PersistentStorageDelegate::SyncGetKeyValue and KeyValueStoreManager Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants