Fix Crash when using Sha224 Callback with MAX32666#9712
Fix Crash when using Sha224 Callback with MAX32666#9712night1rider wants to merge 4 commits intowolfSSL:masterfrom
Conversation
|
Jenkins retest this please Jenkins disconnect from server during PRB-generic-config-parser |
|
Jenkins retest this please |
wolfcrypt/src/port/maxim/max3266x.c
Outdated
|
|
||
| /* Handle case where src has no data */ | ||
| if (src->msg == NULL || src->size == 0) { | ||
| /* Free dst if it has different data, then zero it */ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
Jenkins retest this please |
…k functions, fix sha224 crashing when using callbacks for MAX32666 due to unitialized struct.
de36166 to
ee3c785
Compare
…, also add HASH_KEEP to sha1 context with correct init/free calls
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.