From 044cfc226bee4d04817ab4f4d3a6b1d0ab4db4ed Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 11 Sep 2020 17:23:44 +0000 Subject: Simplify SSL_get_ciphers(). ok beck@, tb@ --- src/lib/libssl/ssl_lib.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 2879b198d5..34ea6154a4 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/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) * -- cgit v1.2.3-55-g6feb