diff options
author | Mirko Parthey <mirko.parthey@web.de> | 2017-01-02 13:45:24 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2017-01-02 13:17:08 +0000 |
commit | 6af7425ceebb698c53368fa90e1be52338bdf333 (patch) | |
tree | 260496636d7fdfecd9c0c50dff946b5e40aefdda | |
parent | b358b870b3df572d3d8b0f3d16f1b5188cc549c3 (diff) |
ISAKMP: fix dissection of IKEv2 ID Payload
Fix dissection of the IKEv2 Identification Payload.
Unlike IKEv1, it does not have Protocol and Port fields.
References:
* RFC 2407, section 4.6.2
* RFC 7296, section 3.5
Change-Id: I968e378abd49363785dd7308a4f27908c1c05a8a
Reviewed-on: https://code.wireshark.org/review/19497
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r-- | epan/dissectors/packet-isakmp.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 432cd89b6f..e1a0c66e22 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -4086,26 +4086,32 @@ dissect_id(tvbuff_t *tvb, int offset, int length, proto_tree *tree, int isakmp_v offset += 1; length -= 1; - protocol_id= tvb_get_guint8(tvb, offset); - if (protocol_id == 0) - proto_tree_add_uint_format_value(tree, hf_isakmp_id_protoid, tvb, offset,1, - protocol_id, "Unused"); - else - proto_tree_add_item(tree, hf_isakmp_id_protoid, tvb, offset, 1, ENC_BIG_ENDIAN); + if (isakmp_version == 1) { + protocol_id = tvb_get_guint8(tvb, offset); + if (protocol_id == 0) + proto_tree_add_uint_format_value(tree, hf_isakmp_id_protoid, tvb, offset, 1, + protocol_id, "Unused"); + else + proto_tree_add_item(tree, hf_isakmp_id_protoid, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; - length -= 1; + offset += 1; + length -= 1; - port = tvb_get_ntohs(tvb, offset); - if (port == 0) - proto_tree_add_uint_format_value(tree, hf_isakmp_id_port, tvb, offset, 2, - port, "Unused"); - else - proto_tree_add_item(tree, hf_isakmp_id_port, tvb, offset, 2, ENC_BIG_ENDIAN); + port = tvb_get_ntohs(tvb, offset); + if (port == 0) + proto_tree_add_uint_format_value(tree, hf_isakmp_id_port, tvb, offset, 2, + port, "Unused"); + else + proto_tree_add_item(tree, hf_isakmp_id_port, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; - length -= 2; + offset += 2; + length -= 2; + } else if (isakmp_version == 2) { + /* Reserved */ + offset += 3; + length -= 3; + } /* * It shows strings of all types though some of types are not |