diff options
author | tb <> | 2021-11-20 16:36:55 +0000 |
---|---|---|
committer | tb <> | 2021-11-20 16:36:55 +0000 |
commit | 105c69b5d010aec960fdbf571dd0598e0436e293 (patch) | |
tree | 7a5c5f2efe0ebdf1f0aaa3b7ae5a3d15c5a14b92 /src/regress/lib | |
parent | fa9c14e45d468ee5b1042cd1b44a65ed1b6d273f (diff) | |
download | openbsd-105c69b5d010aec960fdbf571dd0598e0436e293.tar.gz openbsd-105c69b5d010aec960fdbf571dd0598e0436e293.tar.bz2 openbsd-105c69b5d010aec960fdbf571dd0598e0436e293.zip |
Switch to BIO_up_ref() instead of adjusting references manually.
Diffstat (limited to 'src/regress/lib')
-rw-r--r-- | src/regress/lib/libssl/server/servertest.c | 12 | ||||
-rw-r--r-- | src/regress/lib/libssl/tlslegacy/tlslegacytest.c | 10 |
2 files changed, 6 insertions, 16 deletions
diff --git a/src/regress/lib/libssl/server/servertest.c b/src/regress/lib/libssl/server/servertest.c index a71c5f8c66..bd0adcd005 100644 --- a/src/regress/lib/libssl/server/servertest.c +++ b/src/regress/lib/libssl/server/servertest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: servertest.c,v 1.5 2021/01/22 15:56:17 tb Exp $ */ | 1 | /* $OpenBSD: servertest.c,v 1.6 2021/11/20 16:36:55 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -155,9 +155,8 @@ server_hello_test(int testno, struct server_hello_test *sht) | |||
155 | goto failure; | 155 | goto failure; |
156 | } | 156 | } |
157 | 157 | ||
158 | rbio->references = 2; | 158 | BIO_up_ref(rbio); |
159 | wbio->references = 2; | 159 | BIO_up_ref(wbio); |
160 | |||
161 | SSL_set_bio(ssl, rbio, wbio); | 160 | SSL_set_bio(ssl, rbio, wbio); |
162 | 161 | ||
163 | if (SSL_accept(ssl) != 0) { | 162 | if (SSL_accept(ssl) != 0) { |
@@ -172,11 +171,6 @@ server_hello_test(int testno, struct server_hello_test *sht) | |||
172 | SSL_CTX_free(ssl_ctx); | 171 | SSL_CTX_free(ssl_ctx); |
173 | SSL_free(ssl); | 172 | SSL_free(ssl); |
174 | 173 | ||
175 | if (rbio != NULL) | ||
176 | rbio->references = 1; | ||
177 | if (wbio != NULL) | ||
178 | wbio->references = 1; | ||
179 | |||
180 | BIO_free(rbio); | 174 | BIO_free(rbio); |
181 | BIO_free(wbio); | 175 | BIO_free(wbio); |
182 | 176 | ||
diff --git a/src/regress/lib/libssl/tlslegacy/tlslegacytest.c b/src/regress/lib/libssl/tlslegacy/tlslegacytest.c index 58e452e911..17e19448d8 100644 --- a/src/regress/lib/libssl/tlslegacy/tlslegacytest.c +++ b/src/regress/lib/libssl/tlslegacy/tlslegacytest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tlslegacytest.c,v 1.4 2021/08/30 17:34:02 tb Exp $ */ | 1 | /* $OpenBSD: tlslegacytest.c,v 1.5 2021/11/20 16:36:55 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015, 2016, 2017, 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015, 2016, 2017, 2020 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -589,9 +589,8 @@ tlslegacy_client_test(int testno, struct tlslegacy_client_test *tct) | |||
589 | goto failure; | 589 | goto failure; |
590 | } | 590 | } |
591 | 591 | ||
592 | rbio->references = 2; | 592 | BIO_up_ref(rbio); |
593 | wbio->references = 2; | 593 | BIO_up_ref(wbio); |
594 | |||
595 | SSL_set_bio(ssl, rbio, wbio); | 594 | SSL_set_bio(ssl, rbio, wbio); |
596 | 595 | ||
597 | if (SSL_connect(ssl) == 1) { | 596 | if (SSL_connect(ssl) == 1) { |
@@ -611,9 +610,6 @@ tlslegacy_client_test(int testno, struct tlslegacy_client_test *tct) | |||
611 | SSL_CTX_free(ssl_ctx); | 610 | SSL_CTX_free(ssl_ctx); |
612 | SSL_free(ssl); | 611 | SSL_free(ssl); |
613 | 612 | ||
614 | rbio->references = 1; | ||
615 | wbio->references = 1; | ||
616 | |||
617 | BIO_free(rbio); | 613 | BIO_free(rbio); |
618 | BIO_free(wbio); | 614 | BIO_free(wbio); |
619 | 615 | ||