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.0.17~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f001f4e0614ad6a8593f74aec552278e48ad93a2;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 bac8f342085..1f92ba2ae7d 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4926,7 +4926,7 @@ int ssl_encapsulate(SSL *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; }