Skip to content

Fix: WolfCrypt 7 fenrir fixes#10808

Open
aidankeefe2022 wants to merge 1 commit into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun29-ak
Open

Fix: WolfCrypt 7 fenrir fixes#10808
aidankeefe2022 wants to merge 1 commit into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun29-ak

Conversation

@aidankeefe2022

Copy link
Copy Markdown
Member

Description

Fixed a series of Fenrir issues that mostly pertained to alignment UB when reading byte arrays as various sizes of integers.

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

FSPSM RSA private-decrypt never updates caller's *outLen (passes &outLen instead of outLen)

  • Swapped the double reference to just pass the outLen ptr

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

SLH-DSA AVX2 x4 SHAKE helpers cast hash byte streams to word64

  • Changed from direct cast byte -> word64 / word64 -> byte to use Unaligned memory helpers

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

ML-DSA little-endian pack/unpack paths cast encoded byte buffers to word pointers

  • Fixed a variety of possible alignment issues.

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

scrypt scryptROMix big-endian Integerify shifts bytes without width cast (signed overflow/oversized shift on 16-bit int)

  • Explicitly cast all intermediate values to word32 to make sure that there is no chance of signed in overflow during bit shifting.

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

wc_ecc_init_id (SE050) reinterprets byte id[] array as word32 via pointer cast

  • Used unaligned helper function to read byte array as word32

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

XMSS hash-address byte buffers cast to word32* in address-encoding helpers (unaligned access / strict aliasing)

  • Removed cast to use endian independent operation that copies the byte value in to the last byte because the word is stored in network byte order

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

PKCS#12 parse leaves decrypted SafeContents (incl. plaintext private KeyBag) in freed heap buffer

  • Added new variable to track temp buffer size and ForceZero it when it is freed

@aidankeefe2022 aidankeefe2022 self-assigned this Jun 29, 2026
@aidankeefe2022 aidankeefe2022 force-pushed the fenrir-fixes-jun29-ak branch from 4db6bea to 7719bc6 Compare June 29, 2026 22:24
@aidankeefe2022 aidankeefe2022 changed the title Fix: WolfCrypt 8 fenrir fixes Fix: WolfCrypt 7 fenrir fixes Jun 29, 2026

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10808

Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10808

Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4-crypto-only

  • FLASH: .text +64 B (+0.0%, 173,738 B / 262,144 B, total: 66% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 768,196 B / 1,048,576 B, total: 73% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +64 B (+0.0%, 278,000 B / 1,048,576 B, total: 27% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +64 B (+0.0%, 278,576 B / 1,048,576 B, total: 27% used)

stm32-sim-stm32h753

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10808

Scan targets checked: wolfcrypt-bugs, wolfcrypt-port-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

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.

2 participants