Commit 9871cebf authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Update mbedTLS sha256 usage to avoid deprecation

mbedTLS made sha256 functions that do not return errors deprecated. This
updates to use the new functions avoiding the extra functions calls, and
breakage when the deprecated calls are effectively removed.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 195411f2
Loading
Loading
Loading
Loading
+3 −3
Changes for boot/bootutil/include/bootutil/sha256.h: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -61,20 +61,20 @@ typedef mbedtls_sha256_context bootutil_sha256_context;
static inline void bootutil_sha256_init(bootutil_sha256_context *ctx)
{
    mbedtls_sha256_init(ctx);
    mbedtls_sha256_starts(ctx, 0);
    (void)mbedtls_sha256_starts_ret(ctx, 0);
}

static inline void bootutil_sha256_update(bootutil_sha256_context *ctx,
                                          const void *data,
                                          uint32_t data_len)
{
    mbedtls_sha256_update(ctx, data, data_len);
    (void)mbedtls_sha256_update_ret(ctx, data, data_len);
}

static inline void bootutil_sha256_finish(bootutil_sha256_context *ctx,
                                          uint8_t *output)
{
    mbedtls_sha256_finish(ctx, output);
    (void)mbedtls_sha256_finish_ret(ctx, output);
}
#endif /* MCUBOOT_USE_MBED_TLS */