summaryrefslogtreecommitdiffstats
path: root/lib/libssl/bio_ssl.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-08-24 20:30:21 +0000
committertb <tb@openbsd.org>2018-08-24 20:30:21 +0000
commit1e7a28f35c78b2a96f391bbdce6e59bf4b46d07c (patch)
tree1d19e766eb2c15de21fdc58cc59d98c5aeb85565 /lib/libssl/bio_ssl.c
parentAdd const to EVP_PKCS82PKEY(). (diff)
downloadwireguard-openbsd-1e7a28f35c78b2a96f391bbdce6e59bf4b46d07c.tar.xz
wireguard-openbsd-1e7a28f35c78b2a96f391bbdce6e59bf4b46d07c.zip
Let SSL_copy_session_id() return an int for error checking.
Accordingly, add some error checking to SSL_copy_session_id(), BIO_ssl_copy_session_id(), and SSL_dup(). Prompted by OpenSSL commit 17dd65e6e1f Tested in a bulk build by sthen ok jsing
Diffstat (limited to 'lib/libssl/bio_ssl.c')
-rw-r--r--lib/libssl/bio_ssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libssl/bio_ssl.c b/lib/libssl/bio_ssl.c
index d68e011c620..93cfa0d2a42 100644
--- a/lib/libssl/bio_ssl.c
+++ b/lib/libssl/bio_ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bio_ssl.c,v 1.28 2018/05/01 13:30:24 tb Exp $ */
+/* $OpenBSD: bio_ssl.c,v 1.29 2018/08/24 20:30:21 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -568,7 +568,9 @@ BIO_ssl_copy_session_id(BIO *t, BIO *f)
if ((((BIO_SSL *)t->ptr)->ssl == NULL) ||
(((BIO_SSL *)f->ptr)->ssl == NULL))
return (0);
- SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl, ((BIO_SSL *)f->ptr)->ssl);
+ if (!SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl,
+ ((BIO_SSL *)f->ptr)->ssl))
+ return (0);
return (1);
}