Fixed SHA ctx and ilen parameters checking

pull/11046/head
Kostiantyn Tkachov 2019-08-16 17:29:58 +03:00 committed by Roman Okhrimenko
parent 50a8592104
commit f702d15855
3 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}