From 2011f36677d3498c363a158d7643ba60ae779384 Mon Sep 17 00:00:00 2001
From: philippegorley <philippe.gorley@savoirfairelinux.com>
Date: Thu, 21 Feb 2019 16:39:28 -0500
Subject: [PATCH] tls: fix compilation when not using tls 1.3

Change-Id: I43762a658e7f8fb43c6b0fda4cc38ce040e18f13
---
 src/security/tls_session.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/security/tls_session.cpp b/src/security/tls_session.cpp
index 9375f5af90..cd84f27b4d 100644
--- a/src/security/tls_session.cpp
+++ b/src/security/tls_session.cpp
@@ -858,7 +858,7 @@ TlsSession::TlsSessionImpl::handleStateHandshake(TlsSessionState state)
     // Following https://www.gnutls.org/manual/html_node/Safe-renegotiation.html
     // "Unlike TLS 1.2, the server is not allowed to change identities"
     // So, we don't have to check the status if we are the client
-#ifndef _WIN32 // For now, windows use GNUTLS < 3.6.5
+#if GNUTLS_VERSION_NUMBER >= 0x030605
     bool isTLS1_3 = gnutls_protocol_get_version(session_) == GNUTLS_TLS1_3;
     if (!isTLS1_3 || (isTLS1_3 && isServer_)) {
 #endif
@@ -866,7 +866,7 @@ TlsSession::TlsSessionImpl::handleStateHandshake(TlsSessionState state)
             RING_ERR("[TLS] server identity changed! MiM attack?");
             return TlsSessionState::SHUTDOWN;
         }
-#ifndef _WIN32
+#if GNUTLS_VERSION_NUMBER >= 0x030605
     }
 #endif
 
-- 
GitLab