mirror of https://github.com/ARMmbed/mbed-os.git
Fixed SHA ctx and ilen parameters checking
parent
50a8592104
commit
f702d15855
|
|
@ -90,7 +90,7 @@ int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
|
|||
SHA1_VALIDATE_RET( ilen == 0 || input != NULL );
|
||||
|
||||
if (ilen == 0)
|
||||
return;
|
||||
return (0);
|
||||
|
||||
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, input, ilen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char
|
|||
SHA256_VALIDATE_RET( ilen == 0 || input != NULL );
|
||||
|
||||
if (ilen == 0)
|
||||
return;
|
||||
|
||||
return (0);
|
||||
|
||||
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, (uint8_t *)input, ilen);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, const unsigned char
|
|||
{
|
||||
SHA512_VALIDATE_RET( ctx != NULL );
|
||||
SHA512_VALIDATE_RET( ilen == 0 || input != NULL );
|
||||
|
||||
|
||||
if (ilen == 0)
|
||||
return;
|
||||
return (0);
|
||||
|
||||
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, input, ilen);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue