]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong key update cipher context initialization for encryption
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 2 May 2023 18:03:19 +0000 (20:03 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 9 May 2023 09:03:26 +0000 (11:03 +0200)
As noticed by Miroslav, there was a typo in quic_tls_key_update() which lead
a cipher context for decryption to be initialized and used in place of a cipher
context for encryption. Surprisingly, this did not prevent the key update
from working. Perhaps this is due to the fact that the underlying cryptographic
algorithms used by QUIC are all symetric algorithms.

Also modify incorrect traces.

Must be backported in 2.6 and 2.7.

src/quic_conn.c

index 096f5e388741e41e520f870a063dafff8cc160a7..069609ab68728f1b0bf6fd3c1b750f74e36c81fa 100644 (file)
@@ -948,7 +948,7 @@ static int quic_tls_key_update(struct quic_conn *qc)
        }
 
        if (!quic_tls_rx_ctx_init(&nxt_rx->ctx, tls_ctx->rx.aead, nxt_rx->key)) {
-               TRACE_ERROR("could not initial RX TLS cipher context", QUIC_EV_CONN_KP, qc);
+               TRACE_ERROR("could not initialize RX TLS cipher context", QUIC_EV_CONN_KP, qc);
                goto leave;
        }
 
@@ -957,8 +957,8 @@ static int quic_tls_key_update(struct quic_conn *qc)
                nxt_tx->ctx = NULL;
        }
 
-       if (!quic_tls_rx_ctx_init(&nxt_tx->ctx, tls_ctx->tx.aead, nxt_tx->key)) {
-               TRACE_ERROR("could not initial RX TLS cipher context", QUIC_EV_CONN_KP, qc);
+       if (!quic_tls_tx_ctx_init(&nxt_tx->ctx, tls_ctx->tx.aead, nxt_tx->key)) {
+               TRACE_ERROR("could not initialize TX TLS cipher context", QUIC_EV_CONN_KP, qc);
                goto leave;
        }