Skip to content

Commit f702d15

Browse files
kotkcyromanjoe
authored andcommitted
Fixed SHA ctx and ilen parameters checking
1 parent 50a8592 commit f702d15

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

features/mbedtls/targets/TARGET_Cypress/TARGET_PSOC6/sha1_alt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
9090
SHA1_VALIDATE_RET( ilen == 0 || input != NULL );
9191

9292
if (ilen == 0)
93-
return;
93+
return (0);
9494

9595
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, input, ilen);
9696
}

features/mbedtls/targets/TARGET_Cypress/TARGET_PSOC6/sha256_alt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, const unsigned char
9090
SHA256_VALIDATE_RET( ilen == 0 || input != NULL );
9191

9292
if (ilen == 0)
93-
return;
94-
93+
return (0);
94+
9595
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, (uint8_t *)input, ilen);
9696
}
9797

features/mbedtls/targets/TARGET_Cypress/TARGET_PSOC6/sha512_alt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, const unsigned char
8888
{
8989
SHA512_VALIDATE_RET( ctx != NULL );
9090
SHA512_VALIDATE_RET( ilen == 0 || input != NULL );
91-
91+
9292
if (ilen == 0)
93-
return;
93+
return (0);
9494

9595
return cy_hw_sha_update(&ctx->obj, &ctx->hashState, input, ilen);
9696
}

0 commit comments

Comments
 (0)