mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
drop some redundant checking.
This commit is contained in:
parent
a43cc05651
commit
65e605a10d
2 changed files with 4 additions and 12 deletions
|
@ -2240,6 +2240,7 @@ iquic_esf_decrypt_packet (enc_session_t *enc_session_p,
|
||||||
enum enc_level enc_level;
|
enum enc_level enc_level;
|
||||||
enum packnum_space pns;
|
enum packnum_space pns;
|
||||||
lsquic_packno_t packno;
|
lsquic_packno_t packno;
|
||||||
|
size_t out_sz;
|
||||||
enum dec_packin dec_packin;
|
enum dec_packin dec_packin;
|
||||||
int s;
|
int s;
|
||||||
/* 16Bytes: AEAD authentication tag
|
/* 16Bytes: AEAD authentication tag
|
||||||
|
@ -2251,17 +2252,12 @@ iquic_esf_decrypt_packet (enc_session_t *enc_session_p,
|
||||||
* These cipher suites have a 16-byte authentication tag and
|
* These cipher suites have a 16-byte authentication tag and
|
||||||
* produce an output 16 bytes larger than their input.
|
* produce an output 16 bytes larger than their input.
|
||||||
*/
|
*/
|
||||||
size_t out_sz, dst_sz;
|
const size_t dst_sz = packet_in->pi_data_sz - IQUIC_TAG_LEN;
|
||||||
unsigned char new_secret[EVP_MAX_KEY_LENGTH];
|
unsigned char new_secret[EVP_MAX_KEY_LENGTH];
|
||||||
struct crypto_ctx crypto_ctx_buf;
|
struct crypto_ctx crypto_ctx_buf;
|
||||||
char secret_str[EVP_MAX_KEY_LENGTH * 2 + 1];
|
char secret_str[EVP_MAX_KEY_LENGTH * 2 + 1];
|
||||||
char errbuf[ERR_ERROR_STRING_BUF_LEN];
|
char errbuf[ERR_ERROR_STRING_BUF_LEN];
|
||||||
|
|
||||||
if (packet_in->pi_data_sz <= 16) {
|
|
||||||
dec_packin = DECPI_TOO_SHORT;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
dst_sz = packet_in->pi_data_sz - 16;
|
|
||||||
dst = lsquic_mm_get_packet_in_buf(&enpub->enp_mm, dst_sz);
|
dst = lsquic_mm_get_packet_in_buf(&enpub->enp_mm, dst_sz);
|
||||||
if (!dst)
|
if (!dst)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4177,15 +4177,11 @@ gquic2_esf_decrypt_packet (enc_session_t *enc_session_p,
|
||||||
unsigned sample_off, packno_len, divers_nonce_len;
|
unsigned sample_off, packno_len, divers_nonce_len;
|
||||||
enum gel gel;
|
enum gel gel;
|
||||||
lsquic_packno_t packno;
|
lsquic_packno_t packno;
|
||||||
size_t out_sz, dst_sz;
|
size_t out_sz;
|
||||||
enum dec_packin dec_packin;
|
enum dec_packin dec_packin;
|
||||||
|
const size_t dst_sz = packet_in->pi_data_sz - IQUIC_TAG_LEN;
|
||||||
char errbuf[ERR_ERROR_STRING_BUF_LEN];
|
char errbuf[ERR_ERROR_STRING_BUF_LEN];
|
||||||
|
|
||||||
dst_sz = packet_in->pi_data_sz - 16;
|
|
||||||
if (dst_sz <= 16) {
|
|
||||||
dec_packin = DECPI_TOO_SHORT;
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
dst = lsquic_mm_get_packet_in_buf(&enpub->enp_mm, dst_sz);
|
dst = lsquic_mm_get_packet_in_buf(&enpub->enp_mm, dst_sz);
|
||||||
if (!dst)
|
if (!dst)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue