summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2020-09-16 07:25:15 +0000
committerschwarze <schwarze@openbsd.org>2020-09-16 07:25:15 +0000
commitcd7ceac03ec9fac5ccd122fba058a44812214ea5 (patch)
treec9180ca34d5e79a6422a8a7763b0d257611d4f5e /lib/libssl/ssl_lib.c
parentMark SSL_get_cipher_list(3) as deprecated; it is badly misnamed, and there (diff)
downloadwireguard-openbsd-cd7ceac03ec9fac5ccd122fba058a44812214ea5.tar.xz
wireguard-openbsd-cd7ceac03ec9fac5ccd122fba058a44812214ea5.zip
Let SSL_CTX_get_ciphers(NULL) return NULL rather than crash
for compatibility with OpenSSL and for consistency with neighbouring functions; suggested by jsing@ after i documented the crash; OK jsing@.
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r--lib/libssl/ssl_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c
index 828aa3a08d0..73bc05e9679 100644
--- a/lib/libssl/ssl_lib.c
+++ b/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_lib.c,v 1.228 2020/09/15 11:47:49 jsing Exp $ */
+/* $OpenBSD: ssl_lib.c,v 1.229 2020/09/16 07:25:15 schwarze Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1336,6 +1336,8 @@ SSL_get_cipher_list(const SSL *s, int n)
STACK_OF(SSL_CIPHER) *
SSL_CTX_get_ciphers(const SSL_CTX *ctx)
{
+ if (ctx == NULL)
+ return NULL;
return ctx->cipher_list;
}