From 467dc325243d7fcbd74cc30a223ea5741f1f9473 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Mon, 26 Oct 2020 12:35:55 -0700 Subject: [PATCH] Adjust error reason for ssl_get_min_max_version() failure Use SSL_R_NO_PROTOCOLS_AVAILABLE instead of ERR_R_INTERNAL_ERROR, to match what the BoringSSL tests expect for this case. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/13251) --- ssl/statem/statem_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c index ef4067a749..422c631838 100644 --- a/ssl/statem/statem_lib.c +++ b/ssl/statem/statem_lib.c @@ -101,8 +101,8 @@ int tls_setup_handshake(SSL *s) memset(s->ext.extflags, 0, sizeof(s->ext.extflags)); if (ssl_get_min_max_version(s, &ver_min, &ver_max, NULL) != 0) { - SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_SETUP_HANDSHAKE, - ERR_R_INTERNAL_ERROR); + SSLfatal(s, SSL_AD_PROTOCOL_VERSION, SSL_F_TLS_SETUP_HANDSHAKE, + SSL_R_NO_PROTOCOLS_AVAILABLE); return 0; }