summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-08-07 15:48:01 +0100
committerMatt Caswell <matt@openssl.org>2023-08-15 14:41:31 +0100
commit614c08c23999e39945b556851eabff157aef833f (patch)
treed623e01abfc50fb1abb7598308f5bc82584ec742
parent50a0af2e41ea61a79c19c17f9e87541e283ba8bf (diff)
Add the ability to send NewSessionTicket messages when we want them
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21686)
-rw-r--r--include/internal/quic_tserver.h3
-rw-r--r--ssl/quic/quic_tserver.c5
-rw-r--r--test/quic_multistream_test.c8
3 files changed, 16 insertions, 0 deletions
diff --git a/include/internal/quic_tserver.h b/include/internal/quic_tserver.h
index 9520deb0c1..90834b211c 100644
--- a/include/internal/quic_tserver.h
+++ b/include/internal/quic_tserver.h
@@ -201,6 +201,9 @@ void ossl_quic_tserver_set_msg_callback(QUIC_TSERVER *srv,
*/
QUIC_CHANNEL *ossl_quic_tserver_get_channel(QUIC_TSERVER *srv);
+/* Send a TLS new session ticket */
+int ossl_quic_tserver_new_ticket(QUIC_TSERVER *srv);
+
# endif
#endif
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 791905d2ed..ae792c5e7a 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -529,3 +529,8 @@ void ossl_quic_tserver_set_msg_callback(QUIC_TSERVER *srv,
ossl_quic_channel_set_msg_callback(srv->ch, f, NULL);
ossl_quic_channel_set_msg_callback_arg(srv->ch, arg);
}
+
+int ossl_quic_tserver_new_ticket(QUIC_TSERVER *srv)
+{
+ return SSL_new_session_ticket(srv->tls);
+}
diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 31737e89a2..a9de46230f 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -150,6 +150,7 @@ struct script_op {
#define OPK_C_INHIBIT_TICK 44
#define OPK_C_SET_WRITE_BUF_SIZE 45
#define OPK_S_SET_INJECT_HANDSHAKE 46
+#define OPK_S_NEW_TICKET 47
#define EXPECT_CONN_CLOSE_APP (1U << 0)
#define EXPECT_CONN_CLOSE_REMOTE (1U << 1)
@@ -271,6 +272,8 @@ struct script_op {
{OPK_C_SET_WRITE_BUF_SIZE, NULL, (size), NULL, #stream_name},
#define OP_S_SET_INJECT_HANDSHAKE(f) \
{OPK_S_SET_INJECT_HANDSHAKE, NULL, 0, NULL, NULL, 0, NULL, (f)},
+#define OP_S_NEW_TICKET() \
+ {OPK_S_NEW_TICKET},
static OSSL_TIME get_time(void *arg)
{
@@ -1588,6 +1591,11 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
break;
+ case OPK_S_NEW_TICKET:
+ if (!TEST_true(ossl_quic_tserver_new_ticket(h->s)))
+ goto out;
+ break;
+
default:
TEST_error("unknown op");
goto out;