Skip to content

bootutil: Fix crash when bootutil_sha_init() is called in loop #2271

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented Apr 22, 2025

For mynewt hardware implementation of hash functionality calling bootutil_sha_init() in a loop without call to bootutil_sha_drop() result in a failure.

In two places where bootutil_sha_drop() was called after the loop, call is move into the loop to match
calls to bootutil_sha_init().

This will not impact default implementation where calling bootutil_sha_drop() in a loop does not change anything.

This fixes #2264

For mynewt hardware implementation of hash functionality
calling bootutil_sha_init() in a loop without call to
bootutil_sha_drop() result in a failure.

In two places where bootutil_sha_drop() was called after
the loop, call is move into the loop to match
calls to bootutil_sha_init().

This will not impact default implementation where calling
bootutil_sha_drop() in a loop does not change anything.

Signed-off-by: Jerzy Kasenberg <[email protected]>
@kasjer kasjer requested a review from davidvincze as a code owner April 22, 2025 06:59
@nordicjm nordicjm requested a review from de-nordic April 22, 2025 07:05
@de-nordic de-nordic added the crypto Encryption support label Apr 22, 2025
@d3zd3z d3zd3z added this to the Release 2.2.0 milestone Apr 24, 2025
@d3zd3z d3zd3z added the bug label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crypto Encryption support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verification of RSA signature fails when custom hash hardware is used on mynewt
3 participants