diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-28 17:56:34 +0200 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-24 11:34:47 +0200 |
commit | 5915a900af86db8625caa77a02fd50cf9a3b3e1b (patch) | |
tree | e5b1eb84756d90e850855f3452cbbd2827e7e7bb | |
parent | QUIC MSMT: Stress tests, support for repeating test opoerations (diff) | |
download | openssl-5915a900af86db8625caa77a02fd50cf9a3b3e1b.tar.xz openssl-5915a900af86db8625caa77a02fd50cf9a3b3e1b.zip |
QUIC QSM: Allow QSM to know if we are in the server role
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20856)
-rw-r--r-- | include/internal/quic_stream_map.h | 4 | ||||
-rw-r--r-- | ssl/quic/quic_channel.c | 4 | ||||
-rw-r--r-- | ssl/quic/quic_stream_map.c | 4 | ||||
-rw-r--r-- | test/quic_txp_test.c | 3 |
4 files changed, 10 insertions, 5 deletions
diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h index 1af0c57d1e..7d2356c22d 100644 --- a/include/internal/quic_stream_map.h +++ b/include/internal/quic_stream_map.h @@ -255,6 +255,7 @@ typedef struct quic_stream_map_st { void *get_stream_limit_cb_arg; QUIC_RXFC *max_streams_bidi_rxfc; QUIC_RXFC *max_streams_uni_rxfc; + int is_server; } QUIC_STREAM_MAP; /* @@ -274,7 +275,8 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm, uint64_t (*get_stream_limit_cb)(int uni, void *arg), void *get_stream_limit_cb_arg, QUIC_RXFC *max_streams_bidi_rxfc, - QUIC_RXFC *max_streams_uni_rxfc); + QUIC_RXFC *max_streams_uni_rxfc, + int is_server); /* * Any streams still in the map will be released as though diff --git a/ssl/quic/quic_channel.c b/ssl/quic/quic_channel.c index 6e0af86760..4325434c4f 100644 --- a/ssl/quic/quic_channel.c +++ b/ssl/quic/quic_channel.c @@ -186,7 +186,8 @@ static int ch_init(QUIC_CHANNEL *ch) if (!ossl_quic_stream_map_init(&ch->qsm, get_stream_limit, ch, &ch->max_streams_bidi_rxfc, - &ch->max_streams_uni_rxfc)) + &ch->max_streams_uni_rxfc, + ch->is_server)) goto err; ch->have_qsm = 1; @@ -2426,7 +2427,6 @@ QUIC_STREAM *ossl_quic_channel_new_stream_local(QUIC_CHANNEL *ch, int is_uni) if (!ch_init_new_stream(ch, qs, /*can_send=*/1, /*can_recv=*/!is_uni)) goto err; - ++*p_next_ordinal; return qs; diff --git a/ssl/quic/quic_stream_map.c b/ssl/quic/quic_stream_map.c index 680fe48ad9..138a063bf6 100644 --- a/ssl/quic/quic_stream_map.c +++ b/ssl/quic/quic_stream_map.c @@ -89,7 +89,8 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm, uint64_t (*get_stream_limit_cb)(int uni, void *arg), void *get_stream_limit_cb_arg, QUIC_RXFC *max_streams_bidi_rxfc, - QUIC_RXFC *max_streams_uni_rxfc) + QUIC_RXFC *max_streams_uni_rxfc, + int is_server) { qsm->map = lh_QUIC_STREAM_new(hash_stream, cmp_stream); qsm->active_list.prev = qsm->active_list.next = &qsm->active_list; @@ -105,6 +106,7 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm, qsm->get_stream_limit_cb_arg = get_stream_limit_cb_arg; qsm->max_streams_bidi_rxfc = max_streams_bidi_rxfc; qsm->max_streams_uni_rxfc = max_streams_uni_rxfc; + qsm->is_server = is_server; return 1; } diff --git a/test/quic_txp_test.c b/test/quic_txp_test.c index 3c9804d2ab..7e5e0edc7a 100644 --- a/test/quic_txp_test.c +++ b/test/quic_txp_test.c @@ -176,7 +176,8 @@ static int helper_init(struct helper *h) if (!TEST_true(ossl_quic_stream_map_init(&h->qsm, NULL, NULL, &h->max_streams_bidi_rxfc, - &h->max_streams_uni_rxfc))) + &h->max_streams_uni_rxfc, + /*is_server=*/0))) goto err; h->have_qsm = 1; |