summaryrefslogtreecommitdiffstats
path: root/lib/libssl/tls1.h
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2019-03-19 16:53:03 +0000
committerjsing <jsing@openbsd.org>2019-03-19 16:53:03 +0000
commitb585d7de8f537f25872f1a8cb7afd9a7fd054ade (patch)
treed39fe360ec42ce701dfcc0ab02aee0c4de52d6c3 /lib/libssl/tls1.h
parentWhen the last line of the input is empty and the previous line reduced (diff)
downloadwireguard-openbsd-b585d7de8f537f25872f1a8cb7afd9a7fd054ade.tar.xz
wireguard-openbsd-b585d7de8f537f25872f1a8cb7afd9a7fd054ade.zip
Revert TLS1_get{,_client}_version simplification because DTLS.
Diffstat (limited to 'lib/libssl/tls1.h')
-rw-r--r--lib/libssl/tls1.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libssl/tls1.h b/lib/libssl/tls1.h
index e4ebbcbb001..cb68bbb562e 100644
--- a/lib/libssl/tls1.h
+++ b/lib/libssl/tls1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls1.h,v 1.38 2019/03/17 15:16:39 jsing Exp $ */
+/* $OpenBSD: tls1.h,v 1.39 2019/03/19 16:53:03 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -177,10 +177,11 @@ extern "C" {
#define TLS1_VERSION_MAJOR 0x03
#define TLS1_VERSION_MINOR 0x01
-#ifndef LIBRESSL_INTERNAL
-#define TLS1_get_version(s) (s->version)
-#define TLS1_get_client_version(s) (s->client_version)
-#endif
+#define TLS1_get_version(s) \
+ ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
+
+#define TLS1_get_client_version(s) \
+ ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)
/*
* TLS Alert codes.