diff options
author | tb <> | 2023-04-23 18:59:41 +0000 |
---|---|---|
committer | tb <> | 2023-04-23 18:59:41 +0000 |
commit | aedbb67da548df0585f48b0c49d758c2366fea7f (patch) | |
tree | 8e2ef0fc4362e087ab7be216976b0cd6db4b81a4 /src/regress/lib/libssl/tlsext | |
parent | fb7a7adad4b566192144a21e4c93b739671b0cae (diff) | |
download | openbsd-aedbb67da548df0585f48b0c49d758c2366fea7f.tar.gz openbsd-aedbb67da548df0585f48b0c49d758c2366fea7f.tar.bz2 openbsd-aedbb67da548df0585f48b0c49d758c2366fea7f.zip |
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.
Diffstat (limited to 'src/regress/lib/libssl/tlsext')
-rw-r--r-- | src/regress/lib/libssl/tlsext/tlsexttest.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: tlsexttest.c,v 1.79 2022/11/26 16:08:57 tb Exp $ */ | 1 | /* $OpenBSD: tlsexttest.c,v 1.80 2023/04/23 18:59:41 tb 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> |
@@ -36,6 +36,7 @@ struct tls_extension_funcs { | |||
36 | const struct tls_extension *tls_extension_find(uint16_t, size_t *); | 36 | const struct tls_extension *tls_extension_find(uint16_t, size_t *); |
37 | const struct tls_extension_funcs *tlsext_funcs(const struct tls_extension *, | 37 | const struct tls_extension_funcs *tlsext_funcs(const struct tls_extension *, |
38 | int); | 38 | int); |
39 | int tlsext_linearize_build_order(SSL *); | ||
39 | 40 | ||
40 | static int | 41 | static int |
41 | tls_extension_funcs(int type, const struct tls_extension_funcs **client_funcs, | 42 | tls_extension_funcs(int type, const struct tls_extension_funcs **client_funcs, |
@@ -3223,6 +3224,11 @@ test_tlsext_clienthello_build(void) | |||
3223 | goto err; | 3224 | goto err; |
3224 | } | 3225 | } |
3225 | 3226 | ||
3227 | if (!tlsext_linearize_build_order(ssl)) { | ||
3228 | FAIL("failed to linearize build order"); | ||
3229 | goto err; | ||
3230 | } | ||
3231 | |||
3226 | if (!tls_extension_funcs(TLSEXT_TYPE_supported_versions, &client_funcs, | 3232 | if (!tls_extension_funcs(TLSEXT_TYPE_supported_versions, &client_funcs, |
3227 | &server_funcs)) | 3233 | &server_funcs)) |
3228 | errx(1, "failed to fetch supported versions funcs"); | 3234 | errx(1, "failed to fetch supported versions funcs"); |
@@ -3339,6 +3345,10 @@ test_tlsext_serverhello_build(void) | |||
3339 | FAIL("failed to create SSL"); | 3345 | FAIL("failed to create SSL"); |
3340 | goto err; | 3346 | goto err; |
3341 | } | 3347 | } |
3348 | if (!tlsext_linearize_build_order(ssl)) { | ||
3349 | FAIL("failed to linearize build order"); | ||
3350 | goto err; | ||
3351 | } | ||
3342 | if ((ssl->session = SSL_SESSION_new()) == NULL) { | 3352 | if ((ssl->session = SSL_SESSION_new()) == NULL) { |
3343 | FAIL("failed to create session"); | 3353 | FAIL("failed to create session"); |
3344 | goto err; | 3354 | goto err; |