aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-11-02 08:48:13 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-11-02 08:48:13 +0000
commitecbf47ff3a402807f3ae1d361ce53a06bab19fe4 (patch)
treecb92b160b9360fa382e8fa9fc6444da747fa69e8
parentd3c2aa3199c22502afd1649d275809391c6fe892 (diff)
From Dirk:
This patch will print the information if an invalid string was entered. It would be better to have a button to click on in the UAT dialog to show valid values, but I don't know how I could do that with the UAT system. So I'm simply printing it now in the error dialog, which should be good enough. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7949 svn path=/trunk/; revision=45866
-rw-r--r--epan/dissectors/packet-ssl-utils.c2
-rw-r--r--epan/dissectors/packet-ssl.c35
-rw-r--r--epan/dissectors/packet-ssl.h2
3 files changed, 38 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index 5fbee8020d..41b062cf89 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -3978,7 +3978,7 @@ ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, unsigned len _U_,
}
if (!find_dissector(p)) {
- *err = ep_strdup_printf("Could not find dissector for: '%s'", p);
+ *err = ep_strdup_printf("Could not find dissector for: '%s'\nValid dissectors are:\n%s", p, ssl_association_info());
return FALSE;
}
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index b531fb19b3..ba05865fc7 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -437,6 +437,41 @@ ssl_parse_old_keys(void)
/*********************************************************************
*
+ * SSL Associations tree
+ *
+ *********************************************************************/
+
+/** maximum size of ssl_association_info() string */
+#define SSL_ASSOC_MAX_LEN 8192
+
+/**
+ * callback function used by ssl_association_info() to traverse the SSL associations.
+ */
+static gboolean
+ssl_association_info_(gpointer key_ _U_, gpointer value_, gpointer s_)
+{
+ SslAssociation *value = value_;
+ gchar *s = s_;
+ const int l = strlen(s);
+ g_snprintf(s+l, SSL_ASSOC_MAX_LEN-l, "'%s' %s %i\n", value->info, value->tcp ? "TCP":"UDP", value->ssl_port);
+ return FALSE;
+}
+
+extern GTree* ssl_associations;
+
+/**
+ * @return an information string on the SSL protocol associations. The string has ephemeral lifetime/scope.
+ */
+gchar*
+ssl_association_info(void)
+{
+ gchar *s = ep_alloc0(SSL_ASSOC_MAX_LEN);
+ g_tree_foreach(ssl_associations, ssl_association_info_, s);
+ return s;
+}
+
+/*********************************************************************
+ *
* Forward Declarations
*
*********************************************************************/
diff --git a/epan/dissectors/packet-ssl.h b/epan/dissectors/packet-ssl.h
index a76e682c61..14b34ac6ff 100644
--- a/epan/dissectors/packet-ssl.h
+++ b/epan/dissectors/packet-ssl.h
@@ -38,4 +38,6 @@ extern void ssl_set_master_secret(guint32 frame_num, address *addr_srv, address
extern gboolean ssl_ignore_mac_failed;
+gchar* ssl_association_info(void);
+
#endif /* __PACKET_SSL_H__ */