From 8e63e4b42bcbc574cf1d693d3e2e3119cd8db665 Mon Sep 17 00:00:00 2001 From: Norbert Pocs Date: Thu, 15 May 2025 09:53:00 +0200 Subject: [PATCH] s3_lib.c: Use illegal_parameter for failing encapsulation in ml_kem MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Norbert Pocs Reviewed-by: Matt Caswell Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27627) (cherry picked from commit e66097fc6687750ac792986a71375b23793766c2) --- ssl/s3_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index bf427f0b195..395653907ca 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -5006,7 +5006,7 @@ int ssl_encapsulate(SSL_CONNECTION *s, EVP_PKEY *pubkey, } if (EVP_PKEY_encapsulate(pctx, ct, &ctlen, pms, &pmslen) <= 0) { - SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); + SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE); goto err; } -- 2.47.3