diff options
author | Jean-Philippe Menil <jpmenil@gmail.com> | 2021-02-26 09:10:18 +0100 |
---|---|---|
committer | Daniel Gustafsson <daniel@yesql.se> | 2021-02-26 04:15:04 +0100 |
commit | 8779bfe77b13d7bf177ab5f9ec049ad711fca14c (patch) | |
tree | 4937df2acbc27ba2441f2d5623c48c0bb127b261 | |
parent | 09a5bff1c9cb9c305ac18f5c4f1f6233badcd8b4 (diff) | |
download | curl-8779bfe77b13d7bf177ab5f9ec049ad711fca14c.tar.gz |
openssl: remove get_ssl_version_txt in favor of SSL_get_version
openssl: use SSL_get_version to get connection protocol
Replace our bespoke get_ssl_version_txt in favor of SSL_get_version.
We can get rid of few lines of code, since SSL_get_version achieve
the exact same thing
Closes #6665
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
-rw-r--r-- | lib/vtls/openssl.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index c214c9ea1..e14368ee8 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2254,35 +2254,6 @@ select_next_proto_cb(SSL *ssl, } #endif /* HAS_NPN */ -#ifndef CURL_DISABLE_VERBOSE_STRINGS -static const char * -get_ssl_version_txt(SSL *ssl) -{ - if(!ssl) - return ""; - - switch(SSL_version(ssl)) { -#ifdef TLS1_3_VERSION - case TLS1_3_VERSION: - return "TLSv1.3"; -#endif -#if OPENSSL_VERSION_NUMBER >= 0x1000100FL - case TLS1_2_VERSION: - return "TLSv1.2"; - case TLS1_1_VERSION: - return "TLSv1.1"; -#endif - case TLS1_VERSION: - return "TLSv1.0"; - case SSL3_VERSION: - return "SSLv3"; - case SSL2_VERSION: - return "SSLv2"; - } - return "unknown"; -} -#endif - #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) /* 1.1.0 */ static CURLcode set_ssl_version_min_max(SSL_CTX *ctx, struct connectdata *conn) @@ -3386,7 +3357,7 @@ static CURLcode ossl_connect_step2(struct Curl_easy *data, /* Informational message */ infof(data, "SSL connection using %s / %s\n", - get_ssl_version_txt(backend->handle), + SSL_get_version(backend->handle), SSL_get_cipher(backend->handle)); #ifdef HAS_ALPN |