From 02f7540b7cb04e4e3a520c240503b8185e76f372 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 17 Mar 2019 15:16:39 +0000 Subject: Partially clean up the TLS1_get_{,client}_version macros. LibreSSL only supports TLSv1.0 and above, hence the checks the macros are performing are useless. Simplify them to their effective code. Also place both under #ifndef LIBRESSL_INTERNAL and use the variables directly in our code, which improves readability. ok tb@ --- src/lib/libssl/tls1.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/tls1.h') diff --git a/src/lib/libssl/tls1.h b/src/lib/libssl/tls1.h index c253f6d2c0..e4ebbcbb00 100644 --- a/src/lib/libssl/tls1.h +++ b/src/lib/libssl/tls1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tls1.h,v 1.37 2018/11/09 00:34:55 beck Exp $ */ +/* $OpenBSD: tls1.h,v 1.38 2019/03/17 15:16:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -177,11 +177,10 @@ extern "C" { #define TLS1_VERSION_MAJOR 0x03 #define TLS1_VERSION_MINOR 0x01 -#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) +#ifndef LIBRESSL_INTERNAL +#define TLS1_get_version(s) (s->version) +#define TLS1_get_client_version(s) (s->client_version) +#endif /* * TLS Alert codes. -- cgit v1.2.3-55-g6feb