aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ssl-utils.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2015-10-20 18:41:46 +0200
committerMichael Mann <mmann78@netscape.net>2015-10-27 21:47:57 +0000
commit7a9237fb21ac2c771a741f1baaab762354e23c24 (patch)
treedd438b64d0bdeb34cfa673776fe2ece80db7ebb2 /epan/dissectors/packet-ssl-utils.c
parent8869d57c75abaedf1ca566a7c3487557c75fc020 (diff)
[ssl] dissect handshake messages even if we have no tree
this is to make sure that all expert info we see in the main window will also appear in the expert info window the sample capture from bug 11561 shows this problem: without this patch, the expert info with severity 'error' don't show up in the expert info window Change-Id: Ia71ae7e248f57bf1344cf722ac57e74c517828d5 Reviewed-on: https://code.wireshark.org/review/11246 Petri-Dish: Michael Mann <mmann78@netscape.net> 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/packet-ssl-utils.c')
-rw-r--r--epan/dissectors/packet-ssl-utils.c92
1 files changed, 45 insertions, 47 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index 14fd94b2ec..487b31f304 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -5312,61 +5312,59 @@ ssl_dissect_hnd_hello_common(ssl_common_dissect_t *hf, tvbuff_t *tvb,
guint8 sessid_length;
proto_tree *rnd_tree;
- if (tree || ssl) {
- if (ssl) {
- StringInfo *rnd;
- if (from_server)
- rnd = &ssl->server_random;
- else
- rnd = &ssl->client_random;
+ if (ssl) {
+ StringInfo *rnd;
+ if (from_server)
+ rnd = &ssl->server_random;
+ else
+ rnd = &ssl->client_random;
- /* save provided random for later keyring generation */
- tvb_memcpy(tvb, rnd->data, offset, 32);
- rnd->data_len = 32;
- if (from_server)
- ssl->state |= SSL_SERVER_RANDOM;
- else
- ssl->state |= SSL_CLIENT_RANDOM;
- ssl_debug_printf("%s found %s RANDOM -> state 0x%02X\n", G_STRFUNC,
- from_server ? "SERVER" : "CLIENT", ssl->state);
- }
+ /* save provided random for later keyring generation */
+ tvb_memcpy(tvb, rnd->data, offset, 32);
+ rnd->data_len = 32;
+ if (from_server)
+ ssl->state |= SSL_SERVER_RANDOM;
+ else
+ ssl->state |= SSL_CLIENT_RANDOM;
+ ssl_debug_printf("%s found %s RANDOM -> state 0x%02X\n", G_STRFUNC,
+ from_server ? "SERVER" : "CLIENT", ssl->state);
+ }
- rnd_tree = proto_tree_add_subtree(tree, tvb, offset, 32,
- hf->ett.hs_random, NULL, "Random");
+ rnd_tree = proto_tree_add_subtree(tree, tvb, offset, 32,
+ hf->ett.hs_random, NULL, "Random");
- /* show the time */
- gmt_unix_time.secs = tvb_get_ntohl(tvb, offset);
- gmt_unix_time.nsecs = 0;
- proto_tree_add_time(rnd_tree, hf->hf.hs_random_time,
- tvb, offset, 4, &gmt_unix_time);
- offset += 4;
+ /* show the time */
+ gmt_unix_time.secs = tvb_get_ntohl(tvb, offset);
+ gmt_unix_time.nsecs = 0;
+ proto_tree_add_time(rnd_tree, hf->hf.hs_random_time,
+ tvb, offset, 4, &gmt_unix_time);
+ offset += 4;
- /* show the random bytes */
- proto_tree_add_item(rnd_tree, hf->hf.hs_random_bytes,
- tvb, offset, 28, ENC_NA);
- offset += 28;
+ /* show the random bytes */
+ proto_tree_add_item(rnd_tree, hf->hf.hs_random_bytes,
+ tvb, offset, 28, ENC_NA);
+ offset += 28;
- /* show the session id (length followed by actual Session ID) */
- sessid_length = tvb_get_guint8(tvb, offset);
- proto_tree_add_item(tree, hf->hf.hs_session_id_len,
- tvb, offset, 1, ENC_BIG_ENDIAN);
- offset++;
+ /* show the session id (length followed by actual Session ID) */
+ sessid_length = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(tree, hf->hf.hs_session_id_len,
+ tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset++;
- if (ssl) {
- /* save the authorative SID for later use in ChangeCipherSpec.
- * (D)TLS restricts the SID to 32 chars, it does not make sense to
- * save more, so ignore larger ones. */
- if (from_server && sessid_length <= 32) {
- tvb_memcpy(tvb, ssl->session_id.data, offset, sessid_length);
- ssl->session_id.data_len = sessid_length;
- }
- }
- if (sessid_length > 0) {
- proto_tree_add_item(tree, hf->hf.hs_session_id,
- tvb, offset, sessid_length, ENC_NA);
- offset += sessid_length;
+ if (ssl) {
+ /* save the authorative SID for later use in ChangeCipherSpec.
+ * (D)TLS restricts the SID to 32 chars, it does not make sense to
+ * save more, so ignore larger ones. */
+ if (from_server && sessid_length <= 32) {
+ tvb_memcpy(tvb, ssl->session_id.data, offset, sessid_length);
+ ssl->session_id.data_len = sessid_length;
}
}
+ if (sessid_length > 0) {
+ proto_tree_add_item(tree, hf->hf.hs_session_id,
+ tvb, offset, sessid_length, ENC_NA);
+ offset += sessid_length;
+ }
return offset;
}