[prev in list] [next in list] [prev in thread] [next in thread]
List: openconnect-devel
Subject: [PATCH 1/2] Fix (non) static HMAC_CTX_* for LibreSSL 2.7+
From: Philipp Ammann <philipp.ammann () posteo ! de>
Date: 2019-08-03 15:23:48
Message-ID: 20190803152349.3983-1-philipp.ammann () posteo ! de
[Download RAW message or body]
Signed-off-by: Philipp Ammann <philipp.ammann@posteo.de>
---
openssl-esp.c | 5 ++++-
tests/bad_dtls_test.c | 10 ++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/openssl-esp.c b/openssl-esp.c
index 0cb65444..ee3fbb2b 100644
--- a/openssl-esp.c
+++ b/openssl-esp.c
@@ -36,7 +36,10 @@
HMAC_CTX_cleanup(c); \
free(c); } while (0)
-static inline HMAC_CTX *HMAC_CTX_new(void)
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
+static
+#endif
+inline HMAC_CTX *HMAC_CTX_new(void)
{
HMAC_CTX *ret = malloc(sizeof(*ret));
if (ret)
diff --git a/tests/bad_dtls_test.c b/tests/bad_dtls_test.c
index c123c8f8..a182bd6e 100644
--- a/tests/bad_dtls_test.c
+++ b/tests/bad_dtls_test.c
@@ -291,12 +291,18 @@ static EVP_MD_CTX *handshake_md5;
static EVP_MD_CTX *handshake_sha1;
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-static inline HMAC_CTX *HMAC_CTX_new(void) {
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
+static
+#endif
+inline HMAC_CTX *HMAC_CTX_new(void) {
HMAC_CTX *ret = malloc(sizeof(*ret));
HMAC_CTX_init(ret);
return ret;
}
-static inline void HMAC_CTX_free(HMAC_CTX *ctx) {
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
+static
+#endif
+inline void HMAC_CTX_free(HMAC_CTX *ctx) {
HMAC_CTX_cleanup(ctx);
free(ctx);
}
--
2.22.0
_______________________________________________
openconnect-devel mailing list
openconnect-devel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/openconnect-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic