summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2022-08-05 17:06:17 +0000
committertb <>2022-08-05 17:06:17 +0000
commitbce090b40d9d78adf9b62d7d0f7793eb7d242aaf (patch)
tree462451fbe9167c1138f8f4c80e3a59bc599dd7b4
parentcdd75704cf29bd0de2355410fc1a2933ad782c5c (diff)
downloadopenbsd-bce090b40d9d78adf9b62d7d0f7793eb7d242aaf.tar.gz
openbsd-bce090b40d9d78adf9b62d7d0f7793eb7d242aaf.tar.bz2
openbsd-bce090b40d9d78adf9b62d7d0f7793eb7d242aaf.zip
Move CBB_init() to a consistent place.
-rw-r--r--src/regress/lib/libssl/tlsext/tlsexttest.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c
index 918d9c51fe..a224623881 100644
--- a/src/regress/lib/libssl/tlsext/tlsexttest.c
+++ b/src/regress/lib/libssl/tlsext/tlsexttest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tlsexttest.c,v 1.70 2022/08/05 17:03:33 tb Exp $ */ 1/* $OpenBSD: tlsexttest.c,v 1.71 2022/08/05 17:06:17 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org> 4 * Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
@@ -1791,6 +1791,9 @@ test_tlsext_sni_client(void)
1791 1791
1792 failure = 1; 1792 failure = 1;
1793 1793
1794 if (!CBB_init(&cbb, 0))
1795 errx(1, "Failed to create CBB");
1796
1794 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) 1797 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL)
1795 errx(1, "failed to create SSL_CTX"); 1798 errx(1, "failed to create SSL_CTX");
1796 if ((ssl = SSL_new(ssl_ctx)) == NULL) 1799 if ((ssl = SSL_new(ssl_ctx)) == NULL)
@@ -1800,9 +1803,6 @@ test_tlsext_sni_client(void)
1800 &server_funcs)) 1803 &server_funcs))
1801 errx(1, "failed to fetch sni funcs"); 1804 errx(1, "failed to fetch sni funcs");
1802 1805
1803 if (!CBB_init(&cbb, 0))
1804 errx(1, "Failed to create CBB");
1805
1806 if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) { 1806 if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) {
1807 FAIL("client should not need SNI\n"); 1807 FAIL("client should not need SNI\n");
1808 goto err; 1808 goto err;
@@ -2053,6 +2053,9 @@ test_tlsext_quic_transport_parameters_client(void)
2053 2053
2054 failure = 1; 2054 failure = 1;
2055 2055
2056 if (!CBB_init(&cbb, 0))
2057 errx(1, "Failed to create CBB");
2058
2056 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) 2059 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL)
2057 errx(1, "failed to create SSL_CTX"); 2060 errx(1, "failed to create SSL_CTX");
2058 if ((ssl = SSL_new(ssl_ctx)) == NULL) 2061 if ((ssl = SSL_new(ssl_ctx)) == NULL)
@@ -2062,9 +2065,6 @@ test_tlsext_quic_transport_parameters_client(void)
2062 &client_funcs, &server_funcs)) 2065 &client_funcs, &server_funcs))
2063 errx(1, "failed to fetch quic transport parameter funcs"); 2066 errx(1, "failed to fetch quic transport parameter funcs");
2064 2067
2065 if (!CBB_init(&cbb, 0))
2066 errx(1, "Failed to create CBB");
2067
2068 if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) { 2068 if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) {
2069 FAIL("client should not need QUIC\n"); 2069 FAIL("client should not need QUIC\n");
2070 goto err; 2070 goto err;
@@ -3731,6 +3731,9 @@ test_tlsext_keyshare_server(void)
3731 3731
3732 failure = 1; 3732 failure = 1;
3733 3733
3734 if (!CBB_init(&cbb, 0))
3735 errx(1, "Failed to create CBB");
3736
3734 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) 3737 if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL)
3735 errx(1, "failed to create SSL_CTX"); 3738 errx(1, "failed to create SSL_CTX");
3736 if ((ssl = SSL_new(ssl_ctx)) == NULL) 3739 if ((ssl = SSL_new(ssl_ctx)) == NULL)
@@ -3740,9 +3743,6 @@ test_tlsext_keyshare_server(void)
3740 &server_funcs)) 3743 &server_funcs))
3741 errx(1, "failed to fetch keyshare funcs"); 3744 errx(1, "failed to fetch keyshare funcs");
3742 3745
3743 if (!CBB_init(&cbb, 0))
3744 errx(1, "Failed to create CBB");
3745
3746 ssl->s3->hs.negotiated_tls_version = TLS1_2_VERSION; 3746 ssl->s3->hs.negotiated_tls_version = TLS1_2_VERSION;
3747 if (server_funcs->needs(ssl, SSL_TLSEXT_MSG_SH)) { 3747 if (server_funcs->needs(ssl, SSL_TLSEXT_MSG_SH)) {
3748 FAIL("server should not need keyshare\n"); 3748 FAIL("server should not need keyshare\n");