Skip to content

Comments

Fix Crash when using Sha224 Callback with MAX32666#9712

Open
night1rider wants to merge 4 commits intowolfSSL:masterfrom
night1rider:max-32666-code-improvements
Open

Fix Crash when using Sha224 Callback with MAX32666#9712
night1rider wants to merge 4 commits intowolfSSL:masterfrom
night1rider:max-32666-code-improvements

Conversation

@night1rider
Copy link
Contributor

@night1rider night1rider commented Jan 24, 2026

Found that when using sha224 with callbacks on program/system would crash due to missing initialization.

Update MAX32666 to use Copy and Free Callbacks as well, with some general improvement to copy and free logic.

Crash bug is present in v5.8.4, but not previous stable v5.8.2. Was found when adding #9070 specifically commit 07b3695 which added callback for sha224.

Also found that when commit 9c1462a entered, there was no initialization for the callback structure and the MXC init call when the new wc_sha256_init_ex was added.

@night1rider
Copy link
Contributor Author

night1rider commented Jan 26, 2026

Jenkins retest this please

Jenkins disconnect from server during PRB-generic-config-parser

@night1rider
Copy link
Contributor Author

Jenkins retest this please


/* Handle case where src has no data */
if (src->msg == NULL || src->size == 0) {
/* Free dst if it has different data, then zero it */
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment says "free then zero" but it looks like it conditionally frees here if not null and pointers are not the same, or it zeros if NULL or the pointers are the same.

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, sorry, the comment is referring to the process that happens when we use the wc_MXC_TPU_SHA_Free call. Inside this call it will zero out the message buffer and free the message buffer point and then set the other values as 0 for size and used.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@night1rider
Copy link
Contributor Author

Jenkins retest this please

@night1rider night1rider force-pushed the max-32666-code-improvements branch from de36166 to ee3c785 Compare February 18, 2026 23:35
…, also add HASH_KEEP to sha1 context with correct init/free calls
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.

3 participants