]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Raise a protocol error if we have not received transport params from peer
authorMatt Caswell <matt@openssl.org>
Wed, 7 Dec 2022 16:55:21 +0000 (16:55 +0000)
committerHugo Landau <hlandau@openssl.org>
Wed, 22 Feb 2023 05:34:04 +0000 (05:34 +0000)
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)

ssl/quic/quic_channel.c

index be438426ba043a40ba7da2f50dac837218e7763f..bbb88470be7dc4a59947367db89055d05188ce2a 100644 (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);