From bce090b40d9d78adf9b62d7d0f7793eb7d242aaf Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 5 Aug 2022 17:06:17 +0000 Subject: Move CBB_init() to a consistent place. --- src/regress/lib/libssl/tlsext/tlsexttest.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/regress/lib/libssl/tlsext/tlsexttest.c') 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 @@ -/* $OpenBSD: tlsexttest.c,v 1.70 2022/08/05 17:03:33 tb Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.71 2022/08/05 17:06:17 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -1791,6 +1791,9 @@ test_tlsext_sni_client(void) failure = 1; + if (!CBB_init(&cbb, 0)) + errx(1, "Failed to create CBB"); + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) errx(1, "failed to create SSL_CTX"); if ((ssl = SSL_new(ssl_ctx)) == NULL) @@ -1800,9 +1803,6 @@ test_tlsext_sni_client(void) &server_funcs)) errx(1, "failed to fetch sni funcs"); - if (!CBB_init(&cbb, 0)) - errx(1, "Failed to create CBB"); - if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) { FAIL("client should not need SNI\n"); goto err; @@ -2053,6 +2053,9 @@ test_tlsext_quic_transport_parameters_client(void) failure = 1; + if (!CBB_init(&cbb, 0)) + errx(1, "Failed to create CBB"); + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) errx(1, "failed to create SSL_CTX"); if ((ssl = SSL_new(ssl_ctx)) == NULL) @@ -2062,9 +2065,6 @@ test_tlsext_quic_transport_parameters_client(void) &client_funcs, &server_funcs)) errx(1, "failed to fetch quic transport parameter funcs"); - if (!CBB_init(&cbb, 0)) - errx(1, "Failed to create CBB"); - if (client_funcs->needs(ssl, SSL_TLSEXT_MSG_CH)) { FAIL("client should not need QUIC\n"); goto err; @@ -3731,6 +3731,9 @@ test_tlsext_keyshare_server(void) failure = 1; + if (!CBB_init(&cbb, 0)) + errx(1, "Failed to create CBB"); + if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) errx(1, "failed to create SSL_CTX"); if ((ssl = SSL_new(ssl_ctx)) == NULL) @@ -3740,9 +3743,6 @@ test_tlsext_keyshare_server(void) &server_funcs)) errx(1, "failed to fetch keyshare funcs"); - if (!CBB_init(&cbb, 0)) - errx(1, "Failed to create CBB"); - ssl->s3->hs.negotiated_tls_version = TLS1_2_VERSION; if (server_funcs->needs(ssl, SSL_TLSEXT_MSG_SH)) { FAIL("server should not need keyshare\n"); -- cgit v1.2.3-55-g6feb