Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootutil: Fix AES and SHA-256 contexts not zeroized (mbedTLS) #2060

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/aes_ctr.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ static inline void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx)

static inline void bootutil_aes_ctr_drop(bootutil_aes_ctr_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_aes_free(ctx); */
(void)ctx;
mbedtls_aes_free(ctx);
}

static inline int bootutil_aes_ctr_set_key(bootutil_aes_ctr_context *ctx, const uint8_t *k)
Expand Down
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/aes_kw.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ static inline void bootutil_aes_kw_init(bootutil_aes_kw_context *ctx)

static inline void bootutil_aes_kw_drop(bootutil_aes_kw_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_aes_free(ctx); */
(void)ctx;
mbedtls_nist_kw_free(ctx);
}

static inline int bootutil_aes_kw_set_unwrap_key(bootutil_aes_kw_context *ctx, const uint8_t *k, uint32_t klen)
Expand Down
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ static inline int bootutil_sha_init(bootutil_sha_context *ctx)

static inline int bootutil_sha_drop(bootutil_sha_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_sha256_free(ctx); */
(void)ctx;
mbedtls_sha256_free(ctx);
return 0;
}

Expand Down
Loading