class SimpleCConfig: """ Definitions for basic types defined by zlib. """ _compilation_info_ = eci # XXX If Z_PREFIX was defined for the libz build, then these types are # named z_uInt, z_uLong, and z_Bytef instead. uInt = rffi_platform.SimpleType('uInt', rffi.UINT) uLong = rffi_platform.SimpleType('uLong', rffi.ULONG) Bytef = rffi_platform.SimpleType('Bytef', rffi.UCHAR) voidpf = rffi_platform.SimpleType('voidpf', rffi.VOIDP) ZLIB_VERSION = rffi_platform.DefinedConstantString('ZLIB_VERSION')
class CConfig: _compilation_info_ = eci RPYTHREAD_NAME = rffi_platform.DefinedConstantString('RPYTHREAD_NAME') USE_SEMAPHORES = rffi_platform.Defined('USE_SEMAPHORES') CS_GNU_LIBPTHREAD_VERSION = rffi_platform.DefinedConstantInteger( '_CS_GNU_LIBPTHREAD_VERSION')
class CConfig: _compilation_info_ = eci OPENSSL_VERSION_NUMBER = rffi_platform.ConstantInteger( "OPENSSL_VERSION_NUMBER") SSLEAY_VERSION = rffi_platform.DefinedConstantString( "SSLEAY_VERSION", "SSLeay_version(SSLEAY_VERSION)") OPENSSL_NO_SSL2 = rffi_platform.Defined("OPENSSL_NO_SSL2") OPENSSL_NO_SSL3 = rffi_platform.Defined("OPENSSL_NO_SSL3") SSL_FILETYPE_PEM = rffi_platform.ConstantInteger("SSL_FILETYPE_PEM") SSL_OP_ALL = rffi_platform.ConstantInteger("SSL_OP_ALL") SSL_OP_NO_SSLv2 = rffi_platform.ConstantInteger("SSL_OP_NO_SSLv2") SSL_OP_NO_SSLv3 = rffi_platform.ConstantInteger("SSL_OP_NO_SSLv3") SSL_OP_NO_TLSv1 = rffi_platform.ConstantInteger("SSL_OP_NO_TLSv1") SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = rffi_platform.ConstantInteger( "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS") HAS_SNI = rffi_platform.Defined("SSL_CTRL_SET_TLSEXT_HOSTNAME") SSL_VERIFY_NONE = rffi_platform.ConstantInteger("SSL_VERIFY_NONE") SSL_VERIFY_PEER = rffi_platform.ConstantInteger("SSL_VERIFY_PEER") SSL_VERIFY_FAIL_IF_NO_PEER_CERT = rffi_platform.ConstantInteger( "SSL_VERIFY_FAIL_IF_NO_PEER_CERT") SSL_ERROR_WANT_READ = rffi_platform.ConstantInteger("SSL_ERROR_WANT_READ") SSL_ERROR_WANT_WRITE = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_WRITE") SSL_ERROR_ZERO_RETURN = rffi_platform.ConstantInteger( "SSL_ERROR_ZERO_RETURN") SSL_ERROR_WANT_X509_LOOKUP = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_X509_LOOKUP") SSL_ERROR_WANT_CONNECT = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_CONNECT") SSL_ERROR_SYSCALL = rffi_platform.ConstantInteger("SSL_ERROR_SYSCALL") SSL_ERROR_SSL = rffi_platform.ConstantInteger("SSL_ERROR_SSL") SSL_RECEIVED_SHUTDOWN = rffi_platform.ConstantInteger( "SSL_RECEIVED_SHUTDOWN") SSL_MODE_AUTO_RETRY = rffi_platform.ConstantInteger("SSL_MODE_AUTO_RETRY") SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = rffi_platform.ConstantInteger( "SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER") NID_subject_alt_name = rffi_platform.ConstantInteger( "NID_subject_alt_name") GEN_DIRNAME = rffi_platform.ConstantInteger("GEN_DIRNAME") GEN_EMAIL = rffi_platform.ConstantInteger("GEN_EMAIL") GEN_DNS = rffi_platform.ConstantInteger("GEN_DNS") GEN_URI = rffi_platform.ConstantInteger("GEN_URI") GEN_OTHERNAME = rffi_platform.ConstantInteger("GEN_OTHERNAME") GEN_X400 = rffi_platform.ConstantInteger("GEN_X400") GEN_EDIPARTY = rffi_platform.ConstantInteger("GEN_EDIPARTY") GEN_IPADD = rffi_platform.ConstantInteger("GEN_IPADD") GEN_RID = rffi_platform.ConstantInteger("GEN_RID") CRYPTO_LOCK = rffi_platform.ConstantInteger("CRYPTO_LOCK") OBJ_NAME_TYPE_MD_METH = rffi_platform.ConstantInteger( "OBJ_NAME_TYPE_MD_METH") # Some structures, with only the fields used in the _ssl module X509_name_entry_st = rffi_platform.Struct('struct X509_name_entry_st', [('set', rffi.INT)]) asn1_string_st = rffi_platform.Struct('struct asn1_string_st', [('length', rffi.INT), ('data', rffi.CCHARP)]) X509_extension_st = rffi_platform.Struct('struct X509_extension_st', [('value', ASN1_STRING)]) X509V3_EXT_D2I = lltype.FuncType([rffi.VOIDP, rffi.CCHARPP, rffi.LONG], rffi.VOIDP) v3_ext_method = rffi_platform.Struct('struct v3_ext_method', [('it', ASN1_ITEM_EXP), ('d2i', lltype.Ptr(X509V3_EXT_D2I))]) GENERAL_NAME_st = rffi_platform.Struct('struct GENERAL_NAME_st', [('type', rffi.INT)]) EVP_MD_st = rffi_platform.Struct('EVP_MD', [('md_size', rffi.INT), ('block_size', rffi.INT)]) EVP_MD_SIZE = rffi_platform.SizeOf('EVP_MD') EVP_MD_CTX_SIZE = rffi_platform.SizeOf('EVP_MD_CTX') OBJ_NAME_st = rffi_platform.Struct('OBJ_NAME', [ ('alias', rffi.INT), ('name', rffi.CCHARP), ])
class CConfig: _compilation_info_ = eci SSLEAY_VERSION = rffi_platform.DefinedConstantString( "SSLEAY_VERSION", "SSLeay_version(SSLEAY_VERSION)") OPENSSL_NO_SSL2 = rffi_platform.Defined("OPENSSL_NO_SSL2") OPENSSL_NO_SSL3 = rffi_platform.Defined("OPENSSL_NO_SSL3") OPENSSL_NO_ECDH = rffi_platform.Defined("OPENSSL_NO_ECDH") OPENSSL_NPN_NEGOTIATED = rffi_platform.Defined("OPENSSL_NPN_NEGOTIATED") SSL_FILETYPE_PEM = rffi_platform.ConstantInteger("SSL_FILETYPE_PEM") SSL_FILETYPE_ASN1 = rffi_platform.ConstantInteger("SSL_FILETYPE_ASN1") SSL_OP_ALL = rffi_platform.ConstantInteger("SSL_OP_ALL") SSL_OP_NO_SSLv2 = rffi_platform.ConstantInteger("SSL_OP_NO_SSLv2") SSL_OP_NO_SSLv3 = rffi_platform.ConstantInteger("SSL_OP_NO_SSLv3") SSL_OP_NO_TLSv1 = rffi_platform.ConstantInteger("SSL_OP_NO_TLSv1") if HAVE_TLSv1_2: SSL_OP_NO_TLSv1_1 = rffi_platform.ConstantInteger("SSL_OP_NO_TLSv1_1") SSL_OP_NO_TLSv1_2 = rffi_platform.ConstantInteger("SSL_OP_NO_TLSv1_2") OPENSSL_NO_TLSEXT = rffi_platform.Defined("OPENSSL_NO_TLSEXT") SSL_OP_CIPHER_SERVER_PREFERENCE = rffi_platform.ConstantInteger( "SSL_OP_CIPHER_SERVER_PREFERENCE") SSL_OP_SINGLE_DH_USE = rffi_platform.ConstantInteger( "SSL_OP_SINGLE_DH_USE") SSL_OP_SINGLE_ECDH_USE = rffi_platform.ConstantInteger( "SSL_OP_SINGLE_ECDH_USE") SSL_OP_NO_COMPRESSION = rffi_platform.DefinedConstantInteger( "SSL_OP_NO_COMPRESSION") SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = rffi_platform.ConstantInteger( "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS") HAS_SNI = rffi_platform.Defined("SSL_CTRL_SET_TLSEXT_HOSTNAME") HAS_NPN = rffi_platform.Defined("OPENSSL_NPN_NEGOTIATED") SSL_VERIFY_NONE = rffi_platform.ConstantInteger("SSL_VERIFY_NONE") SSL_VERIFY_PEER = rffi_platform.ConstantInteger("SSL_VERIFY_PEER") SSL_VERIFY_FAIL_IF_NO_PEER_CERT = rffi_platform.ConstantInteger( "SSL_VERIFY_FAIL_IF_NO_PEER_CERT") X509_V_FLAG_CRL_CHECK = rffi_platform.ConstantInteger( "X509_V_FLAG_CRL_CHECK") X509_V_FLAG_CRL_CHECK_ALL = rffi_platform.ConstantInteger( "X509_V_FLAG_CRL_CHECK_ALL") X509_V_FLAG_X509_STRICT = rffi_platform.ConstantInteger( "X509_V_FLAG_X509_STRICT") SSL_ERROR_WANT_READ = rffi_platform.ConstantInteger("SSL_ERROR_WANT_READ") SSL_ERROR_WANT_WRITE = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_WRITE") SSL_ERROR_ZERO_RETURN = rffi_platform.ConstantInteger( "SSL_ERROR_ZERO_RETURN") SSL_ERROR_WANT_X509_LOOKUP = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_X509_LOOKUP") SSL_ERROR_WANT_CONNECT = rffi_platform.ConstantInteger( "SSL_ERROR_WANT_CONNECT") SSL_ERROR_SYSCALL = rffi_platform.ConstantInteger("SSL_ERROR_SYSCALL") SSL_ERROR_SSL = rffi_platform.ConstantInteger("SSL_ERROR_SSL") SSL_RECEIVED_SHUTDOWN = rffi_platform.ConstantInteger( "SSL_RECEIVED_SHUTDOWN") SSL_MODE_AUTO_RETRY = rffi_platform.ConstantInteger("SSL_MODE_AUTO_RETRY") SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = rffi_platform.ConstantInteger( "SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER") SSL_TLSEXT_ERR_OK = rffi_platform.ConstantInteger("SSL_TLSEXT_ERR_OK") SSL_TLSEXT_ERR_ALERT_FATAL = rffi_platform.ConstantInteger( "SSL_TLSEXT_ERR_ALERT_FATAL") SSL_TLSEXT_ERR_NOACK = rffi_platform.ConstantInteger( "SSL_TLSEXT_ERR_NOACK") SSL_AD_INTERNAL_ERROR = rffi_platform.ConstantInteger( "SSL_AD_INTERNAL_ERROR") SSL_AD_HANDSHAKE_FAILURE = rffi_platform.ConstantInteger( "SSL_AD_HANDSHAKE_FAILURE") TLSEXT_NAMETYPE_host_name = rffi_platform.ConstantInteger( "TLSEXT_NAMETYPE_host_name") ERR_LIB_X509 = rffi_platform.ConstantInteger("ERR_LIB_X509") ERR_LIB_PEM = rffi_platform.ConstantInteger("ERR_LIB_PEM") ERR_LIB_ASN1 = rffi_platform.ConstantInteger("ERR_LIB_ASN1") PEM_R_NO_START_LINE = rffi_platform.ConstantInteger("PEM_R_NO_START_LINE") ASN1_R_HEADER_TOO_LONG = rffi_platform.ConstantInteger( "ASN1_R_HEADER_TOO_LONG") X509_R_CERT_ALREADY_IN_HASH_TABLE = rffi_platform.ConstantInteger( "X509_R_CERT_ALREADY_IN_HASH_TABLE") NID_undef = rffi_platform.ConstantInteger("NID_undef") NID_subject_alt_name = rffi_platform.ConstantInteger( "NID_subject_alt_name") NID_ad_OCSP = rffi_platform.ConstantInteger("NID_ad_OCSP") NID_ad_ca_issuers = rffi_platform.ConstantInteger("NID_ad_ca_issuers") NID_info_access = rffi_platform.ConstantInteger("NID_info_access") NID_X9_62_prime256v1 = rffi_platform.ConstantInteger( "NID_X9_62_prime256v1") NID_crl_distribution_points = rffi_platform.ConstantInteger( "NID_crl_distribution_points") GEN_DIRNAME = rffi_platform.ConstantInteger("GEN_DIRNAME") GEN_EMAIL = rffi_platform.ConstantInteger("GEN_EMAIL") GEN_DNS = rffi_platform.ConstantInteger("GEN_DNS") GEN_URI = rffi_platform.ConstantInteger("GEN_URI") GEN_OTHERNAME = rffi_platform.ConstantInteger("GEN_OTHERNAME") GEN_X400 = rffi_platform.ConstantInteger("GEN_X400") GEN_EDIPARTY = rffi_platform.ConstantInteger("GEN_EDIPARTY") GEN_IPADD = rffi_platform.ConstantInteger("GEN_IPADD") GEN_RID = rffi_platform.ConstantInteger("GEN_RID") CRYPTO_LOCK = rffi_platform.ConstantInteger("CRYPTO_LOCK") OBJ_NAME_TYPE_MD_METH = rffi_platform.ConstantInteger( "OBJ_NAME_TYPE_MD_METH") if OPENSSL_VERSION_NUMBER >= 0x10001000: X509_st = rffi_platform.Struct('struct x509_st', [('crldp', stack_st_DIST_POINT)]) # Some structures, with only the fields used in the _ssl module X509_name_entry_st = rffi_platform.Struct('struct X509_name_entry_st', [('set', rffi.INT)]) asn1_string_st = rffi_platform.Struct('struct asn1_string_st', [('length', rffi.INT), ('data', rffi.CCHARP)]) X509_extension_st = rffi_platform.Struct('struct X509_extension_st', [('value', ASN1_STRING)]) x509_store_st = rffi_platform.Struct('struct x509_store_st', [('objs', stack_st_X509_OBJECT), ('param', X509_VERIFY_PARAM)]) x509_object_st = rffi_platform.Struct('struct x509_object_st', [('type', rffi.INT)]) X509_LU_X509 = rffi_platform.ConstantInteger("X509_LU_X509") X509_LU_CRL = rffi_platform.ConstantInteger("X509_LU_CRL") X509V3_EXT_D2I = lltype.FuncType([rffi.VOIDP, rffi.CCHARPP, rffi.LONG], rffi.VOIDP) v3_ext_method = rffi_platform.Struct('struct v3_ext_method', [('it', ASN1_ITEM_EXP), ('d2i', lltype.Ptr(X509V3_EXT_D2I))]) GENERAL_NAME_st = rffi_platform.Struct('struct GENERAL_NAME_st', [('type', rffi.INT)]) EVP_MD_st = rffi_platform.Struct('EVP_MD', [('md_size', rffi.INT), ('block_size', rffi.INT)]) EVP_MD_SIZE = rffi_platform.SizeOf('EVP_MD') EVP_MD_CTX_SIZE = rffi_platform.SizeOf('EVP_MD_CTX') OBJ_NAME_st = rffi_platform.Struct('OBJ_NAME', [ ('alias', rffi.INT), ('name', rffi.CCHARP), ]) COMP_METHOD_st = rffi_platform.Struct('struct comp_method_st', [ ('type', rffi.INT), ]) ACCESS_DESCRIPTION_st = rffi_platform.Struct( 'struct ACCESS_DESCRIPTION_st', [ ('method', ASN1_OBJECT), ('location', GENERAL_NAME), ])