Commit 1e04092
committed
Only zero unused tail of PKCS#8 PEM buffer
F-2148
The prior fix zeroed the computed DER staging area, but PEM output from
wc_DerToPemEx fills most of the buffer and overlaps that region,
corrupting the valid PEM. Preserve the allocation size and zero only
the bytes beyond the actual PEM length, or the whole buffer on failure.1 parent 00fff0f commit 1e04092
1 file changed
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7117 | 7117 | | |
7118 | 7118 | | |
7119 | 7119 | | |
| 7120 | + | |
7120 | 7121 | | |
7121 | 7122 | | |
7122 | 7123 | | |
| |||
7155 | 7156 | | |
7156 | 7157 | | |
7157 | 7158 | | |
| 7159 | + | |
| 7160 | + | |
| 7161 | + | |
| 7162 | + | |
7158 | 7163 | | |
7159 | 7164 | | |
7160 | 7165 | | |
| |||
7208 | 7213 | | |
7209 | 7214 | | |
7210 | 7215 | | |
7211 | | - | |
7212 | | - | |
7213 | | - | |
7214 | | - | |
| 7216 | + | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
| 7221 | + | |
| 7222 | + | |
| 7223 | + | |
| 7224 | + | |
| 7225 | + | |
| 7226 | + | |
| 7227 | + | |
7215 | 7228 | | |
7216 | 7229 | | |
7217 | 7230 | | |
| |||
0 commit comments