From b5cfa8d98d6ecf63861e1feba47654cddfce1f4d Mon Sep 17 00:00:00 2001 From: PhiBo Date: Sun, 4 May 2014 13:50:25 +0200 Subject: Add support for SSL_get_ciphers() --- cryptography/hazmat/bindings/openssl/ssl.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cryptography/hazmat/bindings/openssl/ssl.py b/cryptography/hazmat/bindings/openssl/ssl.py index 0b15411c..d473e2db 100644 --- a/cryptography/hazmat/bindings/openssl/ssl.py +++ b/cryptography/hazmat/bindings/openssl/ssl.py @@ -15,6 +15,8 @@ from __future__ import absolute_import, division, print_function INCLUDES = """ #include + +typedef STACK_OF(SSL_CIPHER) Cryptography_STACK_OF_SSL_CIPHER; """ TYPES = """ @@ -153,6 +155,7 @@ typedef struct { static const long TLSEXT_NAMETYPE_host_name; typedef ... SSL_CIPHER; +typedef ... Cryptography_STACK_OF_SSL_CIPHER; """ FUNCTIONS = """ @@ -190,6 +193,7 @@ int SSL_get_error(const SSL *, int); int SSL_do_handshake(SSL *); int SSL_shutdown(SSL *); const char *SSL_get_cipher_list(const SSL *, int); +Cryptography_STACK_OF_SSL_CIPHER *SSL_get_ciphers(const SSL *ssl); /* context */ void SSL_CTX_free(SSL_CTX *); @@ -351,6 +355,9 @@ int SSL_select_next_proto(unsigned char **, unsigned char *, const unsigned char *, unsigned int); void SSL_get0_next_proto_negotiated(const SSL *, const unsigned char **, unsigned *); + +int sk_SSL_CIPHER_num(Cryptography_STACK_OF_SSL_CIPHER *); +SSL_CIPHER *sk_SSL_CIPHER_value(Cryptography_STACK_OF_SSL_CIPHER *, int i); """ CUSTOMIZATIONS = """ -- cgit v1.2.3