aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-04-22 08:28:52 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-04-22 08:28:52 +0100
commita33dd28e1b4412695bc72ba1c888ca616852eac6 (patch)
tree1bf441590195aa2be60887437b2442244aeda1d0 /cryptography
parent30752cdde9c149ede7c3eec5aea4e72944d99ac4 (diff)
parent704f2f382f3a6385ce5f0f728168590b7ac53a3d (diff)
downloadcryptography-a33dd28e1b4412695bc72ba1c888ca616852eac6.tar.gz
cryptography-a33dd28e1b4412695bc72ba1c888ca616852eac6.tar.bz2
cryptography-a33dd28e1b4412695bc72ba1c888ca616852eac6.zip
Merge pull request #944 from reaperhulk/fix-773
fix SSL_OP_ALL being unusable on Windows due to long being 32-bit signed
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/bindings/openssl/ssl.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py
index 094310f3..7ed42f9f 100644
--- a/cryptography/hazmat/bindings/openssl/ssl.py
+++ b/cryptography/hazmat/bindings/openssl/ssl.py
@@ -237,26 +237,28 @@ size_t SSL_get_peer_finished(const SSL *, void *, size_t);
"""
MACROS = """
-long SSL_set_mode(SSL *, long);
-long SSL_get_mode(SSL *);
+unsigned long SSL_set_mode(SSL *, unsigned long);
+unsigned long SSL_get_mode(SSL *);
-long SSL_set_options(SSL *, long);
-long SSL_get_options(SSL *);
+unsigned long SSL_set_options(SSL *, unsigned long);
+unsigned long SSL_get_options(SSL *);
int SSL_want_read(const SSL *);
int SSL_want_write(const SSL *);
long SSL_total_renegotiations(SSL *);
-long SSL_CTX_set_options(SSL_CTX *, long);
-long SSL_CTX_get_options(SSL_CTX *);
-long SSL_CTX_set_mode(SSL_CTX *, long);
-long SSL_CTX_get_mode(SSL_CTX *);
-long SSL_CTX_set_session_cache_mode(SSL_CTX *, long);
-long SSL_CTX_get_session_cache_mode(SSL_CTX *);
-long SSL_CTX_set_tmp_dh(SSL_CTX *, DH *);
-long SSL_CTX_set_tmp_ecdh(SSL_CTX *, EC_KEY *);
-long SSL_CTX_add_extra_chain_cert(SSL_CTX *, X509 *);
+/* Defined as unsigned long because SSL_OP_ALL is greater than signed 32-bit
+ and Windows defines long as 32-bit. */
+unsigned long SSL_CTX_set_options(SSL_CTX *, unsigned long);
+unsigned long SSL_CTX_get_options(SSL_CTX *);
+unsigned long SSL_CTX_set_mode(SSL_CTX *, unsigned long);
+unsigned long SSL_CTX_get_mode(SSL_CTX *);
+unsigned long SSL_CTX_set_session_cache_mode(SSL_CTX *, unsigned long);
+unsigned long SSL_CTX_get_session_cache_mode(SSL_CTX *);
+unsigned long SSL_CTX_set_tmp_dh(SSL_CTX *, DH *);
+unsigned long SSL_CTX_set_tmp_ecdh(SSL_CTX *, EC_KEY *);
+unsigned long SSL_CTX_add_extra_chain_cert(SSL_CTX *, X509 *);
/*- These aren't macros these functions are all const X on openssl > 1.0.x -*/