summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/Symbols.list1
-rw-r--r--src/lib/libcrypto/bio/bio.h3
-rw-r--r--src/lib/libcrypto/bio/bio_lib.c9
3 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index 4e29e85236..854baed64a 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -362,6 +362,7 @@ BIO_sock_should_retry
362BIO_socket_ioctl 362BIO_socket_ioctl
363BIO_socket_nbio 363BIO_socket_nbio
364BIO_test_flags 364BIO_test_flags
365BIO_up_ref
365BIO_vfree 366BIO_vfree
366BIO_vprintf 367BIO_vprintf
367BIO_vsnprintf 368BIO_vsnprintf
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h
index 0a05d64929..b85f7181bc 100644
--- a/src/lib/libcrypto/bio/bio.h
+++ b/src/lib/libcrypto/bio/bio.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio.h,v 1.38 2018/02/20 18:17:17 tb Exp $ */ 1/* $OpenBSD: bio.h,v 1.39 2018/02/22 16:38:43 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 *
@@ -603,6 +603,7 @@ BIO *BIO_new_fp(FILE *stream, int close_flag);
603BIO * BIO_new(BIO_METHOD *type); 603BIO * BIO_new(BIO_METHOD *type);
604int BIO_set(BIO *a, BIO_METHOD *type); 604int BIO_set(BIO *a, BIO_METHOD *type);
605int BIO_free(BIO *a); 605int BIO_free(BIO *a);
606int BIO_up_ref(BIO *bio);
606void *BIO_get_data(BIO *a); 607void *BIO_get_data(BIO *a);
607void BIO_set_data(BIO *a, void *ptr); 608void BIO_set_data(BIO *a, void *ptr);
608void BIO_set_init(BIO *a, int init); 609void BIO_set_init(BIO *a, int init);
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c
index 8ad54cefd2..ddab542881 100644
--- a/src/lib/libcrypto/bio/bio_lib.c
+++ b/src/lib/libcrypto/bio/bio_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_lib.c,v 1.26 2018/02/20 17:55:26 tb Exp $ */ 1/* $OpenBSD: bio_lib.c,v 1.27 2018/02/22 16:38:43 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 *
@@ -151,6 +151,13 @@ BIO_vfree(BIO *a)
151 BIO_free(a); 151 BIO_free(a);
152} 152}
153 153
154int
155BIO_up_ref(BIO *bio)
156{
157 int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO);
158 return (refs > 1) ? 1 : 0;
159}
160
154void * 161void *
155BIO_get_data(BIO *a) 162BIO_get_data(BIO *a)
156{ 163{