aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb2.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-04-20 21:08:29 -0400
committerJohn Thacker <johnthacker@gmail.com>2022-04-20 21:30:21 -0400
commitb80cdaa2436bcbc8dd8e0a9c16215f8b879d2620 (patch)
tree8d738bdc08998c56c97f06a45920938b88c3663b /epan/dissectors/packet-smb2.c
parent9c115d0ed5fbb285ff429de628b49e95d8ca7665 (diff)
libgcrypt: Require version 1.8.0
Libgcrypt 1.8.x is required for a large amount of decryption support and is the current LTS version of libgcrypt. The 1.6 and 1.7 series have been end-of-life since 2017-06-30 and 2019-06-30, respectively. The Linux distributions that have versions of libgcrypt before 1.8.0 are nearing or at end of support (RHEL7, SLES 12, Debian stretch, Ubuntu 16.04LTS) and can be supported by the Wireshark 3.6 LTS release series. Remove an enormous amount of ifdefs based on libgcrypt versions 1.6.0, 1.7.0, and 1.8.0. There will be a second pass for the commons defines HAVE_LIBGCRYPT_AEAD, HAVE_LIBGCRYPT_CHACHA20, and HAVE_LIBGCRYPT_CHACHA20_POLY1305, which are now always defined. The ISAKMP dissector has some comments noting that some workarounds were used for libgcrypt 1.6 that aren't needed with 1.7; perhaps that could be updated now.
Diffstat (limited to 'epan/dissectors/packet-smb2.c')
-rw-r--r--epan/dissectors/packet-smb2.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 2213a374bc..0656693a05 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -10100,7 +10100,6 @@ static smb2_function smb2_dissector[256] = {
#define SMB3_AES128CCM_NONCE 11
#define SMB3_AES128GCM_NONCE 12
-#if GCRYPT_VERSION_NUMBER >= 0x010600 /* 1.6.0 */
static gboolean is_decrypted_header_ok(guint8 *p, size_t size)
{
if (size < 4)
@@ -10362,7 +10361,6 @@ decrypt_smb_payload(packet_info *pinfo,
sti->session->server_port = pinfo->srcport;
return data;
}
-#endif
/*
Append tvb[offset:offset+length] to out
@@ -10668,13 +10666,9 @@ dissect_smb2_transform_header(packet_info *pinfo, proto_tree *tree,
sti->session = smb2_get_session(sti->conv, sti->sesid, NULL, NULL);
smb2_add_session_info(sesid_tree, sesid_item, tvb, sesid_offset, sti->session);
-#if GCRYPT_VERSION_NUMBER >= 0x010600 /* 1.6.0 */
if (sti->flags & SMB2_TRANSFORM_FLAGS_ENCRYPTED) {
plain_data = decrypt_smb_payload(pinfo, tvb, offset, offset_aad, sti);
}
-#else
- (void) offset_aad;
-#endif
*enc_tvb = tvb_new_subset_length(tvb, offset, sti->size);
if (plain_data != NULL) {
@@ -10829,7 +10823,7 @@ dissect_smb2_tid_sesid(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb,
return offset;
}
-#if GCRYPT_VERSION_NUMBER >= 0x010600
+
static void
dissect_smb2_signature(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, smb2_info_t *si)
{
@@ -10896,7 +10890,6 @@ dissect_smb2_signature(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree
return;
}
-#endif
static int
dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolean first_in_chain)
@@ -11063,11 +11056,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
offset = dissect_smb2_tid_sesid(pinfo, header_tree, tvb, offset, si);
/* Signature */
-#if GCRYPT_VERSION_NUMBER >= 0x010600
dissect_smb2_signature(pinfo, tvb, offset, header_tree, si);
-#else
- proto_tree_add_item(header_tree, hf_smb2_signature, tvb, offset, 16, ENC_NA);
-#endif
offset += 16;
proto_item_set_len(header_item, offset);