quic: fix compilation without libgcrypt aead.

When that version isn't available, we still need to have this
function available. Make it always available, then, with empty
implementation.

Change-Id: Ia827922c181676bbb2ba4a02dc09290b8cdb1a5c
Reviewed-on: https://code.wireshark.org/review/31491
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2019-01-11 15:44:29 +00:00 committed by Anders Broman
parent 646474306b
commit a409f5c894
1 changed files with 10 additions and 2 deletions

View File

@ -450,7 +450,6 @@ static guint64 quic_pkt_adjust_pkt_num(guint64 max_pkt_num, guint64 pkt_num,
return b;
}
#ifdef HAVE_LIBGCRYPT_AEAD
/**
* Given a header protection cipher, a buffer and the packet number offset,
* return the unmasked first byte and packet number.
@ -459,6 +458,7 @@ static gboolean
quic_decrypt_header(tvbuff_t *tvb, guint pn_offset, gcry_cipher_hd_t hp_cipher, int hp_cipher_algo,
guint8 *first_byte, guint32 *pn)
{
#ifdef HAVE_LIBGCRYPT_AEAD
gcry_cipher_hd_t h = hp_cipher;
if (!hp_cipher) {
// need to know the cipher.
@ -517,8 +517,16 @@ quic_decrypt_header(tvbuff_t *tvb, guint pn_offset, gcry_cipher_hd_t hp_cipher,
*first_byte = packet0;
*pn = pkt_pkn;
return TRUE;
}
#else
(void)tvb;
(void)pn_offset;
(void)hp_cipher;
(void)hp_cipher_algo;
(void)first_byte;
(void)pn;
return FALSE;
#endif /* !HAVE_LIBGCRYPT_AEAD */
}
/**
* Calculate the full packet number and store it for later use.