diff options
author | John Thacker <johnthacker@gmail.com> | 2022-01-18 21:10:26 -0500 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-01-19 04:18:13 +0000 |
commit | 8202125fe360fccb679ba5baeb5f295a8339cc0a (patch) | |
tree | 5915a18f22582d62bee8e38a87830926b1154113 /epan/dissectors/packet-rtcp.c | |
parent | 91463dde4df1a57e2447c1d75016cd3ef9d21712 (diff) |
SRTCP: Warn about undecoded, not length error
If we are decoding as SRTCP with encrypted payload but srtcp_info
wasn't set up (e.g. because this was done by Decode As or a heuristic),
then since we can't calculate the length, add the expert info about
an undecoded payload rather than the expert info about an incorrect
length.
Related to #17892
Diffstat (limited to 'epan/dissectors/packet-rtcp.c')
-rw-r--r-- | epan/dissectors/packet-rtcp.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index 6f4ef5f47a..39e65c6cc8 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -4600,21 +4600,26 @@ dissect_rtcp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* } /* If the payload was encrypted, the main payload was not dissected. - * If we don't have srtcp_info we cant calculate the length */ - if ((srtcp_encrypted == TRUE) && (srtcp_info)) { - proto_tree_add_expert(rtcp_tree, pinfo, &ei_srtcp_encrypted_payload, tvb, offset, srtcp_offset - offset); - proto_tree_add_item(rtcp_tree, hf_srtcp_e, tvb, srtcp_offset, 4, ENC_BIG_ENDIAN); - proto_tree_add_uint(rtcp_tree, hf_srtcp_index, tvb, srtcp_offset, 4, srtcp_index); - srtcp_offset += 4; - if (srtcp_info->mki_len) { - proto_tree_add_item(rtcp_tree, hf_srtcp_mki, tvb, srtcp_offset, srtcp_info->mki_len, ENC_NA); - srtcp_offset += srtcp_info->mki_len; - } + if (srtcp_encrypted == TRUE) { + /* If we don't have srtcp_info we cant calculate the length + */ + if (srtcp_info) { + proto_tree_add_expert(rtcp_tree, pinfo, &ei_srtcp_encrypted_payload, tvb, offset, srtcp_offset - offset); + proto_tree_add_item(rtcp_tree, hf_srtcp_e, tvb, srtcp_offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_uint(rtcp_tree, hf_srtcp_index, tvb, srtcp_offset, 4, srtcp_index); + srtcp_offset += 4; + if (srtcp_info->mki_len) { + proto_tree_add_item(rtcp_tree, hf_srtcp_mki, tvb, srtcp_offset, srtcp_info->mki_len, ENC_NA); + srtcp_offset += srtcp_info->mki_len; + } - if (srtcp_info->auth_tag_len) { - proto_tree_add_item(rtcp_tree, hf_srtcp_auth_tag, tvb, srtcp_offset, srtcp_info->auth_tag_len, ENC_NA); - /*srtcp_offset += srtcp_info->auth_tag_len;*/ + if (srtcp_info->auth_tag_len) { + proto_tree_add_item(rtcp_tree, hf_srtcp_auth_tag, tvb, srtcp_offset, srtcp_info->auth_tag_len, ENC_NA); + /*srtcp_offset += srtcp_info->auth_tag_len;*/ + } + } else { + proto_tree_add_expert(rtcp_tree, pinfo, &ei_srtcp_encrypted_payload, tvb, offset, -1); } } /* offset should be total_packet_length by now... */ |