]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add the ability to send NewSessionTicket messages when we want them
authorMatt Caswell <matt@openssl.org>
Mon, 7 Aug 2023 14:48:01 +0000 (15:48 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 15 Aug 2023 13:41:31 +0000 (14:41 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21686)

include/internal/quic_tserver.h
ssl/quic/quic_tserver.c
test/quic_multistream_test.c

index 9520deb0c17479584a76462be6faa6509822f3af..90834b211c7f0a15cb08063964a776c1f15d5b02 100644 (file)
@@ -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
index 791905d2edbbf93458dfeecb8c270a1ae0bb04ef..ae792c5e7af181ac7d63f574f4290399d8f1b17c 100644 (file)
@@ -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);
+}
index 31737e89a29a8188ba914785d7420ccd1f3461a6..a9de46230fc1bff88263255692c4e4d2a287da56 100644 (file)
@@ -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;