aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-07-16 13:25:35 +0200
committerMichael Mann <mmann78@netscape.net>2017-07-16 12:47:46 +0000
commit96ac279d986898e655fc18a3950caa6f5f214fe7 (patch)
tree5b270925ab46c74db37f8fbc559526d58187c2ee /epan/dissectors
parentfeb510df69f56eb1c5662375518bd5138d6cd1c8 (diff)
ssl,dtls: make some fields in RSA keys dialog optional
The IP address has been unused since 2.0. The port/protocol fields have become unnecessary since 2.4 with the introduction of Decode As. Do not require the user to specify these fields if they just want to set the RSA key file. In a future version, these three fields will be completely removed. Change-Id: Iefc5a8778aa1122b76b707018c00b6ec429dc107 Reviewed-on: https://code.wireshark.org/review/22640 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-dtls.c11
-rw-r--r--epan/dissectors/packet-ssl-utils.c13
-rw-r--r--epan/dissectors/packet-ssl.c11
3 files changed, 17 insertions, 18 deletions
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 9012a1d05b..75dfbd2ddc 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -1637,8 +1637,9 @@ static gboolean
dtlsdecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, char** err)
{
if (!p || strlen(p) == 0u) {
- *err = g_strdup("No protocol given.");
- return FALSE;
+ // This should be removed in favor of Decode As. Make it optional.
+ *err = NULL;
+ return TRUE;
}
if (!find_dissector(p)) {
@@ -1962,9 +1963,9 @@ proto_register_dtls(void)
#ifdef HAVE_LIBGNUTLS
static uat_field_t dtlskeylist_uats_flds[] = {
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, ipaddr, "IP address", ssldecrypt_uat_fld_ip_chk_cb, "IPv4 or IPv6 address"),
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, port, "Port", ssldecrypt_uat_fld_port_chk_cb, "Port Number"),
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, protocol, "Protocol", dtlsdecrypt_uat_fld_protocol_chk_cb, "Protocol"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, ipaddr, "IP address", ssldecrypt_uat_fld_ip_chk_cb, "IPv4 or IPv6 address (unused)"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, port, "Port", ssldecrypt_uat_fld_port_chk_cb, "Port Number (optional)"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, protocol, "Protocol", dtlsdecrypt_uat_fld_protocol_chk_cb, "Application Layer Protocol (optional)"),
UAT_FLD_FILENAME_OTHER(sslkeylist_uats, keyfile, "Key File", ssldecrypt_uat_fld_fileopen_chk_cb, "Path to the keyfile."),
UAT_FLD_CSTRING_OTHER(sslkeylist_uats, password," Password (p12 file)", ssldecrypt_uat_fld_password_chk_cb, "Password"),
UAT_END_FIELDS
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index 40d425aaa9..1abf74e2b4 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -5293,13 +5293,9 @@ ssl_print_string(const gchar* name, const StringInfo* data)
/* checks for SSL and DTLS UAT key list fields */
gboolean
-ssldecrypt_uat_fld_ip_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, char** err)
+ssldecrypt_uat_fld_ip_chk_cb(void* r _U_, const char* p _U_, guint len _U_, const void* u1 _U_, const void* u2 _U_, char** err)
{
- if (!p || strlen(p) == 0u) {
- *err = g_strdup("No IP address given.");
- return FALSE;
- }
-
+ // This should be removed in favor of Decode As. Make it optional.
*err = NULL;
return TRUE;
}
@@ -5308,8 +5304,9 @@ gboolean
ssldecrypt_uat_fld_port_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, char** err)
{
if (!p || strlen(p) == 0u) {
- *err = g_strdup("No Port given.");
- return FALSE;
+ // This should be removed in favor of Decode As. Make it optional.
+ *err = NULL;
+ return TRUE;
}
if (strcmp(p, "start_tls") != 0){
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 869355b076..848fff1ef3 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -3815,8 +3815,9 @@ static gboolean
ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, const void* u1 _U_, const void* u2 _U_, char** err)
{
if (!p || strlen(p) == 0u) {
- *err = g_strdup("No protocol given.");
- return FALSE;
+ // This should be removed in favor of Decode As. Make it optional.
+ *err = NULL;
+ return TRUE;
}
if (!ssl_find_appdata_dissector(p)) {
@@ -4368,9 +4369,9 @@ proto_register_ssl(void)
#ifdef HAVE_LIBGNUTLS
static uat_field_t sslkeylist_uats_flds[] = {
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, ipaddr, "IP address", ssldecrypt_uat_fld_ip_chk_cb, "IPv4 or IPv6 address"),
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, port, "Port", ssldecrypt_uat_fld_port_chk_cb, "Port Number"),
- UAT_FLD_CSTRING_OTHER(sslkeylist_uats, protocol, "Protocol", ssldecrypt_uat_fld_protocol_chk_cb, "Protocol"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, ipaddr, "IP address", ssldecrypt_uat_fld_ip_chk_cb, "IPv4 or IPv6 address (unused)"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, port, "Port", ssldecrypt_uat_fld_port_chk_cb, "Port Number (optional)"),
+ UAT_FLD_CSTRING_OTHER(sslkeylist_uats, protocol, "Protocol", ssldecrypt_uat_fld_protocol_chk_cb, "Application Layer Protocol (optional)"),
UAT_FLD_FILENAME_OTHER(sslkeylist_uats, keyfile, "Key File", ssldecrypt_uat_fld_fileopen_chk_cb, "Private keyfile."),
UAT_FLD_CSTRING_OTHER(sslkeylist_uats, password,"Password", ssldecrypt_uat_fld_password_chk_cb, "Password (for PCKS#12 keyfile)"),
UAT_END_FIELDS