From d36e156fac6e8248ed42af90003fcb1a767cfe76 Mon Sep 17 00:00:00 2001 From: Bruno Silvestre Date: Fri, 20 Nov 2015 18:54:57 -0200 Subject: [PATCH] Guard SSLv3_method() with #ifndef OPENSSL_NO_SSL3. Use TLS_method() instead of SSLv32_method(), when it is the case. --- src/context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/context.c b/src/context.c index cafc222..4cb1efb 100644 --- a/src/context.c +++ b/src/context.c @@ -35,6 +35,10 @@ typedef const SSL_METHOD LSEC_SSL_METHOD; typedef SSL_METHOD LSEC_SSL_METHOD; #endif +#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) +#define SSLv23_method() TLS_method() +#endif + /*--------------------------- Auxiliary Functions ----------------------------*/ /** @@ -66,7 +70,9 @@ static int set_option_flag(const char *opt, unsigned long *flag) static LSEC_SSL_METHOD* str2method(const char *method) { if (!strcmp(method, "sslv23")) return SSLv23_method(); +#ifndef OPENSSL_NO_SSL3 if (!strcmp(method, "sslv3")) return SSLv3_method(); +#endif if (!strcmp(method, "tlsv1")) return TLSv1_method(); #if (OPENSSL_VERSION_NUMBER >= 0x1000100fL) if (!strcmp(method, "tlsv1_1")) return TLSv1_1_method();