From 2e25cc2ddcc4d757a1f5e0f00578cfcacfc7c07f Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 5 Aug 2022 17:06:17 +0000 Subject: [PATCH] Move CBB_init() to a consistent place. --- regress/lib/libssl/tlsext/tlsexttest.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/regress/lib/libssl/tlsext/tlsexttest.c b/regress/lib/libssl/tlsext/tlsexttest.c index 918d9c51fee..a2246238814 100644 --- a/regress/lib/libssl/tlsext/tlsexttest.c +++ b/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"); -- 2.20.1