]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: quic: remove useless parameter 'key' from quic_packet_encrypt
authorEmeric Brun <ebrun@haproxy.com>
Tue, 11 Jul 2023 12:53:41 +0000 (14:53 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 12 Jul 2023 12:33:03 +0000 (14:33 +0200)
Parameter 'key' was not used in this function.

This patch removes it from the prototype of the function.

This patch could be backported until v2.6.

include/haproxy/quic_tls.h
src/quic_conn.c
src/quic_tls.c

index 2f8f51ccbc7f6f753367f02b105f04ff0e17a58c..4d1af10fe05b099b908bf874357ebeb33b0dcf91 100644 (file)
@@ -58,7 +58,7 @@ int quic_tls_derive_initial_secrets(const EVP_MD *md,
 int quic_tls_encrypt(unsigned char *buf, size_t len,
                      const unsigned char *aad, size_t aad_len,
                      EVP_CIPHER_CTX *ctx, const EVP_CIPHER *aead,
-                     const unsigned char *key, const unsigned char *iv);
+                     const unsigned char *iv);
 
 int quic_tls_decrypt2(unsigned char *out,
                       unsigned char *in, size_t ilen,
index 3edfef767211016fc272963f00fe4251aeb03711..f3891f12f7299578fbcc2fc750ede8cc48ef8422 100644 (file)
@@ -1565,7 +1565,7 @@ static void quic_packet_encrypt(unsigned char *payload, size_t payload_len,
        quic_aead_iv_build(iv, sizeof iv, tx_iv, tx_iv_sz, pn);
 
        if (!quic_tls_encrypt(payload, payload_len, aad, aad_len,
-                             tls_ctx->tx.ctx, tls_ctx->tx.aead, tls_ctx->tx.key, iv)) {
+                             tls_ctx->tx.ctx, tls_ctx->tx.aead, iv)) {
                TRACE_ERROR("QUIC packet encryption failed", QUIC_EV_CONN_ENCPKT, qc);
                *fail = 1;
                enc_debug_info_init(&edi, payload, payload_len, aad, aad_len, pn);
@@ -6402,7 +6402,7 @@ static int quic_generate_retry_token(unsigned char *token, size_t len,
        p += sizeof timestamp;
 
        /* Do not encrypt the QUIC_TOKEN_FMT_RETRY byte */
-       if (!quic_tls_encrypt(token + 1, p - token - 1, aad, aadlen, ctx, aead, key, iv)) {
+       if (!quic_tls_encrypt(token + 1, p - token - 1, aad, aadlen, ctx, aead, iv)) {
                TRACE_ERROR("quic_tls_encrypt() failed", QUIC_EV_CONN_TXPKT);
                goto err;
        }
index 3efea45a6e3de128e544544695a344485169c2a0..6eda50f2f4d833fbf8d5755962e24560b1f6883c 100644 (file)
@@ -671,7 +671,7 @@ int quic_tls_tx_ctx_init(EVP_CIPHER_CTX **tx_ctx,
 int quic_tls_encrypt(unsigned char *buf, size_t len,
                      const unsigned char *aad, size_t aad_len,
                      EVP_CIPHER_CTX *ctx, const EVP_CIPHER *aead,
-                     const unsigned char *key, const unsigned char *iv)
+                     const unsigned char *iv)
 {
        int outlen;
        int aead_nid = EVP_CIPHER_nid(aead);