Commit ebb98f1
committed
examples/csr: size PEM buffer for RSA-4096 signatures
MAX_PEM_SIZE aliased to MAX_CONTEXT_SIZE (2 KB), which is enough
for an RSA-2048 self-signed cert but overflows at RSA-4096 where
the signature alone is 512 B plus the cert body, ASN.1, and base64
overhead. wc_MakeCertReq / wc_MakeSelfSignedCert then returned
BUFFER_E (0xffffff7c / 0xffffff53).
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. Mirrors the fix already applied to
examples/pkcs7/pkcs7.c.1 parent 52cdcdc commit ebb98f1
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
0 commit comments