Skip to content

Commit

Permalink
core: mbedtls: Fix build
Browse files Browse the repository at this point in the history
The macro 'MBEDTLS_INTERNAL_VALIDATE_RET()' was removed in upstream commit
Mbed-TLS/mbedtls@cc0fd47

The macro was a no-op, so just remove the checks.

This fixes building OP-TEE with:

make PLATFORM=vexpress \
     PLATFORM_FLAVOR=juno \
     CFG_CRYPTOLIB_NAME=mbedtls \
     CFG_CRYPTOLIB_DIR=lib/libmbedtls
...
lib/libmbedtls/core/hash.c: In function 'mbedtls_internal_sha1_process':
lib/libmbedtls/core/hash.c:205:9: error: implicit declaration of function 'MBEDTLS_INTERNAL_VALIDATE_RET'

Signed-off-by: Jacob Kroon <jacobkr@axis.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
Jacob Kroon authored and jforissier committed Aug 19, 2024
1 parent 9a1482c commit 021fee0
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lib/libmbedtls/core/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ TEE_Result hash_sha256_check(const uint8_t *hash, const uint8_t *data,
int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx,
const unsigned char data[64])
{
MBEDTLS_INTERNAL_VALIDATE_RET(ctx != NULL,
MBEDTLS_ERR_SHA1_BAD_INPUT_DATA);
MBEDTLS_INTERNAL_VALIDATE_RET((const unsigned char *)data != NULL,
MBEDTLS_ERR_SHA1_BAD_INPUT_DATA);

crypto_accel_sha1_compress(ctx->state, data, 1);

return 0;
Expand All @@ -217,11 +212,6 @@ int mbedtls_internal_sha1_process(mbedtls_sha1_context *ctx,
int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
const unsigned char data[64])
{
MBEDTLS_INTERNAL_VALIDATE_RET(ctx != NULL,
MBEDTLS_ERR_SHA256_BAD_INPUT_DATA);
MBEDTLS_INTERNAL_VALIDATE_RET((const unsigned char *)data != NULL,
MBEDTLS_ERR_SHA256_BAD_INPUT_DATA);

crypto_accel_sha256_compress(ctx->state, data, 1);

return 0;
Expand All @@ -232,11 +222,6 @@ int mbedtls_internal_sha256_process(mbedtls_sha256_context *ctx,
int mbedtls_internal_sha512_process(mbedtls_sha512_context *ctx,
const unsigned char data[64])
{
MBEDTLS_INTERNAL_VALIDATE_RET(ctx != NULL,
MBEDTLS_ERR_SHA512_BAD_INPUT_DATA);
MBEDTLS_INTERNAL_VALIDATE_RET((const unsigned char *)data != NULL,
MBEDTLS_ERR_SHA512_BAD_INPUT_DATA);

crypto_accel_sha512_compress(ctx->state, data, 1);

return 0;
Expand Down

0 comments on commit 021fee0

Please sign in to comment.