Fix: WolfCrypt Fenrir - 11 fixes - #10786
Conversation
9046e08 to
8968849
Compare
|
retest this please |
|
|
Jenkins retest this please |
f0db333 to
60b22a5
Compare
|
Jenkins retest this please |
|
Jenkins retest this please |
1 similar comment
|
Jenkins retest this please |
60b22a5 to
06d9993
Compare
|
rebased branch on to master |
7a668b2 to
f475fe0
Compare
|
Jenkins retest this please. |
Frauschi
left a comment
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: REQUEST_CHANGES
Findings: 2 total — 2 posted, 0 skipped
Posted findings
- [High] wc_Sha256Copy frees a zero-initialized dst and closes fd 0 (devcrypto) —
wolfcrypt/src/port/devcrypto/devcrypto_hash.c:231 - [Medium] wc_Sha256Copy leaks the just-opened session on XMALLOC failure —
wolfcrypt/src/port/devcrypto/devcrypto_hash.c:238-241
Review generated by Skoll via Claude/Codex
|
There is a lot of issues that come with trying to make the mutex initializer thread safe. I am now in favor of removing this goal and instead asking the user to init the mutex from a single thread. Using pthreads initializing a mutex (at runtime) concurrently will cause a race condition so there is precedence for this. I am going to remove WOLFSSL_THREAD_YEILD and set the mutex back to its original version. I am adding documentation to make this clear |
|
As for this finding devcrypto AES-GCM out-of-bounds writes are masked by enlarging the unit-test buffer rather than fixed This is intended behavior from the original writer of this functionality. The issue was that the test buffer was not written with this in mind. |
2b3617a to
2e3cfa5
Compare
https://fenrir.wolfssl.com/finding/5384 https://fenrir.wolfssl.com/finding/4432 https://fenrir.wolfssl.com/finding/5392 https://fenrir.wolfssl.com/finding/5392 skoll fixes Changed type for keys for CAAM in ecc so it matches assignment with out cast to never truncate Added check to see if CAAM_ADDRESS is defined before using in ecc.h https://fenrir.wolfssl.com/finding/5994 https://fenrir.wolfssl.com/finding/4445 Fixed memory leaks for dev crypto and fixed https://fenrir.wolfssl.com/finding/4446 https://fenrir.wolfssl.com/finding/5418 https://fenrir.wolfssl.com/finding/5420 https://fenrir.wolfssl.com/finding/5411 https://fenrir.wolfssl.com/finding/5412 https://fenrir.wolfssl.com/finding/5413 Skoll Fixes github comment fix github review fixes skoll fixes skoll fixes spelling fix
…nited. Also fixed bug in aes where the authTag was appended past the end of the cypher text
…ef and a couple loose fixes
… Mutex init thread safe attempt to just expect callers to call single threaded
…ADDRESS is never going to be greater than 32 bit and usually much smaller
2e3cfa5 to
5672765
Compare
|
Retest this please |
Description
https://fenrir.wolfssl.com/finding/6145
wc_DsaVerify/wc_DsaVerify_exleave*answeruninitialized on all error paths, unlike sibling ECC/ECCSI verify APIs that default to "not verified".answerparameter to zero so that on early exit the output parameter is defined as false.https://fenrir.wolfssl.com/finding/4432
wc_DrbgState_MutexInitunsafe lazy mutex initialization withoutWOLFSSL_MUTEX_INITIALIZER.https://fenrir.wolfssl.com/finding/5392
DES key schedule branches on secret key bits.
ifstatement, we use a mask to set bits inks.https://fenrir.wolfssl.com/finding/5994
Invalid free / use-after-free of embedded X509 NAME in the ESP32 cert-bundle verify callback on a lookup miss.
esp_crt_bundle.c.https://fenrir.wolfssl.com/finding/4445
devcrypto
wc_Sha256Copyproduces a non-functional hash copy whenWOLFSSL_DEVCRYPTO_HASH_KEEPis disabled.https://fenrir.wolfssl.com/finding/4446
devcrypto
wc_Sha256Finalleaks the kernel hash session whenGetDigestfails.https://fenrir.wolfssl.com/finding/5418
FSPSM AES-GCM TLS key allocation failures return without unlocking hardware.
https://fenrir.wolfssl.com/finding/5420
FSPSM hash
Final/GetHashsilently succeeds when hardware hash initialization fails.retto an error value so that on return the error is no longer silent.https://fenrir.wolfssl.com/finding/5411
SipHash assembly paths load the caller key through
word64pointer casts.byte*toword64*casts to use theGET_U64()helper macro to protect against alignment issues.https://fenrir.wolfssl.com/finding/5412
Intel RDSEED/RDRAND generators write arbitrary output buffers as
word64.word64value, then usedwriteUnalignedWord64to transfer it into the output without alignment issues.https://fenrir.wolfssl.com/finding/5413
ML-KEM AArch64 noise helpers cast byte buffers and seeds to
word64pointers.writeUnalignedWord64instead of abyte*->word64*cast.