diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2020-09-11 17:23:45 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2020-09-11 17:23:45 +0000 |
commit | c37c7e91d99f0d7a5ffae7a43dfa97a0e9a97edc (patch) | |
tree | cf96aecbe573334a8b0f853192e62c18055325af /lib | |
parent | d7ff24c5b1f9cf22e4ac22f86eec16189fdfaaff (diff) |
Simplify SSL_get_ciphers().
ok beck@, tb@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/ssl_lib.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index 2879b198d5c..34ea6154a42 100644 --- a/lib/libssl/ssl_lib.c +++ b/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.223 2020/09/11 15:28:08 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.224 2020/09/11 17:23:44 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1253,21 +1253,15 @@ ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap, return ((l > 0) ? 1:-1); } -/* - * Return a STACK of the ciphers available for the SSL and in order of - * preference. - */ STACK_OF(SSL_CIPHER) * SSL_get_ciphers(const SSL *s) { - if (s != NULL) { - if (s->cipher_list != NULL) { - return (s->cipher_list); - } else if ((s->ctx != NULL) && (s->ctx->cipher_list != NULL)) { - return (s->ctx->cipher_list); - } - } - return (NULL); + if (s == NULL) + return (NULL); + if (s->cipher_list != NULL) + return (s->cipher_list); + + return (s->ctx->cipher_list); } STACK_OF(SSL_CIPHER) * |