Raise a protocol error if we have not received transport params from peer

If we complete the TLS handshake but transport params were not received
then this is a protcol error and we should fail.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20030)
This commit is contained in:
Matt Caswell 2022-12-07 16:55:21 +00:00 committed by Hugo Landau
parent f10e5885f0
commit 62d0da12e3
1 changed files with 5 additions and 1 deletions

View File

@ -613,12 +613,16 @@ static int ch_on_handshake_complete(void *arg)
if (!ossl_assert(ch->tx_enc_level == QUIC_ENC_LEVEL_1RTT))
return 0;
if (!ch->got_remote_transport_params)
if (!ch->got_remote_transport_params) {
/*
* Was not a valid QUIC handshake if we did not get valid transport
* params.
*/
ossl_quic_channel_raise_protocol_error(ch, QUIC_ERR_PROTOCOL_VIOLATION,
OSSL_QUIC_FRAME_TYPE_CRYPTO,
"no transport parameters received");
return 0;
}
/* Don't need transport parameters anymore. */
OPENSSL_free(ch->local_transport_params);