aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorSake Blok <sake@euronet.nl>2011-05-28 18:17:50 +0000
committerSake Blok <sake@euronet.nl>2011-05-28 18:17:50 +0000
commitba086053c7f7e3a16c673a999e53dab5eba3ba84 (patch)
tree1620ced2b5c29674d77745ccf673de0d85e28acf /epan
parent31c756a6d1b577e17f84503bbe5abe800097708c (diff)
Add "File -> Export -> SSL Session Keys..." to be able to save the keyring info for each session in the trace file. This makes it possible to give someone the trace and the exported keys so that they can decrypt the traffic in the trace, but not new sessions to the same server.
(See also: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3444) svn path=/trunk/; revision=37446
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-ssl-utils.c2
-rw-r--r--epan/dissectors/packet-ssl.c4
-rw-r--r--epan/dissectors/packet-ssl.h2
-rw-r--r--epan/libwireshark.def1
4 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index 8c4821cbbb..60e90beded 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -3349,7 +3349,7 @@ ssl_keylog_lookup(SslDecryptSession* ssl_session,
offset = 4;
- if ( memcmp(line+4,"Session-ID:",11) == 0 ) {
+ if ( ssl_session->session_id.data_len>0 && memcmp(line+offset,"Session-ID:",11) == 0 ) {
offset += 11;
for (i = 0; i < ssl_session->session_id.data_len; i++) {
if (from_hex_char(line[offset + i*2]) != (ssl_session->session_id.data[i] >> 4) ||
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 9e4f1ee905..2c1e9d8dec 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -289,7 +289,9 @@ static const fragment_items ssl_segment_items = {
"Segments"
};
-static GHashTable *ssl_session_hash = NULL;
+/* ssl_session_hash is used by "Export SSL Session Keys" */
+GHashTable *ssl_session_hash = NULL;
+
static GHashTable *ssl_key_hash = NULL;
static GTree* ssl_associations = NULL;
static dissector_handle_t ssl_handle = NULL;
diff --git a/epan/dissectors/packet-ssl.h b/epan/dissectors/packet-ssl.h
index db08f1e489..55795b44f9 100644
--- a/epan/dissectors/packet-ssl.h
+++ b/epan/dissectors/packet-ssl.h
@@ -25,6 +25,8 @@
#ifndef __PACKET_SSL_H__
#define __PACKET_SSL_H__
+WS_VAR_IMPORT GHashTable *ssl_session_hash;
+
extern void ssl_dissector_add(guint port, const gchar *protocol, gboolean tcp);
extern void ssl_dissector_delete(guint port, const gchar *protocol, gboolean tcp);
diff --git a/epan/libwireshark.def b/epan/libwireshark.def
index dde4458c37..4305f55ece 100644
--- a/epan/libwireshark.def
+++ b/epan/libwireshark.def
@@ -974,6 +974,7 @@ srtp_add_address
ssl_dissector_add
ssl_dissector_delete
ssl_set_master_secret
+ssl_session_hash DATA
start_requested_stats
stats_tree_branch_max_namelen
stats_tree_branch_to_str