diff options
author | Treeve Jelbert | 2019-08-26 16:36:06 +0200 |
---|---|---|
committer | Treeve Jelbert | 2019-08-26 16:36:06 +0200 |
commit | c6bdfc2479a0f3d649b7799d7e340b6ff3297a19 (patch) | |
tree | d3b721164957d0d8bb8e77ecf9d013cf99049bf4 /python-pypi | |
parent | eb18ce644699796b688511988521f9b8a1e96ebb (diff) |
m2crypto - libressl fix
Diffstat (limited to 'python-pypi')
-rw-r--r-- | python-pypi/m2crypto/HISTORY | 3 | ||||
-rwxr-xr-x | python-pypi/m2crypto/PRE_BUILD | 3 | ||||
-rw-r--r-- | python-pypi/m2crypto/patches/0001-fix-BIO_get_init-usage.patch | 57 | ||||
-rw-r--r-- | python-pypi/m2crypto/patches/0002-fix-OPENSSL_zalloc-usage.patch | 25 |
4 files changed, 88 insertions, 0 deletions
diff --git a/python-pypi/m2crypto/HISTORY b/python-pypi/m2crypto/HISTORY index b6b3678db9..93a5a6e271 100644 --- a/python-pypi/m2crypto/HISTORY +++ b/python-pypi/m2crypto/HISTORY @@ -1,3 +1,6 @@ +2019-08-25 Treeve Jelbert <treeve@sourcemage.org> + * PRE_BUILD patches/*: added, fix for libressl + 2019-06-11 Treeve Jelbert <treeve@sourcemage.org> * DETAILS: version 0.35.2 diff --git a/python-pypi/m2crypto/PRE_BUILD b/python-pypi/m2crypto/PRE_BUILD new file mode 100755 index 0000000000..922c0ab256 --- /dev/null +++ b/python-pypi/m2crypto/PRE_BUILD @@ -0,0 +1,3 @@ +default_pre_build && +cd $SOURCE_DIRECTORY && +apply_patch_dir patches diff --git a/python-pypi/m2crypto/patches/0001-fix-BIO_get_init-usage.patch b/python-pypi/m2crypto/patches/0001-fix-BIO_get_init-usage.patch new file mode 100644 index 0000000000..06109c6e28 --- /dev/null +++ b/python-pypi/m2crypto/patches/0001-fix-BIO_get_init-usage.patch @@ -0,0 +1,57 @@ +From b993907bf6f290235c8f196d9bb6ff4561ea5100 Mon Sep 17 00:00:00 2001 +From: Treeve Jelbert <treeve@sourcemage.org> +Date: Mon, 22 Oct 2018 11:49:22 +0200 +Subject: [PATCH 1/2] fix BIO_get_init usage + +--- + SWIG/_bio.i | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/SWIG/_bio.i b/SWIG/_bio.i +index e85a275..f6eebbe 100644 +--- a/SWIG/_bio.i ++++ b/SWIG/_bio.i +@@ -325,7 +325,9 @@ BIO_meth_free( BIO_METHOD *meth ) + #define BIO_set_shutdown(b, x) (b)->shutdown = x + #define BIO_get_shutdown(b) (b)->shutdown + #define BIO_set_init(b, x) b->init = x ++#ifndef LIBRESSL_VERSION_NUMBER + #define BIO_get_init(b) (b)->init ++#endif + #define BIO_set_data(b, x) b->ptr = x + #define BIO_clear_flags(b, x) b->flags &= ~(x) + #define BIO_get_data(b) b->ptr +@@ -442,9 +444,13 @@ static int pyfd_free(BIO* b) { + ctx = BIO_get_data(b); + if (ctx == NULL) + return 0; +- ++#ifndef LIBRESSL_VERSION_NUMBER + if (BIO_get_shutdown(b) && BIO_get_init(b)) + close(ctx->fd); ++#else ++ if (BIO_get_shutdown(b)) ++ close(ctx->fd); ++#endif + + BIO_set_data(b, NULL); + BIO_set_shutdown(b, 0); +@@ -484,6 +490,7 @@ static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) { + BIO_set_init(b, 1); + } + break; ++#ifndef LIBRESSL_VERSION_NUMBER + case BIO_C_GET_FD: + if (BIO_get_init(b)) { + ip = (int *)ptr; +@@ -493,6 +500,7 @@ static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) { + } else + ret = -1; + break; ++#endif + case BIO_CTRL_GET_CLOSE: + ret = BIO_get_shutdown(b); + break; +-- +2.23.0 + diff --git a/python-pypi/m2crypto/patches/0002-fix-OPENSSL_zalloc-usage.patch b/python-pypi/m2crypto/patches/0002-fix-OPENSSL_zalloc-usage.patch new file mode 100644 index 0000000000..cbb9c2ec63 --- /dev/null +++ b/python-pypi/m2crypto/patches/0002-fix-OPENSSL_zalloc-usage.patch @@ -0,0 +1,25 @@ +From 5c6fbf1d8080ab56483e85bf8e2d314dcd124809 Mon Sep 17 00:00:00 2001 +From: Treeve Jelbert <treeve@sourcemage.org> +Date: Mon, 22 Oct 2018 11:54:38 +0200 +Subject: [PATCH 2/2] fix OPENSSL_zalloc usage + +--- + SWIG/_lib11_compat.i | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SWIG/_lib11_compat.i b/SWIG/_lib11_compat.i +index 1ec42dd..b781952 100644 +--- a/SWIG/_lib11_compat.i ++++ b/SWIG/_lib11_compat.i +@@ -8,7 +8,7 @@ + */ + + %{ +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) + + #include <string.h> + #include <openssl/engine.h> +-- +2.23.0 + |