From 9d5ac9532c58c8b2d10d5e8ee8029dcb40aecfbe Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sun, 10 Apr 2016 13:18:50 +0900 Subject: Add SSL_CTX_get_ciphers() Add an accessor for SSL_CTX. Since libssl was made opaque, there is no way for users to access the cipher_list, while users can set the cipher_list by SSL_CTX_set_cipher_list(). Reviewed-by: Matt Caswell Reviewed-by: Rich Salz --- ssl/ssl_lib.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ssl') diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 68fe4965cf..06d972349a 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1999,6 +1999,15 @@ const char *SSL_get_cipher_list(const SSL *s, int n) return (c->name); } +/** return a STACK of the ciphers available for the SSL_CTX and in order of + * preference */ +STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) +{ + if (ctx != NULL) + return ctx->cipher_list; + return NULL; +} + /** specify the ciphers to be used by default by the SSL_CTX */ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { -- cgit v1.2.3