summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2020-09-11 17:23:44 +0000
committerjsing <>2020-09-11 17:23:44 +0000
commit044cfc226bee4d04817ab4f4d3a6b1d0ab4db4ed (patch)
tree0e29f1642b3c089b21147eb8ce2c3abccedd55d1 /src/lib
parentaaafcc65a8b1deda1feab495b687eeec194f78bb (diff)
downloadopenbsd-044cfc226bee4d04817ab4f4d3a6b1d0ab4db4ed.tar.gz
openbsd-044cfc226bee4d04817ab4f4d3a6b1d0ab4db4ed.tar.bz2
openbsd-044cfc226bee4d04817ab4f4d3a6b1d0ab4db4ed.zip
Simplify SSL_get_ciphers().
ok beck@, tb@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/ssl_lib.c20
1 files changed, 7 insertions, 13 deletions
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 @@
1/* $OpenBSD: ssl_lib.c,v 1.223 2020/09/11 15:28:08 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.224 2020/09/11 17:23:44 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1253,21 +1253,15 @@ ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
1253 return ((l > 0) ? 1:-1); 1253 return ((l > 0) ? 1:-1);
1254} 1254}
1255 1255
1256/*
1257 * Return a STACK of the ciphers available for the SSL and in order of
1258 * preference.
1259 */
1260STACK_OF(SSL_CIPHER) * 1256STACK_OF(SSL_CIPHER) *
1261SSL_get_ciphers(const SSL *s) 1257SSL_get_ciphers(const SSL *s)
1262{ 1258{
1263 if (s != NULL) { 1259 if (s == NULL)
1264 if (s->cipher_list != NULL) { 1260 return (NULL);
1265 return (s->cipher_list); 1261 if (s->cipher_list != NULL)
1266 } else if ((s->ctx != NULL) && (s->ctx->cipher_list != NULL)) { 1262 return (s->cipher_list);
1267 return (s->ctx->cipher_list); 1263
1268 } 1264 return (s->ctx->cipher_list);
1269 }
1270 return (NULL);
1271} 1265}
1272 1266
1273STACK_OF(SSL_CIPHER) * 1267STACK_OF(SSL_CIPHER) *