summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-09-04 13:40:20 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-09-04 13:18:54 +0000
commit7c7497a77e30f8098bcaffd0a9c96be24855c0e8 (patch)
tree5d23a6960a4bd4416535074eb268a0623219e633
parent29a243d61cb1ae9d6eda404dad2038b85cfdb487 (diff)
downloadwireshark-7c7497a77e30f8098bcaffd0a9c96be24855c0e8.tar.gz
ssl,http: rename http-over-ssl to http-over-tls
This name is displayed in the SSL prototcol tree (Application Data Protocol: http-over-tls), rename to avoid possible user confusion. Modify the SSL dissector such that both "http" and "http-over-tls" invoke the same dissector function. Change-Id: I2d52890a8ec8fa88b6390b133a11df607a5ec3dc Reviewed-on: https://code.wireshark.org/review/17481 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--epan/dissectors/packet-http.c2
-rw-r--r--epan/dissectors/packet-ssl-utils.c13
-rw-r--r--epan/dissectors/packet-ssl-utils.h3
-rw-r--r--epan/dissectors/packet-ssl.c2
-rw-r--r--test/config/ssl_keys.tmpl4
-rwxr-xr-xtest/suite-decryption.sh2
6 files changed, 19 insertions, 7 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 4c6ea09b2e..07ec79ee1f 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -3584,7 +3584,7 @@ proto_register_http(void)
http_handle = register_dissector("http", dissect_http, proto_http);
http_tcp_handle = register_dissector("http-over-tcp", dissect_http_tcp, proto_http);
- http_ssl_handle = register_dissector("http-over-ssl", dissect_http_ssl, proto_http);
+ http_ssl_handle = register_dissector("http-over-tls", dissect_http_ssl, proto_http); /* RFC 2818 */
http_sctp_handle = register_dissector("http-over-sctp", dissect_http_sctp, proto_http);
http_module = prefs_register_protocol(proto_http, reinit_http);
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index b57065593e..e48024a552 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -4162,6 +4162,15 @@ ssl_starttls_post_ack(dissector_handle_t ssl_handle, packet_info *pinfo,
return ssl_starttls(ssl_handle, pinfo, app_handle, pinfo->num - 1);
}
+dissector_handle_t
+ssl_find_appdata_dissector(const char *name)
+{
+ /* Accept 'http' for backwards compatibility and sanity. */
+ if (!strcmp(name, "http"))
+ name = "http-over-tls";
+ return find_dissector(name);
+}
+
/* Functions for TLS/DTLS sessions and RSA private keys hashtables. {{{ */
static gint
ssl_equal (gconstpointer v, gconstpointer v2)
@@ -4488,7 +4497,7 @@ ssl_parse_key_list(const ssldecrypt_assoc_t *uats, GHashTable *key_hash, const c
ssl_debug_printf("ssl_init port '%d' filename '%s' password(only for p12 file) '%s'\n",
port, uats->keyfile, uats->password);
- handle = find_dissector(uats->protocol);
+ handle = ssl_find_appdata_dissector(uats->protocol);
ssl_association_add(dissector_table_name, main_handle, handle, port, tcp);
}
@@ -5214,7 +5223,7 @@ ssl_dissect_hnd_hello_ext_alpn(ssl_common_dissect_t *hf, tvbuff_t *tvb,
/* ProtocolName match, so set the App data dissector handle.
* This may override protocols given via the UAT dialog, but
* since the ALPN hint is precise, do it anyway. */
- handle = find_dissector(alpn_proto->dissector_name);
+ handle = ssl_find_appdata_dissector(alpn_proto->dissector_name);
ssl_debug_printf("%s: changing handle %p to %p (%s)", G_STRFUNC,
(void *)session->app_handle,
(void *)handle, alpn_proto->dissector_name);
diff --git a/epan/dissectors/packet-ssl-utils.h b/epan/dissectors/packet-ssl-utils.h
index 6891ec3db5..7dcc83203a 100644
--- a/epan/dissectors/packet-ssl-utils.h
+++ b/epan/dissectors/packet-ssl-utils.h
@@ -471,6 +471,9 @@ WS_DLL_PUBLIC guint32
ssl_starttls_post_ack(dissector_handle_t ssl_handle, packet_info *pinfo,
dissector_handle_t app_handle);
+extern dissector_handle_t
+ssl_find_appdata_dissector(const char *name);
+
/** set the data and len for the stringInfo buffer. buf should be big enough to
* contain the provided data
@param buf the buffer to update
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 573346b132..67d4466d26 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -3653,7 +3653,7 @@ ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, co
return FALSE;
}
- if (!find_dissector(p)) {
+ if (!ssl_find_appdata_dissector(p)) {
if (proto_get_id_by_filter_name(p) != -1) {
*err = g_strdup_printf("While '%s' is a valid dissector filter name, that dissector is not configured"
" to support SSL decryption.\n\n"
diff --git a/test/config/ssl_keys.tmpl b/test/config/ssl_keys.tmpl
index bf2540f1fc..8daa5cb734 100644
--- a/test/config/ssl_keys.tmpl
+++ b/test/config/ssl_keys.tmpl
@@ -1,2 +1,2 @@
-"127.0.0.1","443","http-over-ssl","TEST_KEYS_DIRrsasnakeoil2.key",""
-"127.0.0.1","9131","http-over-ssl","TEST_KEYS_DIRkey.p12","WebAS"
+"127.0.0.1","443","http","TEST_KEYS_DIRrsasnakeoil2.key",""
+"127.0.0.1","9131","http","TEST_KEYS_DIRkey.p12","WebAS"
diff --git a/test/suite-decryption.sh b/test/suite-decryption.sh
index 975fdab8d3..0d5ba25043 100755
--- a/test/suite-decryption.sh
+++ b/test/suite-decryption.sh
@@ -201,7 +201,7 @@ decryption_step_ssl_rsa_pq() {
TEST_KEYS_FILE="`cygpath -w $TEST_KEYS_FILE`"
fi
$TESTS_DIR/run_and_catch_crashes env $TS_DC_ENV $TSHARK $TS_DC_ARGS -Tfields -e http.request.uri \
- -o ssl.keys_list:"0.0.0.0,443,http-over-ssl,$TEST_KEYS_FILE" \
+ -o ssl.keys_list:"0.0.0.0,443,http,$TEST_KEYS_FILE" \
-r "$CAPTURE_DIR/rsa-p-lt-q.pcap" -Y http \
| grep / > /dev/null 2>&1
RETURNVALUE=$?