summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_tserver.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-12-02 14:38:46 +0000
committerHugo Landau <hlandau@openssl.org>2023-02-22 05:34:03 +0000
commitd03fe5de8d1b78dd8190a9bce04bb228719b9947 (patch)
treee56b0aedc2e42b15800f2ec044d78f094899ebec /ssl/quic/quic_tserver.c
parent71587f2b6a711bc8cd18521575910291f637dfcf (diff)
Add the ability to mutate TLS handshake messages before they are written
We add callbacks so that TLS handshake messages can be modified by the test framework before they are passed to the handshake hash, possibly encrypted and written to the network. This enables us to simulate badly behaving endpoints. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20030)
Diffstat (limited to 'ssl/quic/quic_tserver.c')
-rw-r--r--ssl/quic/quic_tserver.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 1bb17e8e53..2a6049b134 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -123,15 +123,26 @@ void ossl_quic_tserver_free(QUIC_TSERVER *srv)
}
/* Set mutator callbacks for test framework support */
-int ossl_quic_tserver_set_mutator(QUIC_TSERVER *srv,
- ossl_mutate_packet_cb mutatecb,
- ossl_finish_mutate_cb finishmutatecb,
- void *mutatearg)
+int ossl_quic_tserver_set_plain_packet_mutator(QUIC_TSERVER *srv,
+ ossl_mutate_packet_cb mutatecb,
+ ossl_finish_mutate_cb finishmutatecb,
+ void *mutatearg)
{
return ossl_quic_channel_set_mutator(srv->ch, mutatecb, finishmutatecb,
mutatearg);
}
+int ossl_quic_tserver_set_handshake_mutator(QUIC_TSERVER *srv,
+ ossl_statem_mutate_handshake_cb mutate_handshake_cb,
+ ossl_statem_finish_mutate_handshake_cb finish_mutate_handshake_cb,
+ void *mutatearg)
+{
+ return ossl_statem_set_mutator(ossl_quic_channel_get0_ssl(srv->ch),
+ mutate_handshake_cb,
+ finish_mutate_handshake_cb,
+ mutatearg);
+}
+
int ossl_quic_tserver_tick(QUIC_TSERVER *srv)
{
ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(srv->ch));