From b8c8b88a8e4126db5f814636627402da9b2373c9 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 83c5af989e9..1dec0052143 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -5062,7 +5062,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.2