-
Notifications
You must be signed in to change notification settings - Fork 3k
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
PSA ITS update #9192
PSA ITS update #9192
Conversation
@orenc17, thank you for your changes. |
#define PSA_ITS_ERROR_BAD_POINTER 5 /**< The operation failed because one of the provided pointers is invalid, for example is `NULL` or references memory the caller cannot access */ | ||
#define PSA_ITS_ERROR_KEY_NOT_FOUND 6 /**< The operation failed because the provided key value was not found in the storage */ | ||
#define PSA_ITS_ERROR_INCORRECT_SIZE 7 /**< The operation failed because the data associated with provided key is not the same size as `data_size`, or `offset+data_size` is too large for the data, but `offset` is less than the size */ | ||
#define PSA_ITS_ERROR_OFFSET_INVALID 8 /**< The operation failed because an offset was supplied that is invalid for the existing data associated with the uid. For example, offset is greater that the size of the data */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna say here what I said in the PSA API repo: Some of the return codes here make the implementation inefficient. For instance, PSA_ITS_ERROR_OFFSET_INVALID
imposes a redundant get_info
call before get
. I think that if we already have a breaking change, then we should revise the entire error codes list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @dreemkiller
@davidsaada change requests better be sent via our spec repo.
This PR implements aggregated spec changes till now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented in the spec repo as well (to the PR opened by @orenc17). My comment's aim here is to stress that a review to this PR won't be full until we sort out the changes to the error code list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please post a URL to your issue here?
It will allow us to keep track of it.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a general comment in the PR #22 of the spec repo. I didn't elaborate regarding the problems, but they are mainly in the get implementation. I think that PSA_ITS_ERROR_OFFSET_INVALID
return code is not required and that PSA_ITS_ERROR_INCORRECT_SIZE
is already tested by KVStore, so no need to make the checks again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ITS version used to store the file should be preserved. The reason for adding it was allowing future migrations between ITS versions.
I think it is better to save ITS version in flash and verify it upon first initialization.
@davidsaada @dreemkiller may I get your opinion on this?
Test run: FAILEDSummary: 3 of 7 test jobs failed Failed test jobs:
|
its_version_t version = { 0, 0 }; | ||
size_t actual_size = 0; | ||
KVStore::info_t kv_info; | ||
int status = kvstore->get_info(ITS_VERSION_KEY, &kv_info); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the call to kvstore->get_info
really required?
it seems that we can deduce this info from kvstore->get
return code and actual size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just making sure that no one is trying to fake the size of the key
version.minor = PSA_ITS_API_VERSION_MINOR; | ||
} | ||
|
||
if (kvstore->set(ITS_VERSION_KEY, &version, sizeof(version), 0) != MBED_SUCCESS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the set statement should be executed only when version file is not found or after migration.
rewriting it unconditionally is redundant.
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.cpp
Show resolved
Hide resolved
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.cpp
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.cpp
Show resolved
Hide resolved
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.cpp
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.h
Show resolved
Hide resolved
components/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_impl.h
Outdated
Show resolved
Hide resolved
Test run: FAILEDSummary: 3 of 7 test jobs failed Failed test jobs:
|
Test run: FAILEDSummary: 3 of 7 test jobs failed Failed test jobs:
|
Test run: FAILEDSummary: 3 of 7 test jobs failed Failed test jobs:
|
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
Please review test failures, related to the changes |
@ARMmbed/mbed-os-maintainers ready for CI |
We can schedule a build once 5.11.1 RC passes (currently in the CI, and had already one issue so restarted again) |
CI started |
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
2 failures there are related to the device rather than this PR, we will restart the job once the device is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI job restarted: |
...nts/TARGET_PSA/services/psa_prot_internal_storage/COMPONENT_PSA_SRV_IMPL/pits_version_impl.h
Outdated
Show resolved
Hide resolved
Why is the header file call psa_prot_internal_storage.h instead of psa/internal_trusted_storage.h? |
Only accessible from SPE
@0xc0170 the breaking change in this PR is mainly the key type that has been chnaged |
Merged via #9529 |
Description
Update PSA-ITS to revision 1.0 as described here
Pull request type
Reviewers
@alzix @davidsaada @Patater @moranpeker