Commit 90846ba
committed
examples/pkcs7: size output buffer for RSA-4096 signatures
MAX_PKCS7_SIZE aliased to MAX_CONTEXT_SIZE (2 KB), which is enough
for an RSA-2048 signed blob but overflows at RSA-4096 where the
signature alone is 512 B plus a ~1-1.5 KB cert and ASN.1 overhead.
wc_PKCS7_EncodeSignedData then returned BUFFER_E (0xffffff7c).
Gate on MAX_RSA_KEY_BITS so 2048-bit builds keep the exact same
buffer size; 4096-bit builds (Nations NS350, Infineon SLB967x,
or anyone overriding) get 4 KB.1 parent 6942a8e commit 90846ba
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
0 commit comments