From dad0ede28aa6a653cf2257ef2f218013100ee9b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 24 Apr 2023 14:35:18 +0200 Subject: [PATCH] CLEANUP: quic: Rename variable to in quic_generate_retry_token() Make quic_generate_retry_token() be more readable: there is no struct buffer variable used in this function. Should be backported to 2.7. --- src/quic_conn.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/quic_conn.c b/src/quic_conn.c index d89dae1..399f22f 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -6340,12 +6340,12 @@ static int quic_generate_retry_token_aad(unsigned char *aad, /* QUIC server only function. * Generate the token to be used in Retry packets. The token is written to - * with as length. is the original destination connection + * with as length. is the original destination connection * ID and is our side destination connection ID (or client source * connection ID). * Returns the length of the encoded token or 0 on error. */ -static int quic_generate_retry_token(unsigned char *buf, size_t len, +static int quic_generate_retry_token(unsigned char *token, size_t len, const uint32_t version, const struct quic_cid *odcid, const struct quic_cid *dcid, @@ -6393,7 +6393,7 @@ static int quic_generate_retry_token(unsigned char *buf, size_t len, } /* Token build */ - p = buf; + p = token; *p++ = QUIC_TOKEN_FMT_RETRY, *p++ = odcid->len; memcpy(p, odcid->data, odcid->len); @@ -6402,7 +6402,7 @@ static int quic_generate_retry_token(unsigned char *buf, size_t len, p += sizeof timestamp; /* Do not encrypt the QUIC_TOKEN_FMT_RETRY byte */ - if (!quic_tls_encrypt(buf + 1, p - buf - 1, aad, aadlen, ctx, aead, key, iv)) { + if (!quic_tls_encrypt(token + 1, p - token - 1, aad, aadlen, ctx, aead, key, iv)) { TRACE_ERROR("quic_tls_encrypt() failed", QUIC_EV_CONN_TXPKT); goto err; } @@ -6412,7 +6412,7 @@ static int quic_generate_retry_token(unsigned char *buf, size_t len, p += sizeof salt; EVP_CIPHER_CTX_free(ctx); - ret = p - buf; + ret = p - token; leave: TRACE_LEAVE(QUIC_EV_CONN_TXPKT); return ret; -- 1.7.10.4