aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/socket.c b/socket.c
index 49af2235..62fd43d2 100644
--- a/socket.c
+++ b/socket.c
@@ -10,6 +10,7 @@
#include "config.h"
#include "fetchmail.h"
+#include "tls-aux.h"
#include <stdio.h>
#include <errno.h>
@@ -902,8 +903,8 @@ static const char *SSLCertGetCN(const char *mycert,
return ret;
}
-#if defined(LIBRESSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x1010000fL
-/* OSSL_proto_version_logic for OpenSSL 1.0.x and LibreSSL */
+#if !defined(OSSL110_API)
+/* ===== implementation for OpenSSL 1.0.X and LibreSSL ===== */
static int OSSL10X_proto_version_logic(int sock, const char **myproto, int *avoid_ssl_versions)
{
if (!*myproto) {
@@ -971,10 +972,8 @@ static int OSSL10X_proto_version_logic(int sock, const char **myproto, int *avoi
return 0;
}
#define OSSL_proto_version_logic(a,b,c) OSSL10X_proto_version_logic((a),(b),(c))
-#undef OSSL110_API
#else
-/* implementation for OpenSSL 1.1.0 */
-#define OSSL110_API 1
+/* ===== implementation for OpenSSL 1.1.0 ===== */
static int OSSL110_proto_version_logic(int sock, const char **myproto,
int *avoid_ssl_versions)
{
@@ -1072,10 +1071,8 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck
SSL_load_error_strings();
SSL_library_init();
OpenSSL_add_all_algorithms(); /* see Debian Bug#576430 and manpage */
- ver = SSLeay();
-#else
- ver = OpenSSL_version_num();
#endif
+ ver = OpenSSL_version_num(); /* version switch through tls-aux.h */
if (ver < OPENSSL_VERSION_NUMBER) {
report(stderr, GT_("Loaded OpenSSL library %#lx older than headers %#lx, refusing to work.\n"), (long)ver, (long)(OPENSSL_VERSION_NUMBER));