From: Norbert Pocs Date: Sun, 11 May 2025 15:36:05 +0000 (+0200) Subject: s3_lib.c: Handle weak x keys as illegal_parameter alert X-Git-Tag: openssl-3.0.17~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=036c8242b772518042df7eb3ba2497177f09ec44;p=thirdparty%2Fopenssl.git s3_lib.c: Handle weak x keys as illegal_parameter alert Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27597) (cherry picked from commit 5da4ea10be8cf8ca66dff95c9997966f21c82029) --- diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index bcfe57b46f0..bac8f342085 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4820,7 +4820,10 @@ int ssl_derive(SSL *s, EVP_PKEY *privkey, EVP_PKEY *pubkey, int gensecret) } if (EVP_PKEY_derive(pctx, pms, &pmslen) <= 0) { - SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR); + /* + * the public key was probably a weak key + */ + SSLfatal(s, SSL_AD_ILLEGAL_PARAMETER, SSL_R_BAD_KEY_SHARE); goto err; }