Skip to content

Xilinx asu rsa standalone - #11052

Open
night1rider wants to merge 2 commits into
wolfSSL:masterfrom
night1rider:Xilinx-ASU-RSA-standalone
Open

Xilinx asu rsa standalone#11052
night1rider wants to merge 2 commits into
wolfSSL:masterfrom
night1rider:Xilinx-ASU-RSA-standalone

Conversation

@night1rider

Copy link
Copy Markdown
Contributor

No description provided.

@night1rider night1rider self-assigned this Aug 4, 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 #11052

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

Findings: 4
4 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/port/xilinx/versal_gen2_asu/asu_rsa.c
Comment thread wolfcrypt/src/port/xilinx/versal_gen2_asu/asu_rsa.c
Comment thread wolfcrypt/src/port/xilinx/versal_gen2_asu/asu_rsa.c
WC_ASU_PRINTF("[ASU] rsa raw op=%d keySize=%u\r\n",
op, (unsigned int)keySize);

wc_AsuCacheFlush(info->pk.rsa.in, keySize);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 [Medium] Raw RSA offload trusts keySize over actual input length, causing OOB read · Buffer overflows

wc_AsuRsaRawDispatch/wc_AsuRsaRaw never validate info->pk.rsa.inLen against keySize; they set Len = keySize and flush/DMA keySize bytes from info->pk.rsa.in unconditionally, over-reading the caller's buffer when inLen < keySize. Reachable via wc_RsaPrivateDecrypt_ex/wc_RsaPublicEncrypt_ex with WC_RSA_NO_PAD when the key's devId routes to this callback.

Fix: Reject the request (return CRYPTOCB_UNAVAILABLE/BAD_FUNC_ARG) unless info->pk.rsa.inLen == keySize, matching the length checks used in the PSS/OAEP paths.

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