From 5db89a4f760704f5852515efdc178580f834c498 Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 20 Feb 2018 17:55:26 +0000 Subject: [PATCH] Provide BIO_{g,s}et_shutdown(). ok jsing --- lib/libcrypto/Symbols.list | 2 ++ lib/libcrypto/bio/bio.h | 4 +++- lib/libcrypto/bio/bio_lib.c | 14 +++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 745f2b29ef9..f1c7f71fcb8 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -284,6 +284,7 @@ BIO_get_new_index BIO_get_port BIO_get_retry_BIO BIO_get_retry_reason +BIO_get_shutdown BIO_gethostbyname BIO_gets BIO_indent @@ -342,6 +343,7 @@ BIO_set_data BIO_set_ex_data BIO_set_flags BIO_set_init +BIO_set_shutdown BIO_set_tcp_ndelay BIO_snprintf BIO_sock_cleanup diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h index 1d34f082eec..39a04bda568 100644 --- a/lib/libcrypto/bio/bio.h +++ b/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.34 2018/02/20 17:15:27 jsing Exp $ */ +/* $OpenBSD: bio.h,v 1.35 2018/02/20 17:55:26 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -597,6 +597,8 @@ int BIO_free(BIO *a); void *BIO_get_data(BIO *a); void BIO_set_data(BIO *a, void *ptr); void BIO_set_init(BIO *a, int init); +int BIO_get_shutdown(BIO *a); +void BIO_set_shutdown(BIO *a, int shut); void BIO_vfree(BIO *a); int BIO_read(BIO *b, void *data, int len) __attribute__((__bounded__(__buffer__,2,3))); diff --git a/lib/libcrypto/bio/bio_lib.c b/lib/libcrypto/bio/bio_lib.c index b2acd01342a..8ad54cefd2f 100644 --- a/lib/libcrypto/bio/bio_lib.c +++ b/lib/libcrypto/bio/bio_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_lib.c,v 1.25 2018/02/20 17:15:27 jsing Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.26 2018/02/20 17:55:26 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -169,6 +169,18 @@ BIO_set_init(BIO *a, int init) a->init = init; } +int +BIO_get_shutdown(BIO *a) +{ + return (a->shutdown); +} + +void +BIO_set_shutdown(BIO *a, int shut) +{ + a->shutdown = shut; +} + void BIO_clear_flags(BIO *b, int flags) { -- 2.20.1