From: tb Date: Sat, 20 Nov 2021 16:36:55 +0000 (+0000) Subject: Switch to BIO_up_ref() instead of adjusting references manually. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ef70a379631ec7e97481e1d0e500e21496e6c4aa;p=openbsd Switch to BIO_up_ref() instead of adjusting references manually. --- diff --git a/regress/lib/libssl/server/servertest.c b/regress/lib/libssl/server/servertest.c index a71c5f8c664..bd0adcd005c 100644 --- a/regress/lib/libssl/server/servertest.c +++ b/regress/lib/libssl/server/servertest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: servertest.c,v 1.5 2021/01/22 15:56:17 tb Exp $ */ +/* $OpenBSD: servertest.c,v 1.6 2021/11/20 16:36:55 tb Exp $ */ /* * Copyright (c) 2015, 2016, 2017 Joel Sing * @@ -155,9 +155,8 @@ server_hello_test(int testno, struct server_hello_test *sht) goto failure; } - rbio->references = 2; - wbio->references = 2; - + BIO_up_ref(rbio); + BIO_up_ref(wbio); SSL_set_bio(ssl, rbio, wbio); if (SSL_accept(ssl) != 0) { @@ -172,11 +171,6 @@ server_hello_test(int testno, struct server_hello_test *sht) SSL_CTX_free(ssl_ctx); SSL_free(ssl); - if (rbio != NULL) - rbio->references = 1; - if (wbio != NULL) - wbio->references = 1; - BIO_free(rbio); BIO_free(wbio); diff --git a/regress/lib/libssl/tlslegacy/tlslegacytest.c b/regress/lib/libssl/tlslegacy/tlslegacytest.c index 58e452e9112..17e19448d83 100644 --- a/regress/lib/libssl/tlslegacy/tlslegacytest.c +++ b/regress/lib/libssl/tlslegacy/tlslegacytest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tlslegacytest.c,v 1.4 2021/08/30 17:34:02 tb Exp $ */ +/* $OpenBSD: tlslegacytest.c,v 1.5 2021/11/20 16:36:55 tb Exp $ */ /* * Copyright (c) 2015, 2016, 2017, 2020 Joel Sing * @@ -589,9 +589,8 @@ tlslegacy_client_test(int testno, struct tlslegacy_client_test *tct) goto failure; } - rbio->references = 2; - wbio->references = 2; - + BIO_up_ref(rbio); + BIO_up_ref(wbio); SSL_set_bio(ssl, rbio, wbio); if (SSL_connect(ssl) == 1) { @@ -611,9 +610,6 @@ tlslegacy_client_test(int testno, struct tlslegacy_client_test *tct) SSL_CTX_free(ssl_ctx); SSL_free(ssl); - rbio->references = 1; - wbio->references = 1; - BIO_free(rbio); BIO_free(wbio);