From e85fceec5a7d3aab7b47225de65066a02b1874d7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 29 Nov 2017 20:42:44 +0800 Subject: [PATCH] Backport x509_up_ref (#4029) * pytest 3.3.0 has an issue with parametrized null bytes again (#4026) * add X509_up_ref (#4028) --- setup.py | 2 +- src/_cffi_src/openssl/x509.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 82c4bf5bb031..c79106f19498 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ setup_requirements.append("cffi>=1.7") test_requirements = [ - "pytest>=3.2.1", + "pytest>=3.2.1,!=3.3.0", "pretend", "iso8601", "pytz", diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py index e7619dd6038f..394c37c5e88c 100644 --- a/src/_cffi_src/openssl/x509.py +++ b/src/_cffi_src/openssl/x509.py @@ -83,6 +83,7 @@ void X509_free(X509 *); X509 *X509_dup(X509 *); int X509_cmp(const X509 *, const X509 *); +int X509_up_ref(X509 *); int X509_print_ex(BIO *, X509 *, unsigned long, unsigned long); @@ -382,6 +383,10 @@ opaquing. */ #if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 +int X509_up_ref(X509 *x) { + return CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); +} + const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x) { return x->cert_info->signature;