summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/server/servertest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libssl/server/servertest.c')
-rw-r--r--src/regress/lib/libssl/server/servertest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/regress/lib/libssl/server/servertest.c b/src/regress/lib/libssl/server/servertest.c
index 3367836dbd..f13b260103 100644
--- a/src/regress/lib/libssl/server/servertest.c
+++ b/src/regress/lib/libssl/server/servertest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servertest.c,v 1.7 2022/06/10 22:00:15 tb Exp $ */ 1/* $OpenBSD: servertest.c,v 1.8 2023/07/11 10:09:47 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -84,6 +84,7 @@ struct server_hello_test {
84 const SSL_METHOD *(*ssl_method)(void); 84 const SSL_METHOD *(*ssl_method)(void);
85 const long ssl_clear_options; 85 const long ssl_clear_options;
86 const long ssl_set_options; 86 const long ssl_set_options;
87 int accept_fails;
87}; 88};
88 89
89static struct server_hello_test server_hello_tests[] = { 90static struct server_hello_test server_hello_tests[] = {
@@ -94,6 +95,7 @@ static struct server_hello_test server_hello_tests[] = {
94 .ssl_method = tls_legacy_method, 95 .ssl_method = tls_legacy_method,
95 .ssl_clear_options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1, 96 .ssl_clear_options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1,
96 .ssl_set_options = 0, 97 .ssl_set_options = 0,
98 .accept_fails = 1,
97 }, 99 },
98 { 100 {
99 .desc = "TLSv1.2 in SSLv2 record", 101 .desc = "TLSv1.2 in SSLv2 record",
@@ -102,6 +104,7 @@ static struct server_hello_test server_hello_tests[] = {
102 .ssl_method = tls_legacy_method, 104 .ssl_method = tls_legacy_method,
103 .ssl_clear_options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1, 105 .ssl_clear_options = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1,
104 .ssl_set_options = 0, 106 .ssl_set_options = 0,
107 .accept_fails = 1,
105 }, 108 },
106}; 109};
107 110
@@ -160,6 +163,8 @@ server_hello_test(int testno, struct server_hello_test *sht)
160 SSL_set_bio(ssl, rbio, wbio); 163 SSL_set_bio(ssl, rbio, wbio);
161 164
162 if (SSL_accept(ssl) != 0) { 165 if (SSL_accept(ssl) != 0) {
166 if (sht->accept_fails)
167 ret = 0;
163 fprintf(stderr, "SSL_accept() returned non-zero\n"); 168 fprintf(stderr, "SSL_accept() returned non-zero\n");
164 ERR_print_errors_fp(stderr); 169 ERR_print_errors_fp(stderr);
165 goto failure; 170 goto failure;