EAP: Unknown Data at end of EAP Identities

Added unknown data field at end of EAP Identity
dissection to ensure clean offsets to CRC/Checksum.

Bug: 16529
Change-Id: I09bc945bb89a91231bb82ced011ca3d1075a7788
Reviewed-on: https://code.wireshark.org/review/37094
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Matthew Weant 2020-05-04 05:49:29 -07:00 committed by Anders Broman
parent 6ada4302b5
commit dba3081f4d
1 changed files with 11 additions and 0 deletions

View File

@ -44,6 +44,7 @@ static int hf_eap_identity_wlan_prefix = -1;
static int hf_eap_identity_wlan_mcc = -1;
static int hf_eap_identity_wlan_mcc_mnc_2digits = -1;
static int hf_eap_identity_wlan_mcc_mnc_3digits = -1;
static int hf_eap_identity_unknown_data = -1;
static int hf_eap_notification = -1;
@ -638,6 +639,11 @@ dissect_eap_identity_wlan(tvbuff_t *tvb, packet_info* pinfo, proto_tree* tree, i
(guint)(strlen(tokens[3]) - strlen("mcc")), mcc);
end:
g_strfreev(tokens);
/* Some devices add 0x00 bytes assumed to be padding which may lead to offset errors. */
if(tvb_captured_length_remaining(tvb, offset + size) != 0){
proto_tree_add_item(tree, hf_eap_identity_unknown_data, tvb, offset + size,
tvb_captured_length_remaining(tvb, offset + size), ENC_NA);
}
return ret;
}
@ -1425,6 +1431,11 @@ proto_register_eap(void)
"WLAN Identity Mobile Network Code", "eap.identity.wlan.mnc",
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &mcc_mnc_3digits_codes_ext, 0x0, NULL, HFILL }},
{ &hf_eap_identity_unknown_data, {
"Unknown Data", "eap.identity.data_unk",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
{ &hf_eap_identity_actual_len, {
"Identity Actual Length", "eap.identity.actual_len",
FT_UINT16, BASE_DEC, NULL, 0x0,