diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-10-20 16:52:40 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-10-25 11:14:23 +0100 |
commit | 82b7a0eee90e3280bd0e2dd4a9812b3873a7f462 (patch) | |
tree | 7630a4484a7818a45a212ffaa1d8500ba4907059 /test | |
parent | 3860ef2ae69ad9187acc17e0d1c78261dbc63125 (diff) |
QUIC TLS: Ensure QUIC_TLS is ticked between each processed RX packet
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22476)
Diffstat (limited to 'test')
-rw-r--r-- | test/quicapitest.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/quicapitest.c b/test/quicapitest.c index 83221885bc..51d6eea245 100644 --- a/test/quicapitest.c +++ b/test/quicapitest.c @@ -1057,15 +1057,15 @@ static int non_io_retry_cert_verify_cb(X509_STORE_CTX *ctx, void *arg) { int idx = SSL_get_ex_data_X509_STORE_CTX_idx(); SSL *ssl; - int *ctr = (int *)arg; + const int *allow = (int *)arg; /* this should not happen but check anyway */ if (idx < 0 || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL) return 0; - /* If this is the first time we've been called then retry */ - if (((*ctr)++) == 0) + /* If this is our first attempt then retry */ + if (*allow == 0) return SSL_set_retry_verify(ssl); /* Otherwise do nothing - verification succeeds. Continue as normal */ @@ -1082,7 +1082,7 @@ static int test_non_io_retry(int idx) SSL *clientquic = NULL; QUIC_TSERVER *qtserv = NULL; int testresult = 0; - int flags = 0, ctr = 0; + int flags = 0, allow = 0; if (idx >= 1 && !qtest_supports_blocking()) return TEST_skip("Blocking tests not supported in this build"); @@ -1091,7 +1091,7 @@ static int test_non_io_retry(int idx) if (!TEST_ptr(cctx)) goto err; - SSL_CTX_set_cert_verify_callback(cctx, non_io_retry_cert_verify_cb, &ctr); + SSL_CTX_set_cert_verify_callback(cctx, non_io_retry_cert_verify_cb, &allow); flags = (idx >= 1) ? QTEST_FLAG_BLOCK : 0; if (!TEST_true(qtest_create_quic_objects(libctx, cctx, NULL, cert, privkey, @@ -1099,8 +1099,11 @@ static int test_non_io_retry(int idx) NULL)) || !TEST_true(qtest_create_quic_connection_ex(qtserv, clientquic, SSL_ERROR_WANT_RETRY_VERIFY)) - || !TEST_int_eq(SSL_want(clientquic), SSL_RETRY_VERIFY) - || !TEST_true(qtest_create_quic_connection(qtserv, clientquic))) + || !TEST_int_eq(SSL_want(clientquic), SSL_RETRY_VERIFY)) + goto err; + + allow = 1; + if (!TEST_true(qtest_create_quic_connection(qtserv, clientquic))) goto err; testresult = 1; |