Add size asserts to psa_crypto test suite #265
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!265
Loading…
Reference in a new issue
No description provided.
Delete branch "test-suite-psa-zero-size-asserts"
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?
Add a signature size check in the psa test suites.
No. If we're decrypting an empty plaintext,
output_sizeshould be 0, andoutput_datawill beNULLas desired.Ok, thanks for clarifying.
@ -3779,6 +3779,8 @@ void sign_fail( int key_type_arg, data_t *key_data,size_t signature_length = 0xdeadbeef;psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;TEST_ASSERT( signature_size != 0 );Why these assertions? If we wanted to test that
psa_asymmetric_signbehaves properly when given an output buffer with a bad size, this test function should be the right thing to call. If something fails withsignature_size == 0orsignature_size > PSA_ASYMMETRIC_SIGNATURE_MAX_SIZE, the something in question should be fixed.@ -3779,6 +3779,8 @@ void sign_fail( int key_type_arg, data_t *key_data,size_t signature_length = 0xdeadbeef;psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;TEST_ASSERT( signature_size != 0 );This is due to coverity complaining on the unknown signature size. I added the same check that is made in other tests, to unify it.
@ -3779,6 +3779,8 @@ void sign_fail( int key_type_arg, data_t *key_data,size_t signature_length = 0xdeadbeef;psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;TEST_ASSERT( signature_size != 0 );Ok, but in this particular test,
signature_sizeis legitimate input. If Coverity is complaining about something, we need to look into why it's complaining, not silence it by pretending this can't happen.Closing, since the Coverity issue turned out to be a false positive.
Pull request closed