Skip to content

Add checks to crypto operation calls in MCUboot #2263

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

Karambite
Copy link
Contributor

No description provided.

Comment on lines +97 to +105
if (bootutil_sha_update(&ctx, hash, PSS_HLEN)) {
goto out;
}
if (bootutil_sha_update(&ctx, counter, 4)) {
goto out;
}
if(bootutil_sha_finish(&ctx, htmp)){
goto out;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to do so? What is the point, fail quicker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. If the any of the sha operation fails, then why should it even attempt the rest? It stays consistent with other crypto implementations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason. If it fails it fails. There is no info here for reason nor any way to recover. But the code gets increased for adding condition checks and jumps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants