SOCKS: Display right version in pseudo header

Use the previous recorded version as version and set field as generated.

Bug: 14262
Change-Id: I0872ed826ccd8a5a1b75b071d810404d08ddc7b3
Reviewed-on: https://code.wireshark.org/review/24741
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Uli Heilmeier 2017-12-08 18:21:04 +01:00 committed by Michael Mann
parent 8cb9a094bf
commit 22a7d8fa8d
1 changed files with 17 additions and 14 deletions

View File

@ -1088,23 +1088,12 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
ti = proto_tree_add_item( tree, proto_socks, tvb, offset, -1, ENC_NA );
socks_tree = proto_item_add_subtree(ti, ett_socks);
if (hash_info->server_port == pinfo->destport) {
if ( hash_info->version == 4) {
display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
} else if ( hash_info->version == 5) {
client_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
}
} else {
if ( hash_info->version == 4) {
display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
} else if ( hash_info->version == 5) {
server_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
}
}
/* if past startup, add the faked stuff */
if ( pinfo->num > hash_info->start_done_frame){
/* add info to tree */
ti = proto_tree_add_uint( socks_tree, hf_socks_ver, tvb, offset, 0, hash_info->version);
PROTO_ITEM_SET_GENERATED(ti);
ti = proto_tree_add_uint( socks_tree, hf_socks_cmd, tvb, offset, 0, hash_info->command);
PROTO_ITEM_SET_GENERATED(ti);
@ -1125,6 +1114,20 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
ti = proto_tree_add_uint( socks_tree, hf_socks_dstport, tvb, offset, 0, hash_info->port);
PROTO_ITEM_SET_GENERATED(ti);
}
} else {
if (hash_info->server_port == pinfo->destport) {
if ( hash_info->version == 4) {
display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
} else if ( hash_info->version == 5) {
client_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
}
} else {
if ( hash_info->version == 4) {
display_socks_v4(tvb, offset, pinfo, socks_tree, hash_info, state_info);
} else if ( hash_info->version == 5) {
server_display_socks_v5(tvb, offset, pinfo, socks_tree, hash_info, state_info);
}
}
}
}