summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2024-03-27 23:56:34 +0000
committerbeck <>2024-03-27 23:56:34 +0000
commit004f0a8ad8e13428adef24cd9279ab44fad1f2d2 (patch)
tree8a868bee139ad219cdb64f94a0e316dc56708708 /src
parent298923a130069a65297bca47c69a28e596f74798 (diff)
downloadopenbsd-004f0a8ad8e13428adef24cd9279ab44fad1f2d2.tar.gz
openbsd-004f0a8ad8e13428adef24cd9279ab44fad1f2d2.tar.bz2
openbsd-004f0a8ad8e13428adef24cd9279ab44fad1f2d2.zip
fix leaks in the horrible ssl whackery necessary for this test.
ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/tlsext/tlsexttest.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c
index e61722542e..eced498572 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.87 2024/03/27 22:27:09 beck Exp $ */ 1/* $OpenBSD: tlsexttest.c,v 1.88 2024/03/27 23:56:34 beck 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>
@@ -3704,11 +3704,12 @@ test_tlsext_keyshare_client(void)
3704 ssl->version = TLS1_3_VERSION; 3704 ssl->version = TLS1_3_VERSION;
3705 3705
3706 /* Fake up the ssl enough so the key share can process */ 3706 /* Fake up the ssl enough so the key share can process */
3707 tls_key_share_free(ssl->s3->hs.key_share);
3707 ssl->session = SSL_SESSION_new(); 3708 ssl->session = SSL_SESSION_new();
3708 ssl->s3 = calloc(1, sizeof(*ssl->s3)); 3709 memset(ssl->s3, 0, sizeof(*ssl->s3));
3709 ssl->session->tlsext_supportedgroups = calloc(4, 3710 ssl->session->tlsext_supportedgroups = calloc(4,
3710 sizeof(unsigned short)); 3711 sizeof(unsigned short));
3711 if (ssl->session == NULL || ssl->s3 == NULL || 3712 if (ssl->session == NULL ||
3712 ssl->session->tlsext_supportedgroups == NULL) { 3713 ssl->session->tlsext_supportedgroups == NULL) {
3713 FAIL("malloc"); 3714 FAIL("malloc");
3714 goto done; 3715 goto done;
@@ -3746,7 +3747,7 @@ test_tlsext_keyshare_client(void)
3746 * should fail to process. 3747 * should fail to process.
3747 */ 3748 */
3748 ssl->s3->hs.extensions_seen = 0; 3749 ssl->s3->hs.extensions_seen = 0;
3749 free(ssl->s3->hs.key_share); 3750 tls_key_share_free(ssl->s3->hs.key_share);
3750 ssl->s3->hs.key_share = NULL; 3751 ssl->s3->hs.key_share = NULL;
3751 CBS_init(&cbs, data, dlen); 3752 CBS_init(&cbs, data, dlen);
3752 if (server_funcs->process(ssl, SSL_TLSEXT_MSG_CH, &cbs, &alert)) { 3753 if (server_funcs->process(ssl, SSL_TLSEXT_MSG_CH, &cbs, &alert)) {