From 96e7ac3500ea28760ead00cbdd9efcf0ceef8738 Mon Sep 17 00:00:00 2001 From: lanming Date: Thu, 10 Jul 2025 10:20:05 +0800 Subject: [PATCH] Raise PROV_R_NULL_OUTPUT_BUFFER if shsec is NULL in ml_kem_encapsulate() Signed-off-by: lanming Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/28009) (cherry picked from commit 5d0c6c52e722f37f0254f8d5bfaf9b5c6b0df68b) --- providers/implementations/kem/ml_kem_kem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/implementations/kem/ml_kem_kem.c b/providers/implementations/kem/ml_kem_kem.c index ac798cb4b6b..27aa3b81983 100644 --- a/providers/implementations/kem/ml_kem_kem.c +++ b/providers/implementations/kem/ml_kem_kem.c @@ -171,7 +171,7 @@ static int ml_kem_encapsulate(void *vctx, unsigned char *ctext, size_t *clen, return 1; } if (shsec == NULL) { - ERR_raise_data(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL, + ERR_raise_data(ERR_LIB_PROV, PROV_R_NULL_OUTPUT_BUFFER, "NULL shared-secret buffer"); goto end; } -- 2.47.2