From: Norbert Pocs Date: Thu, 15 May 2025 07:53:00 +0000 (+0200) Subject: s3_lib.c: Use illegal_parameter for failing encapsulation in ml_kem X-Git-Tag: openssl-3.4.2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c8b88a8e4126db5f814636627402da9b2373c9;p=thirdparty%2Fopenssl.git s3_lib.c: Use illegal_parameter for failing encapsulation in ml_kem 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) --- 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; }