cc2f0349ccc3297f267d40db924a826f6e9dac8f
[feed/packages.git] /
1 From 07fb50eecc3a3a50ac543f53f98c285eb1ceeb1e Mon Sep 17 00:00:00 2001
2 From: Rosen Penev <rosenp@gmail.com>
3 Date: Mon, 25 Nov 2019 12:06:16 -0800
4 Subject: [PATCH] Add X509_STORE_CTX_trusted_stack compatibility macro
5
6 Deprecated in 1.1
7
8 Signed-off-by: Rosen Penev <rosenp@gmail.com>
9 ---
10 src/_cffi_src/openssl/x509_vfy.py | 17 ++++++++++++++++-
11 1 file changed, 16 insertions(+), 1 deletion(-)
12
13 diff --git a/src/_cffi_src/openssl/x509_vfy.py b/src/_cffi_src/openssl/x509_vfy.py
14 index a1730738..cd143ea0 100644
15 --- a/src/_cffi_src/openssl/x509_vfy.py
16 +++ b/src/_cffi_src/openssl/x509_vfy.py
17 @@ -157,8 +157,12 @@ int X509_STORE_CTX_init(X509_STORE_CTX *, X509_STORE *, X509 *,
18 Cryptography_STACK_OF_X509 *);
19 void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *,
20 Cryptography_STACK_OF_X509 *);
21 +void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *,
22 + Cryptography_STACK_OF_X509 *);
23 void X509_STORE_CTX_set_cert(X509_STORE_CTX *, X509 *);
24 -void X509_STORE_CTX_set_chain(X509_STORE_CTX *,Cryptography_STACK_OF_X509 *);
25 +void X509_STORE_CTX_set_chain(X509_STORE_CTX *, Cryptography_STACK_OF_X509 *);
26 +void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *,
27 + Cryptography_STACK_OF_X509 *);
28 X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *);
29 void X509_STORE_CTX_set0_param(X509_STORE_CTX *, X509_VERIFY_PARAM *);
30 int X509_STORE_CTX_set_default(X509_STORE_CTX *, const char *);
31 @@ -282,4 +286,15 @@ static const long Cryptography_HAS_X509_CB_ISSUER_CHECK = 0;
32 #else
33 static const long Cryptography_HAS_X509_CB_ISSUER_CHECK = 1;
34 #endif
35 +
36 +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 && !CRYPTOGRAPHY_IS_LIBRESSL
37 +#define X509_STORE_CTX_set0_trusted_stack X509_STORE_CTX_trusted_stack
38 +#define X509_STORE_CTX_set0_untrusted X509_STORE_CTX_set_chain
39 +#endif
40 +
41 +#if (OPENSSL_API_COMPAT >= 0x10100000L) && !CRYPTOGRAPHY_IS_LIBRESSL
42 +#define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
43 +#define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
44 +#define X509_STORE_CTX_get_chain X509_STORE_CTX_get1_chain
45 +#endif
46 """
47 --
48 2.26.2
49