From 66eead03b58a2ef0d01f6b51264c0ec38a5c020e Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 24 Oct 2021 13:46:56 +0000 Subject: [PATCH] Prepare to provide BIO_get_init() ok beck jsing --- lib/libcrypto/bio/bio.h | 11 +++++++---- lib/libcrypto/bio/bio_lib.c | 8 +++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h index 82463c6bebd..735d16e6b97 100644 --- a/lib/libcrypto/bio/bio.h +++ b/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.45 2018/06/02 04:41:12 tb Exp $ */ +/* $OpenBSD: bio.h,v 1.46 2021/10/24 13:46:56 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -605,9 +605,12 @@ BIO *BIO_new(const BIO_METHOD *type); int BIO_set(BIO *a, const BIO_METHOD *type); int BIO_free(BIO *a); int BIO_up_ref(BIO *bio); -void *BIO_get_data(BIO *a); -void BIO_set_data(BIO *a, void *ptr); -void BIO_set_init(BIO *a, int init); +void *BIO_get_data(BIO *a); +void BIO_set_data(BIO *a, void *ptr); +#if defined(LIBRESSL_NEW_API) +int BIO_get_init(BIO *a); +#endif +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); diff --git a/lib/libcrypto/bio/bio_lib.c b/lib/libcrypto/bio/bio_lib.c index 7ef1784e139..05f02589477 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.29 2019/04/14 17:39:03 jsing Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.30 2021/10/24 13:46:56 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -170,6 +170,12 @@ BIO_set_data(BIO *a, void *ptr) a->ptr = ptr; } +int +BIO_get_init(BIO *a) +{ + return a->init; +} + void BIO_set_init(BIO *a, int init) { -- 2.20.1