-/* $OpenBSD: tlsexttest.c,v 1.68 2022/08/05 08:51:35 tb Exp $ */
+/* $OpenBSD: tlsexttest.c,v 1.69 2022/08/05 16:51:11 tb Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2017 Doug Hogan <doug@openbsd.org>
int failure, alert;
size_t dlen;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
int failure, alert;
size_t dlen;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Test parsing secp384r1
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Use a custom order.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
SSL_SESSION_free(ssl->session);
if ((ssl->session = SSL_SESSION_new()) == NULL)
* Parse non-default curves to session.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
failure = 1;
- CBB_init(&cbb, 0);
+ 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");
* Make sure we can parse the default.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Test with a custom order.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Make sure that we can parse this custom order.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL)
errx(1, "failed to create SSL_CTX");
* Cannot parse a non-default list without at least uncompressed.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Test with a custom order that replaces the default uncompressed.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
* Should be able to parse the custom list into a session list.
*/
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLSv1_2_client_method())) == NULL)
errx(1, "failed to create SSL_CTX");
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL)
errx(1, "failed to create SSL_CTX");
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL)
errx(1, "failed to create SSL_CTX");
&server_funcs))
errx(1, "failed to fetch sni funcs");
- CBB_init(&cbb, 0);
+ 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");
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL)
errx(1, "failed to create SSL_CTX");
&client_funcs, &server_funcs))
errx(1, "failed to fetch quic transport parameter funcs");
- CBB_init(&cbb, 0);
+ 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");
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
if ((ssl_ctx = SSL_CTX_new(TLS_server_method())) == NULL)
errx(1, "failed to create SSL_CTX");
failure = 1;
- CBB_init(&cbb, 0);
+ 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");
failure = 1;
- CBB_init(&cbb, 0);
+ 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");
failure = 1;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
/* Create fake session tickets with random data. */
arc4random_buf(tlsext_sessionticket_hello_min,
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
free(ssl->session->tlsext_tick);
size_t dlen;
CBB cbb;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;
int failure, alert;
size_t dlen;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
int failure, alert;
size_t dlen;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;
}
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
free(data);
data = NULL;
free(data);
data = NULL;
CBB_cleanup(&cbb);
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
/* Switch to TLSv1.1, disable EC ciphers and session tickets. */
ssl->s3->hs.our_max_tls_version = TLS1_1_VERSION;
CBB_cleanup(&cbb);
free(data);
data = NULL;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
/* Turn a few things on so we get extensions... */
ssl->s3->send_connection_binding = 1;
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
&server_funcs))
errx(1, "failed to fetch keyshare funcs");
- CBB_init(&cbb, 0);
+ 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)) {
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
CBB cbb;
CBS cbs;
- CBB_init(&cbb, 0);
+ 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");
CBS cbs;
int alert;
- CBB_init(&cbb, 0);
+ if (!CBB_init(&cbb, 0))
+ errx(1, "Failed to create CBB");
failure = 1;