-
Notifications
You must be signed in to change notification settings - Fork 3k
PSA: Fix error codes masking in psa_attestation_inject_key() #9996
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
Conversation
TESTS/psa/attestation/main.cpp
Outdated
@@ -128,11 +129,13 @@ utest::v1::status_t case_teardown_handler(const Case *const source, const size_t | |||
|
|||
utest::v1::status_t case_setup_handler(const Case *const source, const size_t index_of_case) | |||
{ | |||
psa_status_t status = mbed_psa_reboot_and_request_new_security_state(PSA_LIFECYCLE_ASSEMBLY_AND_TEST); |
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.
Need to choose the correct way to clean this test,
in tear down the test uses 'psa_destroy_key(handle);' and in init the test uses mbed_psa_reboot_and_request_new_security_state.
it seems the correct way is or both use 'mbed_psa_reboot_and_request_new_security_state' or both uses 'psa_destroy_key'
in addition, does the 'mbed_psa_reboot_and_request_new_security_state' will work if using protected storage and not secure internal storage?
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.
@netanelgonen
what does PS has to do with attestation? please elaborate
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.
@netanelgonen, despite its name, the mbed_psa_reboot_and_request_new_security_state()
API will not reboot the system when moving from PSA_LIFECYCLE_ASSEMBLY_AND_TEST
to PSA_LIFECYCLE_ASSEMBLY_AND_TEST
. The only effect it will have is to clean PSA RoT state. (currently just wiping out ITS).
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.
@orenc17, thank you for your changes. |
Set to 5.12.0-rc2 |
This needs reviews ! I'll run CI meanwhile |
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
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
Any findings? |
Tested on K64F, CY8CKIT_062_WIFI_BT_PSA, FUTURE_SEQUANA_PSA |
Test run: FAILEDSummary: 1 of 13 test jobs failed Failed test jobs:
|
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
Description
psa_attestation_inject_key() IPC implementation was masking negative error codes as PSA_ERROR_COMMUNICATION_FAILURE instead of returning the actual error code.
Clear the ITS storage in test case setup handler to avoid a situation where a call for psa_attestation_inject_key() would fail for key already exists error.
Did not check regression yet.
Pull request type
Reviewers
@ARMmbed/mbed-os-psa @moranpeker @netanelgonen @itayzafrir @avolinski
Release Notes