Skip to content

Commit 9871ceb

Browse files
committed
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: Fabio Utzig <[email protected]>
1 parent 195411f commit 9871ceb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

boot/bootutil/include/bootutil/sha256.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,20 @@ typedef mbedtls_sha256_context bootutil_sha256_context;
6161
static inline void bootutil_sha256_init(bootutil_sha256_context *ctx)
6262
{
6363
mbedtls_sha256_init(ctx);
64-
mbedtls_sha256_starts(ctx, 0);
64+
(void)mbedtls_sha256_starts_ret(ctx, 0);
6565
}
6666

6767
static inline void bootutil_sha256_update(bootutil_sha256_context *ctx,
6868
const void *data,
6969
uint32_t data_len)
7070
{
71-
mbedtls_sha256_update(ctx, data, data_len);
71+
(void)mbedtls_sha256_update_ret(ctx, data, data_len);
7272
}
7373

7474
static inline void bootutil_sha256_finish(bootutil_sha256_context *ctx,
7575
uint8_t *output)
7676
{
77-
mbedtls_sha256_finish(ctx, output);
77+
(void)mbedtls_sha256_finish_ret(ctx, output);
7878
}
7979
#endif /* MCUBOOT_USE_MBED_TLS */
8080

0 commit comments

Comments
 (0)