From aedbb67da548df0585f48b0c49d758c2366fea7f Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 23 Apr 2023 18:59:41 +0000 Subject: Fix the client test and the tlsext test to work with randomized TLS extensions (this involves unrandomizing the extension order for the tests that rely on golden numbers. --- src/regress/lib/libssl/tlsext/tlsexttest.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/regress/lib/libssl/tlsext') diff --git a/src/regress/lib/libssl/tlsext/tlsexttest.c b/src/regress/lib/libssl/tlsext/tlsexttest.c index 923c50d5aa..f5241c8f62 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.79 2022/11/26 16:08:57 tb Exp $ */ +/* $OpenBSD: tlsexttest.c,v 1.80 2023/04/23 18:59:41 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -36,6 +36,7 @@ struct tls_extension_funcs { const struct tls_extension *tls_extension_find(uint16_t, size_t *); const struct tls_extension_funcs *tlsext_funcs(const struct tls_extension *, int); +int tlsext_linearize_build_order(SSL *); static int tls_extension_funcs(int type, const struct tls_extension_funcs **client_funcs, @@ -3223,6 +3224,11 @@ test_tlsext_clienthello_build(void) goto err; } + if (!tlsext_linearize_build_order(ssl)) { + FAIL("failed to linearize build order"); + goto err; + } + if (!tls_extension_funcs(TLSEXT_TYPE_supported_versions, &client_funcs, &server_funcs)) errx(1, "failed to fetch supported versions funcs"); @@ -3339,6 +3345,10 @@ test_tlsext_serverhello_build(void) FAIL("failed to create SSL"); goto err; } + if (!tlsext_linearize_build_order(ssl)) { + FAIL("failed to linearize build order"); + goto err; + } if ((ssl->session = SSL_SESSION_new()) == NULL) { FAIL("failed to create session"); goto err; -- cgit v1.2.3-55-g6feb