diff options
author | 2020-09-11 17:23:44 +0000 | |
---|---|---|
committer | 2020-09-11 17:23:44 +0000 | |
commit | 1c5dcc8fad26600d5687b55a7327f4184ef57e9f (patch) | |
tree | 68db45006a3e7ec5e562e42dbfb3571ece1ef460 /lib/libssl/ssl_lib.c | |
parent | Rename ssl_cipher_is_permitted() (diff) | |
download | wireguard-openbsd-1c5dcc8fad26600d5687b55a7327f4184ef57e9f.tar.xz wireguard-openbsd-1c5dcc8fad26600d5687b55a7327f4184ef57e9f.zip |
Simplify SSL_get_ciphers().
ok beck@, tb@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-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) * |