summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-09-12 15:56:29 +0200
committerEvan Huus <eapache@gmail.com>2014-09-12 22:06:16 +0000
commit0a0654a7aa58d16063d9bc35e61c7917fa5d1e58 (patch)
tree66a537797e92c2897f9b637a88a1d9213be87e0a
parent5ade437ffe07627a380bcd4dfb3d35ad57d252d7 (diff)
downloadwireshark-0a0654a7aa58d16063d9bc35e61c7917fa5d1e58.tar.gz
IPSec: fix compilation when building without libgcrypt
Change-Id: Iea3de2f0a54f9c0703afbeb42722d18da99f5c9a Reviewed-on: https://code.wireshark.org/review/4090 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r--epan/dissectors/packet-ipsec.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index cbae3832b1..6f7b6c8e64 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -466,6 +466,15 @@ void esp_sa_record_add_from_dissector(guint8 protocol, const gchar *srcIP, const
uat_esp_sa_record_update_cb(record, NULL);
}
+/*************************************/
+/* Preference settings */
+
+/* Default ESP payload decode to off */
+static gboolean g_esp_enable_encryption_decode = FALSE;
+
+/* Default ESP payload Authentication Checking to off */
+static gboolean g_esp_enable_authentication_check = FALSE;
+#endif
/**************************************************/
/* Sequence number analysis */
@@ -580,17 +589,6 @@ static void show_esp_sequence_info(guint32 spi, guint32 sequence_number,
}
}
-
-/*************************************/
-/* Preference settings */
-
-/* Default ESP payload decode to off */
-static gboolean g_esp_enable_encryption_decode = FALSE;
-
-/* Default ESP payload Authentication Checking to off */
-static gboolean g_esp_enable_authentication_check = FALSE;
-#endif
-
/*
Default ESP payload heuristic decode to off
(only works if payload is NULL encrypted and ESP payload decode is off or payload is NULL encrypted
@@ -1306,9 +1304,9 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Packet Variables related */
gchar *ip_src = NULL;
gchar *ip_dst = NULL;
- guint32 spi = 0;
#endif
+ guint32 spi = 0;
guint encapsulated_protocol = 0;
gboolean decrypt_dissect_ok = FALSE;
tvbuff_t *next_tvb;
@@ -1360,6 +1358,9 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
unsigned char *authenticator_data_computed_md;
unsigned char ctr_block[16];
+
+#endif
+
guint32 sequence_number;
/*
@@ -1367,8 +1368,6 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* the next protocol in the stack
*/
-#endif
-
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ESP");
col_clear(pinfo->cinfo, COL_INFO);
@@ -2312,9 +2311,9 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
-#ifdef HAVE_LIBGCRYPT
static void ipsec_init_protocol(void)
{
+#ifdef HAVE_LIBGCRYPT
/* Free any SA records added by other dissectors */
guint n;
for (n=0; n < extra_esp_sa_records.num_records; n++) {
@@ -2335,13 +2334,13 @@ static void ipsec_init_protocol(void)
if (esp_sequence_analysis_report_hash) {
g_hash_table_destroy(esp_sequence_analysis_report_hash);
}
+#endif
/* Now create them over */
esp_sequence_analysis_hash = g_hash_table_new(word_hash_func, word_equal);
esp_sequence_analysis_report_hash = g_hash_table_new(word_hash_func, word_equal);
}
-#endif
void
proto_register_ipsec(void)
@@ -2532,9 +2531,9 @@ proto_register_ipsec(void)
"ESP SAs",
"Preconfigured ESP Security Associations",
esp_uat);
+#endif
register_init_routine(&ipsec_init_protocol);
-#endif
register_dissector("esp", dissect_esp, proto_esp);
register_dissector("ah", dissect_ah, proto_ah);