From 82fbde71bd0df6dcb7dbb6c4fdbbd7832bc764dc Mon Sep 17 00:00:00 2001 From: islamoglus Date: Mon, 22 Apr 2019 16:00:57 +0300 Subject: [PATCH] using SSL_get_version method for BoringSSL compatibility --- src/apps/common/apputils.c | 56 +------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/src/apps/common/apputils.c b/src/apps/common/apputils.c index 5036020b..2dbb923e 100644 --- a/src/apps/common/apputils.c +++ b/src/apps/common/apputils.c @@ -1031,67 +1031,13 @@ unsigned char *base64_decode(const char *data, ////////////////// SSL ///////////////////// -static const char* turn_get_method(const SSL_METHOD *method, const char* mdefault) -{ - { - if(!method) - return mdefault; - else { - if(method == SSLv23_server_method()) { - return "SSLv23"; - } else if(method == SSLv23_client_method()) { - return "SSLv23"; - } else if(method == TLSv1_server_method()) { - return "TLSv1.0"; - } else if(method == TLSv1_client_method()) { - return "TLSv1.0"; -#if TLSv1_1_SUPPORTED - } else if(method == TLSv1_1_server_method()) { - return "TLSv1.1"; - } else if(method == TLSv1_1_client_method()) { - return "TLSv1.1"; -#if TLSv1_2_SUPPORTED - } else if(method == TLSv1_2_server_method()) { - return "TLSv1.2"; - } else if(method == TLSv1_2_client_method()) { - return "TLSv1.2"; -#endif -#endif -#if DTLS_SUPPORTED - - } else if(method == DTLSv1_server_method()) { - return "DTLSv1.0"; - } else if(method == DTLSv1_client_method()) { - return "DTLSv1.0"; - -#if DTLSv1_2_SUPPORTED - } else if(method == DTLSv1_2_server_method()) { - return "DTLSv1.2"; - } else if(method == DTLSv1_2_client_method()) { - return "DTLSv1.2"; -#endif -#endif - } else { - if(mdefault) - return mdefault; - return "UNKNOWN"; - } - } - } -} - const char* turn_get_ssl_method(SSL *ssl, const char* mdefault) { const char* ret = "unknown"; if(!ssl) { ret = mdefault; } else { - const SSL_METHOD *method = SSL_get_ssl_method(ssl); - if(!method) { - ret = mdefault; - } else { - ret = turn_get_method(method, mdefault); - } + ret = SSL_get_version(ssl); } return ret;