diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-11-19 14:27:30 +0800 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2016-11-19 01:27:30 -0500 |
commit | e3352d2fa559d0c672481a7b7993b1a3a34b5bb5 (patch) | |
tree | 57783f71763e1790336aea1c2b4802b5af8545d9 | |
parent | 10a602f62248482674a8c758e4266797bd132616 (diff) | |
download | cryptography-e3352d2fa559d0c672481a7b7993b1a3a34b5bb5.tar.gz cryptography-e3352d2fa559d0c672481a7b7993b1a3a34b5bb5.tar.bz2 cryptography-e3352d2fa559d0c672481a7b7993b1a3a34b5bb5.zip |
add some x509_object handling for pypy stdlib (#3254)
-rw-r--r-- | src/_cffi_src/openssl/cryptography.py | 2 | ||||
-rw-r--r-- | src/_cffi_src/openssl/x509_vfy.py | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py index 6d91d278..373f830e 100644 --- a/src/_cffi_src/openssl/cryptography.py +++ b/src/_cffi_src/openssl/cryptography.py @@ -40,6 +40,8 @@ INCLUDES = """ (OPENSSL_VERSION_NUMBER < 0x10100004) #define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 \ (OPENSSL_VERSION_NUMBER < 0x10100005) +#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE6 \ + (OPENSSL_VERSION_NUMBER < 0x10100006) #if defined(LIBRESSL_VERSION_NUMBER) #define CRYPTOGRAPHY_IS_LIBRESSL 1 diff --git a/src/_cffi_src/openssl/x509_vfy.py b/src/_cffi_src/openssl/x509_vfy.py index 300b2a97..cf2d7d7d 100644 --- a/src/_cffi_src/openssl/x509_vfy.py +++ b/src/_cffi_src/openssl/x509_vfy.py @@ -15,6 +15,7 @@ INCLUDES = """ * Note that the result is an opaque type. */ typedef STACK_OF(ASN1_OBJECT) Cryptography_STACK_OF_ASN1_OBJECT; +typedef STACK_OF(X509_OBJECT) Cryptography_STACK_OF_X509_OBJECT; """ TYPES = """ @@ -24,7 +25,9 @@ static const long Cryptography_HAS_X509_V_FLAG_TRUSTED_FIRST; static const long Cryptography_HAS_X509_V_FLAG_PARTIAL_CHAIN; typedef ... Cryptography_STACK_OF_ASN1_OBJECT; +typedef ... Cryptography_STACK_OF_X509_OBJECT; +typedef ... X509_OBJECT; typedef ... X509_STORE; typedef ... X509_VERIFY_PARAM; typedef ... X509_STORE_CTX; @@ -119,6 +122,9 @@ static const long X509_V_FLAG_SUITEB_128_LOS_ONLY; static const long X509_V_FLAG_SUITEB_192_LOS; static const long X509_V_FLAG_SUITEB_128_LOS; static const long X509_V_FLAG_PARTIAL_CHAIN; + +static const long X509_LU_X509; +static const long X509_LU_CRL; """ FUNCTIONS = """ @@ -193,6 +199,10 @@ int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *, const char *, int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *, const unsigned char *, size_t); int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *, const char *); + +Cryptography_STACK_OF_X509_OBJECT *X509_STORE_get0_objects(X509_STORE *); +X509 *X509_OBJECT_get0_X509(X509_OBJECT *); +int X509_OBJECT_get_type(const X509_OBJECT *); """ CUSTOMIZATIONS = """ @@ -251,4 +261,22 @@ static const long Cryptography_HAS_X509_V_FLAG_TRUSTED_FIRST = 1; static const long Cryptography_HAS_X509_V_FLAG_TRUSTED_FIRST = 0; static const long X509_V_FLAG_TRUSTED_FIRST = 0; #endif + +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE6 || defined(LIBRESSL_VERSION_NUMBER) +Cryptography_STACK_OF_X509_OBJECT *X509_STORE_get0_objects(X509_STORE *ctx) { + return ctx->objs; +} +X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *store) { + return store->param; +} +int X509_OBJECT_get_type(const X509_OBJECT *x) { + return x->type; +} +#endif + +#if CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 || defined(LIBRESSL_VERSION_NUMBER) +X509 *X509_OBJECT_get0_X509(X509_OBJECT *x) { + return x->data.x509; +} +#endif """ |