diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-03-13 18:03:00 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-03-13 18:03:00 -0400 |
commit | 2eb9378998969f11fccb3dfd507cf6242ae25116 (patch) | |
tree | bf46f76dbf1b3f1a5d5a6b125c5f7c5a0edb73c2 /src/_cffi_src/openssl | |
parent | dd2d24232bd0d84021c8d47e56245793b49253b8 (diff) | |
parent | 25b42b4d89b29336d04ee45d2291981cde26b20b (diff) | |
download | cryptography-2eb9378998969f11fccb3dfd507cf6242ae25116.tar.gz cryptography-2eb9378998969f11fccb3dfd507cf6242ae25116.tar.bz2 cryptography-2eb9378998969f11fccb3dfd507cf6242ae25116.zip |
Merge pull request #2808 from reaperhulk/110-patch-27
bind SSL_CTX_get_ssl_method
Diffstat (limited to 'src/_cffi_src/openssl')
-rw-r--r-- | src/_cffi_src/openssl/ssl.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py index 2fc86a31..a713a245 100644 --- a/src/_cffi_src/openssl/ssl.py +++ b/src/_cffi_src/openssl/ssl.py @@ -375,8 +375,6 @@ void (*SSL_CTX_get_info_callback(SSL_CTX *))(const SSL *, int, int); RHEL/CentOS 5 this can be moved back to FUNCTIONS. */ SSL_CTX *SSL_set_SSL_CTX(SSL *, SSL_CTX *); -const SSL_METHOD *Cryptography_SSL_CTX_get_method(const SSL_CTX *); - /* NPN APIs were introduced in OpenSSL 1.0.1. To continue to support earlier * versions some special handling of these is necessary. */ @@ -425,9 +423,21 @@ long SSL_get_server_tmp_key(SSL *, EVP_PKEY **); */ void SSL_CTX_set_cert_cb(SSL_CTX *, int (*)(SSL *, void *), void *); void SSL_set_cert_cb(SSL *, int (*)(SSL *, void *), void *); + +/* Added in 1.0.2 */ +const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *); """ CUSTOMIZATIONS = """ +/* Added in 1.0.2 but we need it in all versions now due to the great + opaquing. */ +#if OPENSSL_VERSION_NUMBER < 0x10002001L || defined(LIBRESSL_VERSION_NUMBER) +/* from ssl/ssl_lib.c */ +const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx) { + return ctx->method; +} +#endif + /** Secure renegotiation is supported in OpenSSL >= 0.9.8m * But some Linux distributions have back ported some features. */ @@ -568,11 +578,6 @@ static const long Cryptography_HAS_NETBSD_D1_METH = 1; static const long Cryptography_HAS_NETBSD_D1_METH = 1; #endif -/* Workaround for #794 caused by cffi const** bug. */ -const SSL_METHOD *Cryptography_SSL_CTX_get_method(const SSL_CTX *ctx) { - return ctx->method; -} - /* Because OPENSSL defines macros that claim lack of support for things, rather * than macros that claim support for things, we need to do a version check in * addition to a definition check. NPN was added in 1.0.1: for any version |