-
Notifications
You must be signed in to change notification settings - Fork 838
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
wolfcrypt polish: init, checks, corrections #6249
Conversation
b5ff2b0
to
0418a74
Compare
retest this please |
8ea8e9a
to
0210dcd
Compare
inadvertently closed; sync with upstream & squashed commits. re-opening for review. |
Jenkins retest this please |
wolfcrypt/src/aes.c
Outdated
@@ -2676,6 +2676,22 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt( | |||
return BAD_FUNC_ARG; | |||
} | |||
|
|||
#if !defined(WOLFSSL_AES_128) | |||
if (keylen == 16) { | |||
return BAD_FUNC_ARG; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indents should be 4 spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes. I know that well. My bad for letting this one slip by. I've pushed an update to fix
wolfcrypt/src/cmac.c
Outdated
@@ -216,6 +216,7 @@ int wc_CmacFinal(Cmac* cmac, byte* out, word32* outSz) | |||
{ | |||
int ret; | |||
const byte* subKey; | |||
word32 remainder = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may get a set but not used with 0 init. Recommend removing the =0
. This can also move into the else section. Variable declarations must be at top of function or brace section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the init = 0
and left the declaration at the top of the function.
The Jenkins error is:
However your code doesn't touch it. Consider a rebase to latest master? |
Good idea. I've refreshed from upstream, but encountered a new error. I suspect trying again might be successful, but perhaps @bandi13 would be interested in reviewing this build timeout error first:
|
Jenkins retest this please |
Hi @dgarske the refresh from upstream worked. Looks like GitHub has been having some recently problems, perhaps this explains prior unexpected and odd Jenkins failures. In any case, please review and let me know if you'd like any other changes. |
* wolfcrypt polish: init, checks, corrections
Description
A variety of minor cleanup and initialization issues to appease compiler complaints, addressed while developing the updates in my ED25519_SHA2_fix branch. Those changes have grown so numerous, I'm breaking down the updates into manageable PR's. 1/n
aes.c
- return error if lengths for known-not-definedkeylen
values encountered.asn.c
- return zero (an error when dynamic memory allocation fails) forwc_EncodeSignature
param lengths less than or equal to zerocmac.c
- checkcmac->bufferSz > AES_BLOCK_SIZE
inwc_CmacFinal
ed25519.c
- cleanup. variable init.md5.c
- check md5 buffer length inwc_Md5Final
.random.c
- include<esp_random.h>
when ESP-IDF v5 detected. Add comments. Correct spelling ofENTROPY_NUM_WORDS_BITS
ripemd.c
- checkripemd
buffLen is not larger thanRIPEMD_BLOCK_SIZE
inwc_RipeMdFinal
.Fixes zd# n/a
Testing
I've been using these changes in the Espressif development for some time. Here's a script to run the wolfssl
testwolfcrypt
from WSL Ubuntu on Windows:Unit testing
Checklist