mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-15 23:42:41 +00:00
move hash update zero-length-input check back into the core
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
dbf8ceda54
commit
c8288354a2
@ -2226,6 +2226,11 @@ psa_status_t psa_hash_update( psa_hash_operation_t *operation,
|
|||||||
if( operation->id == 0 )
|
if( operation->id == 0 )
|
||||||
return( PSA_ERROR_BAD_STATE );
|
return( PSA_ERROR_BAD_STATE );
|
||||||
|
|
||||||
|
/* Don't require hash implementations to behave correctly on a
|
||||||
|
* zero-length input, which may have an invalid pointer. */
|
||||||
|
if( input_length == 0 )
|
||||||
|
return( PSA_SUCCESS );
|
||||||
|
|
||||||
psa_status_t status = psa_driver_wrapper_hash_update( operation,
|
psa_status_t status = psa_driver_wrapper_hash_update( operation,
|
||||||
input, input_length );
|
input, input_length );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
|
@ -216,11 +216,6 @@ psa_status_t mbedtls_psa_hash_update(
|
|||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
/* Don't require hash implementations to behave correctly on a
|
|
||||||
* zero-length input, which may have an invalid pointer. */
|
|
||||||
if( input_length == 0 )
|
|
||||||
return( PSA_SUCCESS );
|
|
||||||
|
|
||||||
switch( operation->alg )
|
switch( operation->alg )
|
||||||
{
|
{
|
||||||
#if defined(MBEDTLS_PSA_BUILTIN_ALG_MD2)
|
#if defined(MBEDTLS_PSA_BUILTIN_ALG_MD2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user