mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 02:25:40 +00:00
Set output length to 0 at start of function
This behaviour was present previously, and is depended on by the test suites. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
f66d5fd2bd
commit
fbe09284cf
|
@ -2244,6 +2244,7 @@ psa_status_t psa_hash_finish( psa_hash_operation_t *operation,
|
|||
size_t hash_size,
|
||||
size_t *hash_length )
|
||||
{
|
||||
*hash_length = 0;
|
||||
if( operation->id == 0 )
|
||||
return( PSA_ERROR_BAD_STATE );
|
||||
|
||||
|
@ -2277,6 +2278,7 @@ psa_status_t psa_hash_compute( psa_algorithm_t alg,
|
|||
uint8_t *hash, size_t hash_size,
|
||||
size_t *hash_length )
|
||||
{
|
||||
*hash_length = 0;
|
||||
if( !PSA_ALG_IS_HASH( alg ) )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
|
|
Loading…
Reference in a new issue