From 635cb7a55e3341a0d495ac7a7337b6fe0adc9ad7 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 5 Jan 2022 20:48:44 +0000 Subject: [PATCH] Prepare to provide BIO_set_retry_reason() Needed by freerdp. ok inoguchi jsing --- lib/libcrypto/bio/bio.h | 5 ++++- lib/libcrypto/bio/bio_lib.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h index 9697c8ad3b9..23d47367d43 100644 --- a/lib/libcrypto/bio/bio.h +++ b/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.49 2022/01/05 20:22:26 tb Exp $ */ +/* $OpenBSD: bio.h,v 1.50 2022/01/05 20:48:44 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -637,6 +637,9 @@ void BIO_set_next(BIO *b, BIO *next); #endif BIO * BIO_get_retry_BIO(BIO *bio, int *reason); int BIO_get_retry_reason(BIO *bio); +#if defined(LIBRESSL_OPAQUE_BIO) || defined(LIBRESSL_CRYPTO_INTERNAL) +void BIO_set_retry_reason(BIO *bio, int reason); +#endif BIO * BIO_dup_chain(BIO *in); int BIO_nread0(BIO *bio, char **buf); diff --git a/lib/libcrypto/bio/bio_lib.c b/lib/libcrypto/bio/bio_lib.c index 51289ad2951..f129062d6e1 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.32 2022/01/05 20:22:26 tb Exp $ */ +/* $OpenBSD: bio_lib.c,v 1.33 2022/01/05 20:48:44 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -558,6 +558,12 @@ BIO_get_retry_reason(BIO *bio) return (bio->retry_reason); } +void +BIO_set_retry_reason(BIO *bio, int reason) +{ + bio->retry_reason = reason; +} + BIO * BIO_find_type(BIO *bio, int type) { -- 2.20.1