aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2013-12-23 11:13:34 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2013-12-23 11:13:34 -0500
commit21a37548b5c1cd2df9f2e3e7131e4ae3d72c333a (patch)
treed0f57ba2effe6d874df97c60f5875a98b09698f9
parentaf09025900863a2a196eb67b1ec844a8626caa0c (diff)
downloadcryptography-21a37548b5c1cd2df9f2e3e7131e4ae3d72c333a.tar.gz
cryptography-21a37548b5c1cd2df9f2e3e7131e4ae3d72c333a.tar.bz2
cryptography-21a37548b5c1cd2df9f2e3e7131e4ae3d72c333a.zip
Try making SSL_MODE_RELEASE_BUFFERS conditional on whether the underlying OpenSSL library has this flag
-rw-r--r--cryptography/hazmat/backends/openssl/ssl.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/cryptography/hazmat/backends/openssl/ssl.py b/cryptography/hazmat/backends/openssl/ssl.py
index 168d5429..3af0074e 100644
--- a/cryptography/hazmat/backends/openssl/ssl.py
+++ b/cryptography/hazmat/backends/openssl/ssl.py
@@ -94,7 +94,6 @@ static const int SSL_CB_HANDSHAKE_DONE;
static const int SSL_MODE_ENABLE_PARTIAL_WRITE;
static const int SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
static const int SSL_MODE_AUTO_RETRY;
-static const int SSL_MODE_RELEASE_BUFFERS;
static const int SSL3_RANDOM_SIZE;
typedef ... X509_STORE_CTX;
static const int X509_V_OK;
@@ -263,6 +262,13 @@ void (*SSL_CTX_set_tlsext_servername_callback)(
SSL_CTX *,
int (*)(const SSL *, int *, void *)) = NULL;
#endif
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+static const int Cryptography_HAS_RELEASE_BUFFERS = 1;
+#else
+static const int Cryptography_HAS_RELEASE_BUFFERS = 0;
+const int SSL_MODE_RELEASE_BUFFERS = 0;
+#endif
"""
CONDITIONAL_NAMES = {
@@ -276,5 +282,10 @@ CONDITIONAL_NAMES = {
"SSL_set_tlsext_host_name",
"SSL_get_servername",
"SSL_CTX_set_tlsext_servername_callback",
- ]
+ ],
+
+ "Cryptography_HAS_RELEASE_BUFFERS": [
+ "SSL_MODE_RELEASE_BUFFERS",
+ ],
+
}