diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-17 17:37:55 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-17 17:37:55 -0800 |
commit | 729e62b0e19c2278da762af5f3fcc4e083747497 (patch) | |
tree | ff220545f7e9179302592dfa8a7f3e436f5a3624 | |
parent | 91eb796a30f48c176762db115dce22fa08ec28c6 (diff) | |
parent | d44d510cc4865957ae9b3d948add0ac1237e8fe8 (diff) | |
download | cryptography-729e62b0e19c2278da762af5f3fcc4e083747497.tar.gz cryptography-729e62b0e19c2278da762af5f3fcc4e083747497.tar.bz2 cryptography-729e62b0e19c2278da762af5f3fcc4e083747497.zip |
Merge pull request #266 from cyli/ssl_macros
Simple macros for ssl bindings for openssl
-rw-r--r-- | cryptography/hazmat/bindings/openssl/ssl.py | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py index 30f40c66..04611309 100644 --- a/cryptography/hazmat/bindings/openssl/ssl.py +++ b/cryptography/hazmat/bindings/openssl/ssl.py @@ -173,7 +173,43 @@ X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *); void SSL_SESSION_free(SSL_SESSION *); """ -MACROS = """ +MACROS = MACROS = """ +long SSL_set_mode(SSL *, long); +long SSL_get_mode(SSL *); + +long SSL_set_options(SSL *, long); +long SSL_get_options(SSL *); + +int SSL_want_read(const SSL *); +int SSL_want_write(const SSL *); + +int SSL_total_renegotiations(const 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_add_extra_chain_cert(SSL_CTX *, X509 *); + +/*- These aren't macros these functions are all const X on openssl > 1.0.x -*/ + +/* methods */ +const SSL_METHOD *SSLv3_method(); +const SSL_METHOD *SSLv3_server_method(); +const SSL_METHOD *SSLv3_client_method(); +const SSL_METHOD *TLSv1_method(); +const SSL_METHOD *TLSv1_server_method(); +const SSL_METHOD *TLSv1_client_method(); +const SSL_METHOD *SSLv23_method(); +const SSL_METHOD *SSLv23_server_method(); +const SSL_METHOD *SSLv23_client_method(); + +/*- These aren't macros these arguments are all const X on openssl > 1.0.x -*/ +SSL_CTX *SSL_CTX_new(const SSL_METHOD *); +long SSL_CTX_get_timeout(const SSL_CTX *); """ CUSTOMIZATIONS = """ |