diff options
author | jsing <> | 2018-02-22 16:38:43 +0000 |
---|---|---|
committer | jsing <> | 2018-02-22 16:38:43 +0000 |
commit | 0bf6ecbe2d20b398c509a2a122cd7821dca2f0b9 (patch) | |
tree | 4912c378e520c4e2d926bd8d2da57d3503f15530 /src/lib/libcrypto/bio/bio_lib.c | |
parent | 39a7cf3424b8ebbc14c69503e50b84fd0fd598ce (diff) | |
download | openbsd-0bf6ecbe2d20b398c509a2a122cd7821dca2f0b9.tar.gz openbsd-0bf6ecbe2d20b398c509a2a122cd7821dca2f0b9.tar.bz2 openbsd-0bf6ecbe2d20b398c509a2a122cd7821dca2f0b9.zip |
Provide BIO_up_ref().
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
-rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 | ||
154 | int | ||
155 | BIO_up_ref(BIO *bio) | ||
156 | { | ||
157 | int refs = CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO); | ||
158 | return (refs > 1) ? 1 : 0; | ||
159 | } | ||
160 | |||
154 | void * | 161 | void * |
155 | BIO_get_data(BIO *a) | 162 | BIO_get_data(BIO *a) |
156 | { | 163 | { |