[PATCH 1/2] Fix (non) static HMAC_CTX_* for LibreSSL 2.7+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Philipp Ammann <philipp.ammann@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/openconnect-devel



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux