aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-22 08:32:32 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-22 08:32:32 -0700
commiteaeed6ce3d2f3cfee804684c53fc35c54e0a569e (patch)
tree15c408af677e975b8cc571aefa11d09df5e3b4de
parentece315ad8db9aca9047aefaf99a27c421617f98e (diff)
parentedd6ca7ae430ecea0cd98c9e21cdaacc7037de29 (diff)
downloadcryptography-eaeed6ce3d2f3cfee804684c53fc35c54e0a569e.tar.gz
cryptography-eaeed6ce3d2f3cfee804684c53fc35c54e0a569e.tar.bz2
cryptography-eaeed6ce3d2f3cfee804684c53fc35c54e0a569e.zip
Merge pull request #841 from public/ssl-ctx-method
Add SSL_CTX method getter to fix #794
-rw-r--r--cryptography/hazmat/bindings/openssl/ssl.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index b4319e8b..eb1f018b 100644
--- a/cryptography/hazmat/bindings/openssl/ssl.py
+++ b/cryptography/hazmat/bindings/openssl/ssl.py
@@ -127,7 +127,6 @@ typedef ... SSL_METHOD;
typedef struct ssl_st {
int version;
int type;
- const SSL_METHOD *method;
...;
} SSL_CTX;
@@ -319,6 +318,8 @@ void (*SSL_CTX_get_info_callback(SSL_CTX *))(const SSL *, int, int);
/* This function does not exist in 0.9.8e. Once we drop support for
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*);
"""
CUSTOMIZATIONS = """
@@ -420,6 +421,11 @@ static const long Cryptography_HAS_NETBSD_D1_METH = 1;
#else
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;
+}
"""
CONDITIONAL_NAMES = {