From 3f2ce0d07afe9f0cf393a106f5d5113d6ec64e49 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 4 Dec 2021 21:30:04 +0000 Subject: [PATCH] telephony/baresip/re: fix build with opaque HMAC_CTX and BIO_METHOD in LibreSSL 3.5. --- telephony/baresip/re/Makefile | 4 ++- .../re/patches/patch-src_hmac_openssl_hmac_c | 27 +++++++++++++++++++ .../re/patches/patch-src_tls_openssl_tls_h | 18 +++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 telephony/baresip/re/patches/patch-src_hmac_openssl_hmac_c create mode 100644 telephony/baresip/re/patches/patch-src_tls_openssl_tls_h diff --git a/telephony/baresip/re/Makefile b/telephony/baresip/re/Makefile index c67c5f43954..766a7555662 100644 --- a/telephony/baresip/re/Makefile +++ b/telephony/baresip/re/Makefile @@ -1,10 +1,12 @@ -# $OpenBSD: Makefile,v 1.22 2021/06/15 06:51:31 landry Exp $ +# $OpenBSD: Makefile,v 1.23 2021/12/04 21:30:04 tb Exp $ COMMENT = portable library for real-time communications GH_ACCOUNT = baresip GH_PROJECT = re GH_TAGNAME = v2.0.1 +REVISION = 0 + SHARED_LIBS = re 6.0 CATEGORIES += devel diff --git a/telephony/baresip/re/patches/patch-src_hmac_openssl_hmac_c b/telephony/baresip/re/patches/patch-src_hmac_openssl_hmac_c new file mode 100644 index 00000000000..00151fab7a4 --- /dev/null +++ b/telephony/baresip/re/patches/patch-src_hmac_openssl_hmac_c @@ -0,0 +1,27 @@ +$OpenBSD: patch-src_hmac_openssl_hmac_c,v 1.1 2021/12/04 21:30:04 tb Exp $ + +Fix build with opaque HMAC_CTX in LibreSSL 3.5. + +Index: src/hmac/openssl/hmac.c +--- src/hmac/openssl/hmac.c.orig ++++ src/hmac/openssl/hmac.c +@@ -20,8 +20,7 @@ static void destructor(void *arg) + { + struct hmac *hmac = arg; + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ +- !defined(LIBRESSL_VERSION_NUMBER) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L + + if (hmac->ctx) + HMAC_CTX_free(hmac->ctx); +@@ -61,8 +60,7 @@ int hmac_create(struct hmac **hmacp, enum hmac_hash ha + if (!hmac) + return ENOMEM; + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ +- !defined(LIBRESSL_VERSION_NUMBER) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L + + hmac->ctx = HMAC_CTX_new(); + if (!hmac->ctx) { diff --git a/telephony/baresip/re/patches/patch-src_tls_openssl_tls_h b/telephony/baresip/re/patches/patch-src_tls_openssl_tls_h new file mode 100644 index 00000000000..2ccb60375b8 --- /dev/null +++ b/telephony/baresip/re/patches/patch-src_tls_openssl_tls_h @@ -0,0 +1,18 @@ +$OpenBSD: patch-src_tls_openssl_tls_h,v 1.1 2021/12/04 21:30:04 tb Exp $ + +Fix build with opaque BIO_METHOD in LibreSSL 3.5. + +Index: src/tls/openssl/tls.h +--- src/tls/openssl/tls.h.orig ++++ src/tls/openssl/tls.h +@@ -17,10 +17,6 @@ + #define TLS_BIO_OPAQUE 1 + #endif + +-#if defined (LIBRESSL_VERSION_NUMBER) +-#undef TLS_BIO_OPAQUE +-#endif +- + + #if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ + !defined(LIBRESSL_VERSION_NUMBER)