diff options
| author | jsing <> | 2018-02-22 16:38:43 +0000 |
|---|---|---|
| committer | jsing <> | 2018-02-22 16:38:43 +0000 |
| commit | b7d5a2d8da59d9bdb143541e1b5b89e2b1f7480e (patch) | |
| tree | 4912c378e520c4e2d926bd8d2da57d3503f15530 /src | |
| parent | 83d3c2c5c4f7b531789b05733d36cfe9bb9e5f7d (diff) | |
| download | openbsd-b7d5a2d8da59d9bdb143541e1b5b89e2b1f7480e.tar.gz openbsd-b7d5a2d8da59d9bdb143541e1b5b89e2b1f7480e.tar.bz2 openbsd-b7d5a2d8da59d9bdb143541e1b5b89e2b1f7480e.zip | |
Provide BIO_up_ref().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bio.h | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 9 |
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 | |||
| 362 | BIO_socket_ioctl | 362 | BIO_socket_ioctl |
| 363 | BIO_socket_nbio | 363 | BIO_socket_nbio |
| 364 | BIO_test_flags | 364 | BIO_test_flags |
| 365 | BIO_up_ref | ||
| 365 | BIO_vfree | 366 | BIO_vfree |
| 366 | BIO_vprintf | 367 | BIO_vprintf |
| 367 | BIO_vsnprintf | 368 | BIO_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); | |||
| 603 | BIO * BIO_new(BIO_METHOD *type); | 603 | BIO * BIO_new(BIO_METHOD *type); |
| 604 | int BIO_set(BIO *a, BIO_METHOD *type); | 604 | int BIO_set(BIO *a, BIO_METHOD *type); |
| 605 | int BIO_free(BIO *a); | 605 | int BIO_free(BIO *a); |
| 606 | int BIO_up_ref(BIO *bio); | ||
| 606 | void *BIO_get_data(BIO *a); | 607 | void *BIO_get_data(BIO *a); |
| 607 | void BIO_set_data(BIO *a, void *ptr); | 608 | void BIO_set_data(BIO *a, void *ptr); |
| 608 | void BIO_set_init(BIO *a, int init); | 609 | void 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 | ||
| 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 | { |
