mbedtls: update usage of deprecated mbedtls_shaX APIs
The following mbedTLS APIs have been deprecated and replaced with the new ones which return error codes: mbedtls_shaX_starts -> mbedtls_shaX_starts_ret mbedtls_shaX_update -> mbedtls_shaX_update_ret mbedtls_shaX_finish -> mbedtls_shaX_finish_ret mbedtls_shaX_process -> mbedtls_shaX_internal_process Update hardware implementations of SHA functions, and other IDF components which used above functions, to use new versions.
This commit is contained in:
@@ -28,7 +28,7 @@ bootloader_sha256_handle_t bootloader_sha256_start()
|
||||
return NULL;
|
||||
}
|
||||
mbedtls_sha256_init(ctx);
|
||||
mbedtls_sha256_starts(ctx, false);
|
||||
assert(mbedtls_sha256_starts_ret(ctx, false) == 0);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data,
|
||||
{
|
||||
assert(handle != NULL);
|
||||
mbedtls_sha256_context *ctx = (mbedtls_sha256_context *)handle;
|
||||
mbedtls_sha256_update(ctx, data, data_len);
|
||||
assert(mbedtls_sha256_update_ret(ctx, data, data_len) == 0);
|
||||
}
|
||||
|
||||
void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest)
|
||||
@@ -44,7 +44,7 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
|
||||
assert(handle != NULL);
|
||||
mbedtls_sha256_context *ctx = (mbedtls_sha256_context *)handle;
|
||||
if (digest != NULL) {
|
||||
mbedtls_sha256_finish(ctx, digest);
|
||||
assert(mbedtls_sha256_finish_ret(ctx, digest) == 0);
|
||||
}
|
||||
mbedtls_sha256_free(ctx);
|
||||
free(handle);
|
||||
|
||||
Reference in New Issue
Block a user