From: Frédéric Lécaille Date: Tue, 7 Mar 2023 09:28:16 +0000 (+0100) Subject: MINOR: quic: Useless TLS context allocations in qc_do_rm_hp() X-Git-Tag: v2.8-dev5~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=433af7fad9ec05df01438bf4f9a05464b3b73ef5;p=thirdparty%2Fhaproxy.git MINOR: quic: Useless TLS context allocations in qc_do_rm_hp() These allocations are definitively useless. Must be backported to 2.7. --- diff --git a/src/quic_conn.c b/src/quic_conn.c index 91afd74a5f..b6344db2b9 100644 --- a/src/quic_conn.c +++ b/src/quic_conn.c @@ -1449,7 +1449,6 @@ static int qc_do_rm_hp(struct quic_conn *qc, uint32_t truncated_pn = 0; unsigned char mask[5] = {0}; unsigned char *sample; - EVP_CIPHER_CTX *cctx = NULL; TRACE_ENTER(QUIC_EV_CONN_RMHP, qc); @@ -1461,12 +1460,6 @@ static int qc_do_rm_hp(struct quic_conn *qc, goto leave; } - cctx = EVP_CIPHER_CTX_new(); - if (!cctx) { - TRACE_ERROR("memory allocation failed", QUIC_EV_CONN_RMHP, qc, pkt); - goto leave; - } - sample = pn + QUIC_PACKET_PN_MAXLEN; if (!quic_tls_aes_decrypt(mask, sample, sizeof mask, tls_ctx->rx.hp_ctx)) { @@ -1488,8 +1481,6 @@ static int qc_do_rm_hp(struct quic_conn *qc, ret = 1; leave: - if (cctx) - EVP_CIPHER_CTX_free(cctx); TRACE_LEAVE(QUIC_EV_CONN_RMHP, qc); return ret; }