PSA Storage: Add psa_trusted_storage_linux persistent storage support for v1.0.0 APIs #180
No reviewers
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto!180
Loading…
Reference in a new issue
No description provided.
Delete branch "feature-psa-storage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR should be squashed and merged. The following is offered as the squash commit message:
@jenia81 @moshe-shahar @shelib01 Please request the project administrators to add you as reviewers as I'm unable to do so.
https://github.com/ARMmbed/mbed-crypto/pull/180/commits/5c6179145a09fbb8097b432a50c46030854063e9
@Patater ,
@simonqhughes revert this commit because of the tests fails.
Can you please help me integrate that change so it will not fails the tests?
This PR has been submitted to mbedtls, which @Patater request for completing automated testing of the current PR:
https://github.com/ARMmbed/mbedtls/pull/2750
Please revert the config.h changes. Each new option is something we are stuck with for a long time, and it seems like these are options made just for now.
MBEDTLS_PSA_ITS_FILE_C_STORAGE_PREFIXisn't needed. We could addPSA_ITS_STORAGE_PREFIXto your Mbed TLS user config file for the same effect.Avoid adding this extra newline, please.
@ -44,7 +44,9 @@#include <stdio.h>Suggested change:
Please put the
*next to the variable name, not the type.We shouldn't need to add these lines when the
MBEDTLS_PSA_ITS_FILE_C_INCLUDE_TESToption is removed.Not needed change anymore
Probably don't need this change if we remove MBEDTLS_PSA_ITS_FILE_C_INCLUDE_TEST, since this test isn't really meant to test any "psa/internal_trusted_storage.h" implementation, just Mbed Crypto's own.
We should probably assert that
ret_lenis equal todata->len.@ -130,6 +133,7 @@ void set_multiple( int first_id, int count )psa_storage_uid_t uid;char stored[40];char retrieved[40];size_t ret_len = 0;We should probably assert that
ret_lenis equal todata1->len.We should probably assert that
ret_lenis equal todata2->len.@ -205,3 +209,4 @@buffer, ret_len );for( i = 0; i < 16; i++ )TEST_ASSERT( trailer[i] == '-' );PSA_ASSERT( psa_its_remove( uid ) );We should probably assert that
ret_lenis equal tosizeof( stored ).Good to see that we are also testing the
NULLdata_lengthparameter case.We should probably assert that
ret_lenis equal tolengthwhenstatus == PSA_SUCCESSOK. Done.
OK, extra line removed. Thanks.
@ -44,7 +44,9 @@#include <stdio.h>OK thanks. Done.
OK. Done.
Done.
Done
@ -130,6 +133,7 @@ void set_multiple( int first_id, int count )psa_storage_uid_t uid;char stored[40];char retrieved[40];size_t ret_len = 0;Done
Done
@ -205,3 +209,4 @@buffer, ret_len );for( i = 0; i < 16; i++ )TEST_ASSERT( trailer[i] == '-' );PSA_ASSERT( psa_its_remove( uid ) );Done
Ok
Done
Done
OK, removed.
This PR should be squashed and merged. The following is offered as the squash commit message having done the rework:
Thanks for the changes. This looks pretty close to me. We should make a few changes.
Could you please arrange your commits as you desire locally, giving them the commit messages you want? We don't use the "squash and merge" feature of GitHub.
Thanks!
@ -106,7 +107,8 @@ psa_status_t psa_its_set(psa_storage_uid_t uid,psa_status_t psa_its_get(psa_storage_uid_t uid,Please put the
*next to the variable name.@ -103,2 +104,3 @@status = psa_its_get( data_identifier, 0, (uint32_t) data_size, data );status = psa_its_get( data_identifier, 0, (uint32_t) data_size, data, &data_length );if( data_size != data_length )Should we check
data_lengthis equal todata_sizeand return an error (probablyPSA_ERROR_STORAGE_FAILURE) if not?@ -191,3 +195,4 @@unsigned char *trailer;size_t i;size_t ret_len = 0;We can do this in one assert if we replace the second
lengthwithlength_arg. Same applies to other similar asserts added in this PR.@ -191,3 +195,4 @@unsigned char *trailer;size_t i;size_t ret_len = 0;I think you mean the code changes to the following (which uses
ret_lenrather thanlength_arg):Otherwise you're not testing the returned value. The above is the change that will go into the rework as I think this is what you're requesting.
However, it would be better to have this:
as it's
length_argthat's supplied to thepsa_its_get(), notlengthwhich may be different. This version testspsa_its_get()rather thanget_at().But I think this is marginal.
@ -103,2 +104,3 @@status = psa_its_get( data_identifier, 0, (uint32_t) data_size, data );status = psa_its_get( data_identifier, 0, (uint32_t) data_size, data, &data_length );if( data_size != data_length )yes, its better.
@ -106,7 +107,8 @@ psa_status_t psa_its_set(psa_storage_uid_t uid,psa_status_t psa_its_get(psa_storage_uid_t uid,Done.
@ -191,3 +195,4 @@unsigned char *trailer;size_t i;size_t ret_len = 0;Yes, I like your suggestion better, to match what's passed to
psa_its_get().@ -191,3 +195,4 @@unsigned char *trailer;size_t i;size_t ret_len = 0;Ok, will change it to the new version.
LGTM
CI failure on merge run is flaky
m->m dtls1_2,yes TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256test, which passed fine on the head run.