Commit 474a12c
authored
Add NULL pointer validation to ML-KEM EVP encapsulate/decapsulate (#3132)
Add GUARD_PTR checks for ctx and ctx->data, and explicitNULL checks for
length pointers and ciphertext buffer in pkey_kem_encapsulate and
pkey_kem_decapsulate. This matches the defensive pattern already used in
pkey_kem_encapsulate_deterministic and pkey_kem_keygen_deterministic in
the same file. Functions now return ERR_R_PASSED_NULL_PARAMETER instead
of crashing on NULL pointer arguments.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.1 parent 70e4b2f commit 474a12c
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
207 | 215 | | |
208 | 216 | | |
209 | 217 | | |
| |||
257 | 265 | | |
258 | 266 | | |
259 | 267 | | |
| 268 | + | |
260 | 269 | | |
| 270 | + | |
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
| |||
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
270 | 286 | | |
271 | 287 | | |
272 | 288 | | |
273 | 289 | | |
274 | 290 | | |
275 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
276 | 298 | | |
277 | 299 | | |
278 | 300 | | |
| |||
0 commit comments