aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/openssl
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@davidben.net>2018-01-12 21:32:29 +0100
committerAlex Gaynor <alex.gaynor@gmail.com>2018-01-12 15:32:29 -0500
commit2beccafe22c87a7b3feb6672aaa88d7b7f3a9fb1 (patch)
treec97f64715856eb23e4df49ffb836e85794512b08 /src/_cffi_src/openssl
parentba6798161c6782829dc27c1a087cd8a8781e07d8 (diff)
downloadcryptography-2beccafe22c87a7b3feb6672aaa88d7b7f3a9fb1.tar.gz
cryptography-2beccafe22c87a7b3feb6672aaa88d7b7f3a9fb1.tar.bz2
cryptography-2beccafe22c87a7b3feb6672aaa88d7b7f3a9fb1.zip
Use the real X509_REVOKED_dup when available. (#4080)
This avoids reaching into the ASN1_ITEM mess if not necessary.
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r--src/_cffi_src/openssl/x509.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py
index 394c37c5..ea7b84b6 100644
--- a/src/_cffi_src/openssl/x509.py
+++ b/src/_cffi_src/openssl/x509.py
@@ -376,7 +376,11 @@ int i2d_re_X509_tbs(X509 *x, unsigned char **pp)
IMPLEMENT_ASN1_DUP_FUNCTION. The below is the equivalent so we have
it available on all OpenSSLs. */
X509_REVOKED *Cryptography_X509_REVOKED_dup(X509_REVOKED *rev) {
+#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_102
return ASN1_item_dup(ASN1_ITEM_rptr(X509_REVOKED), rev);
+#else
+ return X509_REVOKED_dup(rev);
+#endif
}
/* Added in 1.1.0 but we need it in all versions now due to the great