Skip to content

Fix: WolfCrypt Fenrir - 12 fixes#10786

Open
aidankeefe2022 wants to merge 2 commits into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun24/26-ak
Open

Fix: WolfCrypt Fenrir - 12 fixes#10786
aidankeefe2022 wants to merge 2 commits into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun24/26-ak

Conversation

@aidankeefe2022

@aidankeefe2022 aidankeefe2022 commented Jun 25, 2026

Copy link
Copy Markdown
Member

Description

https://fenrir.wolfssl.com/finding/6145

wc_DsaVerify/wc_DsaVerify_ex leave *answer uninitialized on all error paths, unlike sibling ECC/ECCSI verify APIs that default to "not verified".

  • Initialized the answer parameter to zero so that on early exit the output parameter is defined as false.

https://fenrir.wolfssl.com/finding/5384

CAAM secure-memory addresses are truncated to 32 bits in ECC keys.

  • Changed the ecc_key fields to CAAM_ADDRESS when it is defined. This allows the address width to expand with the platform so addresses are not truncated.

https://fenrir.wolfssl.com/finding/4432

wc_DrbgState_MutexInit unsafe lazy mutex initialization without WOLFSSL_MUTEX_INITIALIZER.

  • Instead of checking a plain int, we use atomic operations when they are present to initialize the mutex. This ensures that no two threads can initialize the same mutex.

https://fenrir.wolfssl.com/finding/5392

DES key schedule branches on secret key bits.

  • Instead of an if statement, we use a mask to set bits in ks.

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.

  • Confirmed and removed the double free in esp_crt_bundle.c.

https://fenrir.wolfssl.com/finding/4445

devcrypto wc_Sha256Copy produces a non-functional hash copy when WOLFSSL_DEVCRYPTO_HASH_KEEP is disabled.

  • Made the function match the rest of the file and return an error when a copy is not available. Also freed the destination before the copy to fix a memory leak.

https://fenrir.wolfssl.com/finding/4446

devcrypto wc_Sha256Final leaks the kernel hash session when GetDigest fails.

  • Added a free on error, which uncovered and fixed memory leaks caught by tests when devcrypto is enabled.

https://fenrir.wolfssl.com/finding/5418

FSPSM AES-GCM TLS key allocation failures return without unlocking hardware.

  • Added a mutex unlock on memory allocation failure.

https://fenrir.wolfssl.com/finding/5420

FSPSM hash Final/GetHash silently succeeds when hardware hash initialization fails.

  • Set ret to 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 word64 pointer casts.

  • Swapped multiple byte* to word64* casts to use the GET_U64() helper macro to protect against alignment issues.

https://fenrir.wolfssl.com/finding/5412

Intel RDSEED/RDRAND generators write arbitrary output buffers as word64.

  • Added a temporary word64 value, then used writeUnalignedWord64 to 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 word64 pointers.

  • Used the alignment-protected helper function writeUnalignedWord64 instead of a byte* -> word64* cast.

@aidankeefe2022 aidankeefe2022 self-assigned this Jun 25, 2026
@aidankeefe2022 aidankeefe2022 changed the title https://fenrir.wolfssl.com/finding/6145 Fix: WolfCrypt Fenrir - 6145, 5384, 4432, 5392 Jun 25, 2026
@aidankeefe2022 aidankeefe2022 force-pushed the fenrir-fixes-jun24/26-ak branch from 9046e08 to 8968849 Compare June 26, 2026 18:34
@aidankeefe2022 aidankeefe2022 marked this pull request as ready for review June 26, 2026 18:47
@github-actions

Copy link
Copy Markdown

retest this please

@aidankeefe2022

Copy link
Copy Markdown
Member Author

Jenkins retest this please

@aidankeefe2022 aidankeefe2022 changed the title Fix: WolfCrypt Fenrir - 6145, 5384, 4432, 5392 Fix: WolfCrypt Fenrir - 6145, 5384, 4432, 5392, 5994, 4445, 4446, 5418, 5420, 5411, 5412, 5413 Jun 26, 2026
@aidankeefe2022 aidankeefe2022 force-pushed the fenrir-fixes-jun24/26-ak branch 3 times, most recently from f0db333 to 60b22a5 Compare June 26, 2026 21:10
@aidankeefe2022

Copy link
Copy Markdown
Member Author

Jenkins retest this please

@aidankeefe2022 aidankeefe2022 changed the title Fix: WolfCrypt Fenrir - 6145, 5384, 4432, 5392, 5994, 4445, 4446, 5418, 5420, 5411, 5412, 5413 Fix: WolfCrypt Fenrir - 12 fixes Jun 26, 2026
@aidankeefe2022

Copy link
Copy Markdown
Member Author

Jenkins retest this please

1 similar comment
@aidankeefe2022

Copy link
Copy Markdown
Member Author

Jenkins retest this please

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.

1 participant