Improve comment on buffer clearing

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott 2021-09-19 18:34:50 +01:00
parent 69bf5fc901
commit 4c916e8d74

View file

@ -3756,10 +3756,10 @@ psa_status_t psa_aead_finish( psa_aead_operation_t *operation,
exit: exit:
/* In case the operation fails and the user fails to check for failure or /* In case the operation fails and the user fails to check for failure or
* the zero tag size, make sure the tag is set to something impossible. * the zero tag size, make sure the tag is set to something implausible.
* Even if the operation succeeds, make sure we set the rest of the * Even if the operation succeeds, make sure we clear the rest of the
* buffer to something impossible to prevent potential leakage of * buffer to prevent potential leakage of anything previously placed in
* anything previously placed in the same buffer.*/ * the same buffer.*/
if( status != PSA_SUCCESS ) if( status != PSA_SUCCESS )
memset( tag, '!', tag_size ); memset( tag, '!', tag_size );
else if( *tag_length < tag_size ) else if( *tag_length < tag_size )