-/* $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 <jsing@openbsd.org>
* Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
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)
&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;
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)
&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;
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)
&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");