Xilinx asu rsa standalone - #11052
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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.
| WC_ASU_PRINTF("[ASU] rsa raw op=%d keySize=%u\r\n", | ||
| op, (unsigned int)keySize); | ||
|
|
||
| wc_AsuCacheFlush(info->pk.rsa.in, keySize); |
There was a problem hiding this comment.
🟠 [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.
No description provided.