From 97511e5b8d8169096b48ff73ecce7d973129cf87 Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Fri, 8 Apr 2016 23:19:22 +0200 Subject: Add more bindings to OpenSSL, to be used by the Python _ssl module. (#2868) * Add more bindings to OpenSSL, all are used by the Python _ssl module. * Add a conditional: SSL_CTX_clear_options() does not exist before 0.9.8m * 80 cols * Condionally define the TLSEXT error codes. * Address review comments * Remove all parameter names --- src/_cffi_src/openssl/err.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/_cffi_src/openssl/err.py') diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py index d0211c34..4c7870aa 100644 --- a/src/_cffi_src/openssl/err.py +++ b/src/_cffi_src/openssl/err.py @@ -13,6 +13,7 @@ static const int Cryptography_HAS_REMOVE_THREAD_STATE; static const int Cryptography_HAS_098H_ERROR_CODES; static const int Cryptography_HAS_098C_CAMELLIA_CODES; static const int Cryptography_HAS_EC_CODES; +static const int Cryptography_HAS_TLSEXT_ERROR_CODES; static const int Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR; struct ERR_string_data_st { @@ -28,6 +29,8 @@ static const int ERR_LIB_PEM; static const int ERR_LIB_ASN1; static const int ERR_LIB_RSA; static const int ERR_LIB_PKCS12; +static const int ERR_LIB_SSL; +static const int ERR_LIB_X509; static const int ASN1_F_ASN1_ENUMERATED_TO_BN; static const int ASN1_F_ASN1_EX_C2I; @@ -224,6 +227,15 @@ static const int RSA_R_BLOCK_TYPE_IS_NOT_02; static const int RSA_R_PKCS_DECODING_ERROR; static const int RSA_R_OAEP_DECODING_ERROR; static const int RSA_F_RSA_SIGN; + +static const int SSL_TLSEXT_ERR_OK; +static const int SSL_TLSEXT_ERR_ALERT_WARNING; +static const int SSL_TLSEXT_ERR_ALERT_FATAL; +static const int SSL_TLSEXT_ERR_NOACK; + +static const int SSL_AD_INTERNAL_ERROR; +static const int SSL_AD_ACCESS_DENIED; +static const int SSL_AD_HANDSHAKE_FAILURE; """ FUNCTIONS = """ @@ -319,6 +331,16 @@ static const int EC_R_UNKNOWN_GROUP = 0; static const int EC_F_EC_GROUP_NEW_BY_CURVE_NAME = 0; #endif +#ifdef SSL_TLSEXT_ERR_OK +static const int Cryptography_HAS_TLSEXT_ERROR_CODES = 1; +#else +static const int Cryptography_HAS_TLSEXT_ERROR_CODES = 0; +static const int SSL_TLSEXT_ERR_OK = 0; +static const int SSL_TLSEXT_ERR_ALERT_WARNING = 0; +static const int SSL_TLSEXT_ERR_ALERT_FATAL = 0; +static const int SSL_TLSEXT_ERR_NOACK = 0; +#endif + #ifdef RSA_R_PKCS_DECODING_ERROR static const long Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR = 1; #else -- cgit v1.2.3