diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-11-12 15:47:40 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-11-12 15:51:33 -0600 |
commit | a40a83a933b506a9b8ff818ff82f3f74136c61e4 (patch) | |
tree | 40e437f46692f1722858a864db99856e175ce168 | |
parent | 747ef464bf87a70a12ce2236c5408a7a0440cc44 (diff) | |
download | cryptography-a40a83a933b506a9b8ff818ff82f3f74136c61e4.tar.gz cryptography-a40a83a933b506a9b8ff818ff82f3f74136c61e4.tar.bz2 cryptography-a40a83a933b506a9b8ff818ff82f3f74136c61e4.zip |
these functions were added in 1.0.0, while CMS was added in 0.9.8h
We didn't catch this in our CI because all our 0.9.8 targets have CMS
disabled or are older than 0.9.8h
-rw-r--r-- | src/_cffi_src/openssl/cms.py | 10 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/_conditional.py | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/cms.py b/src/_cffi_src/openssl/cms.py index f0da82dd..a1b0b15b 100644 --- a/src/_cffi_src/openssl/cms.py +++ b/src/_cffi_src/openssl/cms.py @@ -17,6 +17,7 @@ INCLUDES = """ TYPES = """ static const long Cryptography_HAS_CMS; +static const long Cryptography_HAS_MORE_CMS; typedef ... CMS_ContentInfo; typedef ... CMS_SignerInfo; @@ -115,4 +116,13 @@ int (*CMS_decrypt)(CMS_ContentInfo *, EVP_PKEY *, X509 *, BIO *, BIO *, CMS_SignerInfo *(*CMS_add1_signer)(CMS_ContentInfo *, X509 *, EVP_PKEY *, const EVP_MD *, unsigned int) = NULL; #endif +#if !defined(OPENSSL_NO_CMS) && OPENSSL_VERSION_NUMBER < 0x1000000fL +static const long Cryptography_HAS_MORE_CMS = 0; +/* These functions were added in 1.0.0 */ +BIO *(*BIO_new_CMS)(BIO *, CMS_ContentInfo *) = NULL; +int (*i2d_CMS_bio_stream)(BIO *, CMS_ContentInfo *, BIO *, int) = NULL; +int (*PEM_write_bio_CMS_stream)(BIO *, CMS_ContentInfo *, BIO *, int) = NULL; +#else +static const long Cryptography_HAS_MORE_CMS = 1; +#endif """ diff --git a/src/cryptography/hazmat/bindings/openssl/_conditional.py b/src/cryptography/hazmat/bindings/openssl/_conditional.py index 670710b1..93f5898f 100644 --- a/src/cryptography/hazmat/bindings/openssl/_conditional.py +++ b/src/cryptography/hazmat/bindings/openssl/_conditional.py @@ -52,6 +52,11 @@ CONDITIONAL_NAMES = { "CMS_USE_KEYID", "CMS_DEBUG_DECRYPT", ], + "Cryptography_HAS_MORE_CMS": [ + "BIO_new_CMS", + "i2d_CMS_bio_stream", + "PEM_write_bio_CMS_stream", + ], "Cryptography_HAS_EC": [ "OPENSSL_EC_NAMED_CURVE", "EC_GROUP_new", |