EAP: Fix GPSK CSuite Sel dissection

The function to dissect CSuite Sel returns offset not number of
dissected bytes so calling function must assign new offset rather
than incrementing. For consistency also update the CSuite List
function to return offset.
This commit is contained in:
Mikael Kanstrup 2020-10-19 10:40:22 +02:00 committed by Wireshark GitLab Utility
parent 72fbe69d9b
commit 279bde1a0e
1 changed files with 5 additions and 5 deletions

View File

@ -1293,7 +1293,7 @@ dissect_eap_gpsk_csuite_list(proto_tree *eap_tree, tvbuff_t *tvb, int offset)
proto_tree_add_item(csuite_tree, hf_eap_gpsk_csuite_specifier, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
return len;
return offset;
}
static gint
@ -1413,7 +1413,7 @@ dissect_eap_gpsk(proto_tree *eap_tree, tvbuff_t *tvb, packet_info *pinfo, int of
offset += len;
proto_tree_add_item(eap_tree, hf_eap_gpsk_rand_server, tvb, offset, 32, ENC_NA);
offset += 32;
offset += dissect_eap_gpsk_csuite_list(eap_tree, tvb, offset);
offset = dissect_eap_gpsk_csuite_list(eap_tree, tvb, offset);
break;
case GPSK_GPSK_2:
proto_tree_add_item_ret_uint(eap_tree, hf_eap_gpsk_id_peer_len, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
@ -1428,8 +1428,8 @@ dissect_eap_gpsk(proto_tree *eap_tree, tvbuff_t *tvb, packet_info *pinfo, int of
offset += 32;
proto_tree_add_item(eap_tree, hf_eap_gpsk_rand_server, tvb, offset, 32, ENC_NA);
offset += 32;
offset += dissect_eap_gpsk_csuite_list(eap_tree, tvb, offset);
offset += dissect_eap_gpsk_csuite_sel(eap_tree, tvb, offset);
offset = dissect_eap_gpsk_csuite_list(eap_tree, tvb, offset);
offset = dissect_eap_gpsk_csuite_sel(eap_tree, tvb, offset);
proto_tree_add_item_ret_uint(eap_tree, hf_eap_gpsk_pd_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
offset += 2;
if (len > 0) {
@ -1449,7 +1449,7 @@ dissect_eap_gpsk(proto_tree *eap_tree, tvbuff_t *tvb, packet_info *pinfo, int of
offset += 2;
proto_tree_add_item(eap_tree, hf_eap_gpsk_id_server, tvb, offset, len, ENC_ASCII | ENC_NA);
offset += len;
offset += dissect_eap_gpsk_csuite_sel(eap_tree, tvb, offset);
offset = dissect_eap_gpsk_csuite_sel(eap_tree, tvb, offset);
proto_tree_add_item_ret_uint(eap_tree, hf_eap_gpsk_pd_payload_len, tvb, offset, 2, ENC_BIG_ENDIAN, &len);
offset += 2;
if (len > 0) {