aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@twistedmatrix.com>2013-12-28 12:47:43 -0500
committerJean-Paul Calderone <exarkun@twistedmatrix.com>2013-12-28 12:47:43 -0500
commit6c56e254932021e73aca04d1b1c71fb8ce9a95ea (patch)
treefa846f7bd11e3be2bdbf2a708b65ea1b448d309a
parent7c243875f34a47d3c552634a00440c846855c3a2 (diff)
downloadcryptography-6c56e254932021e73aca04d1b1c71fb8ce9a95ea.tar.gz
cryptography-6c56e254932021e73aca04d1b1c71fb8ce9a95ea.tar.bz2
cryptography-6c56e254932021e73aca04d1b1c71fb8ce9a95ea.zip
simplify a bit - just try tackling one problem at a time. and add some more typedefs that maybe should help (still broken though)
-rw-r--r--cryptography/hazmat/backends/openssl/ssl.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/cryptography/hazmat/backends/openssl/ssl.py b/cryptography/hazmat/backends/openssl/ssl.py
index 7a1219b0..071ec503 100644
--- a/cryptography/hazmat/backends/openssl/ssl.py
+++ b/cryptography/hazmat/backends/openssl/ssl.py
@@ -110,6 +110,8 @@ static const int X509_V_OK;
typedef ... SSL_METHOD;
typedef ... SSL_CTX;
+typedef ... Cryptography_STACK_OF_X509;
+
typedef struct {
int master_key_length;
unsigned char master_key[...];
@@ -158,11 +160,13 @@ int SSL_write(SSL *, const void *, int);
int SSL_read(SSL *, void *, int);
X509 *SSL_get_peer_certificate(const SSL *);
-/* OpenSSL defines these with STACK_OF(...) instead stack_st_... of but the
- * STACK_OF macro does not play well with cffi.
+/*
+ * OpenSSL defines these with STACK_OF(...) but the STACK_OF macro does not
+ * play well with cffi.
*/
-struct stack_st_X509 *SSL_get_peer_cert_chain(const SSL *);
-struct stack_st_X509_NAME *SSL_get_client_CA_list(const SSL *s);
+
+Cryptography_STACK_OF_X509 *SSL_get_peer_cert_chain(const SSL *);
+// Cryptography_STACK_OF_X509_NAME *SSL_get_client_CA_list(const SSL *);
int SSL_get_error(const SSL *, int);
int SSL_do_handshake(SSL *);
@@ -193,9 +197,10 @@ void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *);
X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
int SSL_CTX_add_client_CA(SSL_CTX *, X509 *);
-/* See comment above about STACK_OF(...) vs stack_st_...
+/*
+ * See comment above about STACK_OF(...) vs stack_st_...
*/
-void SSL_CTX_set_client_CA_list(SSL_CTX *, struct stack_st_X509_NAME *);
+// void SSL_CTX_set_client_CA_list(SSL_CTX *, Cryptography_STACK_OF_X509_NAME *);
/* X509_STORE_CTX */
@@ -298,6 +303,11 @@ static const long Cryptography_HAS_OP_NO_COMPRESSION = 1;
static const long Cryptography_HAS_OP_NO_COMPRESSION = 0;
const long SSL_OP_NO_COMPRESSION = 0;
#endif
+
+/*
+ * Get some simpler definitions for some types used by later prototypes.
+ */
+typedef STACK_OF(X509) Cryptography_STACK_OF_X509;
"""
CONDITIONAL_NAMES = {