diff options
| author | Rosen Penev <rosenp@gmail.com> | 2020-07-26 15:59:01 -0700 |
|---|---|---|
| committer | Rosen Penev <rosenp@gmail.com> | 2020-09-20 18:33:58 -0700 |
| commit | fcd9812bfd1f06c299e9f3c95d4d1265264b36cf (patch) | |
| tree | 75bc9d7a64600599499749acd602e211ff1c82e2 /lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch | |
| parent | e00cf5c306e01f7e71fd49fcb5889aa94da6d8e5 (diff) | |
python-cryptography: fix compilation without deprecated OpenSSL APIs
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch')
| -rw-r--r-- | lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch b/lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch new file mode 100644 index 000000000..0a637dc7c --- /dev/null +++ b/lang/python/python-cryptography/patches/010-Add-new-ASN1_STRING_get0_data-API.patch @@ -0,0 +1,37 @@ +From 1d97b931bf4701fbd3478d2b788ec4310d9eb8e1 Mon Sep 17 00:00:00 2001 +From: Rosen Penev <rosenp@gmail.com> +Date: Fri, 7 Jun 2019 18:18:46 -0700 +Subject: [PATCH] Add new ASN1_STRING_get0_data API + +Introduced with OpenSSL 1.1 +--- + src/_cffi_src/openssl/asn1.py | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/_cffi_src/openssl/asn1.py b/src/_cffi_src/openssl/asn1.py +index da55b670..85cd58bd 100644 +--- a/src/_cffi_src/openssl/asn1.py ++++ b/src/_cffi_src/openssl/asn1.py +@@ -45,6 +45,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *); + + /* ASN1 STRING */ + unsigned char *ASN1_STRING_data(ASN1_STRING *); ++const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *); + int ASN1_STRING_set(ASN1_STRING *, const void *, int); + + /* ASN1 OCTET STRING */ +@@ -105,4 +106,11 @@ ASN1_NULL *ASN1_NULL_new(void); + """ + + CUSTOMIZATIONS = """ ++#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 && !CRYPTOGRAPHY_LIBRESSL_27_OR_GREATER ++#define ASN1_STRING_get0_data ASN1_STRING_data ++#endif ++ ++#if (OPENSSL_API_COMPAT >= 0x10100000L) && !CRYPTOGRAPHY_IS_LIBRESSL ++#define ASN1_STRING_data ASN1_STRING_get0_data ++#endif + """ +-- +2.26.2 + |
