-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added support for AES-ECB to the PSA Crypto implementation #3480
Added support for AES-ECB to the PSA Crypto implementation #3480
Conversation
PSA_ALG_ECB_NO_PADDING came in to the PSA Crypto API spec v1.0.0, but was not implemented yet in the mbed TLS implementation. Signed-off-by: Steven Cooreman <[email protected]>
Does this need a changelog entry? |
I think yes, this counts as a new feature so it should have a changelog entry. |
Signed-off-by: Steven Cooreman <[email protected]>
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.
Only The MbedOS Tests are failing, LGTM
{ | ||
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
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.
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); | |
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
if( iv->len > 0 ) { | ||
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
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.
if( iv->len > 0 ) { | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); | |
if( iv->len > 0 ) | |
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
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.
Minor: The brace {
is still misplaced here and at other occasions.
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.
Done now, sorry for the oversight.
if( iv->len > 0 ) { | ||
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
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.
if( iv->len > 0 ) { | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); | |
if( iv->len > 0 ) | |
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation, iv->x, iv->len ) ); |
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.
Same here.
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.
Done now, sorry for the oversight.
if( alg != PSA_ALG_ECB_NO_PADDING ) { | ||
PSA_ASSERT( psa_cipher_generate_iv( &operation1, |
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.
if( alg != PSA_ALG_ECB_NO_PADDING ) { | |
PSA_ASSERT( psa_cipher_generate_iv( &operation1, | |
if( alg != PSA_ALG_ECB_NO_PADDING ) | |
{ | |
PSA_ASSERT( psa_cipher_generate_iv( &operation1, |
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.
Same here.
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.
Done now, sorry for the oversight.
if( iv_length > 0 ) { | ||
PSA_ASSERT( psa_cipher_set_iv( &operation2, |
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.
if( iv_length > 0 ) { | |
PSA_ASSERT( psa_cipher_set_iv( &operation2, | |
if( iv_length > 0 ) | |
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation2, |
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.
Same here.
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.
Done now, sorry for the oversight.
if( alg != PSA_ALG_ECB_NO_PADDING ) { | ||
PSA_ASSERT( psa_cipher_generate_iv( &operation1, |
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.
if( alg != PSA_ALG_ECB_NO_PADDING ) { | |
PSA_ASSERT( psa_cipher_generate_iv( &operation1, | |
if( alg != PSA_ALG_ECB_NO_PADDING ) | |
{ | |
PSA_ASSERT( psa_cipher_generate_iv( &operation1, |
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.
Same here.
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.
Done now, sorry for the oversight.
if( iv_length > 0 ) { | ||
PSA_ASSERT( psa_cipher_set_iv( &operation2, |
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.
if( iv_length > 0 ) { | |
PSA_ASSERT( psa_cipher_set_iv( &operation2, | |
if( iv_length > 0 ) | |
{ | |
PSA_ASSERT( psa_cipher_set_iv( &operation2, |
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.
Same here.
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.
Done now, sorry for the oversight.
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.
Looks good to me, thanks @stevew817 for your work!
There's just a bunch of trivial style issues remaining as indicated in the comments.
Signed-off-by: Steven Cooreman <[email protected]>
|
||
status = PSA_SUCCESS; | ||
|
||
exit: |
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.
Since there's no cleanup, it would be more readable to use return( status )
instead of goto exit
(and return( whatever );
instead of status = whatever; goto exit;
). I don't consider it a blocker.
@hanno-arm I'd appreciate it if you could give your thumbs up now that all your requested changes have been incorporated. This PR has been open for over two months already. |
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.
Apologies for the delay, @stevew817, and thank you for making the requested changes. LGTM
All the mbedTLS tests have passed (at the time of writing, only the MbedOS tests are still running). |
Description
This PR implements support for
PSA_ALG_ECB_NO_PADDING
as defined in the PSA Crypto API spec v1.0.0. Feature was requested in #3277.Status
READY
Requires Backporting
NO
Migrations
NO
Todos
Steps to test or reproduce
Tested through the PSA Crypto test suite.