MINOR: quic: Useless TLS context allocations in qc_do_rm_hp()

These allocations are definitively useless.

Must be backported to 2.7.
This commit is contained in:
Frédéric Lécaille 2023-03-07 10:28:16 +01:00 committed by Amaury Denoyelle
parent 8ac8a8778d
commit 433af7fad9

View File

@ -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;
}