HIP dissector: PUZZLE and SOLUTION parameters variable size

According to specifications, puzzle and solution parameters carry Random #I and
#J fields that has variable length depending of the Hash function. The fields
are recognized with a fixed value of 8 bytes.

The #I and #J fields should be determined depending of the TLV size.

See http://tools.ietf.org/html/draft-ietf-hip-rfc5201-bis-08#section-5.2.5 .

svn path=/trunk/; revision=42140
This commit is contained in:
Alexis La Goutte 2012-04-19 12:41:12 +00:00
parent 61a6d25bc2
commit 990d1ad71e
1 changed files with 4 additions and 4 deletions

View File

@ -748,7 +748,7 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
proto_tree_add_item(t, hf_hip_tlv_puzzle_o, tvb, newoffset, 2, ENC_BIG_ENDIAN);
/* Puzzle I */
newoffset += 2;
proto_tree_add_item(t, hf_hip_tlv_puzzle_i, tvb,newoffset, 8, ENC_NA);
proto_tree_add_item(t, hf_hip_tlv_puzzle_i, tvb,newoffset, tlv_len - 4, ENC_NA);
break;
case PARAM_SOLUTION:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);
@ -762,10 +762,10 @@ dissect_hip_tlv(tvbuff_t *tvb, int offset, proto_item *ti, int type, int tlv_len
proto_tree_add_item(t, hf_hip_tlv_solution_o, tvb,newoffset, 2, ENC_BIG_ENDIAN);
/* Solution I */
newoffset += 2;
proto_tree_add_item(t, hf_hip_tlv_solution_i, tvb, newoffset, 8, ENC_NA);
proto_tree_add_item(t, hf_hip_tlv_solution_i, tvb, newoffset, (tlv_len - 4)/2, ENC_NA);
/* Solution J */
newoffset += 8;
proto_tree_add_item(t, hf_hip_tlv_solution_j, tvb, newoffset, 8, ENC_NA);
newoffset += (tlv_len - 4) /2;
proto_tree_add_item(t, hf_hip_tlv_solution_j, tvb, newoffset, (tlv_len -4)/2, ENC_NA);
break;
case PARAM_SEQ:
t = proto_item_add_subtree(ti, ett_hip_tlv_data);