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>
This commit is contained in:
Pascal Quantin 2014-09-12 15:56:29 +02:00 committed by Evan Huus
parent 5ade437ffe
commit 0a0654a7aa
1 changed files with 16 additions and 17 deletions

View File

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