diff options
author | Evan Huus <eapache@gmail.com> | 2013-08-15 02:17:51 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-08-15 02:17:51 +0000 |
commit | bef63735ff51a92eb0a2a2e062222d5aeac06b28 (patch) | |
tree | b643b9ad914e69d1e0057630ed72ebbc7b6398ca /epan/dissectors/packet-rfid-pn532.c | |
parent | 80ea68ad78cb5a09276567e78d7808f81a98d96b (diff) |
From Tyson Key via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9037
Update the heuristics for detecting ISO 14443-A payloads with 4 byte UIDs, and
ATS values to support MTCOS-based cards/tokens (e.g. passports) in PN532
InListPassiveTarget responses.
svn path=/trunk/; revision=51361
Diffstat (limited to 'epan/dissectors/packet-rfid-pn532.c')
-rw-r--r-- | epan/dissectors/packet-rfid-pn532.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c index 59efb3ca08..1e3f2cb59b 100644 --- a/epan/dissectors/packet-rfid-pn532.c +++ b/epan/dissectors/packet-rfid-pn532.c @@ -490,28 +490,31 @@ dissect_pn532(tvbuff_t * tvb, packet_info * pinfo, proto_tree *tree) } /* Probably an EMV/ISO 14443-A (VISA - 30 bytes payload/MC - 33 bytes payload) - card with a 4 byte UID */ + card with a 4 byte UID - if (tvb_reported_length(tvb) == 30 || tvb_reported_length(tvb) == 33) { + MTCOS-based contactless passports also have a 4 byte (randomised) UID (28 bytes payload) + */ - /* Check to see if there's a plausible ATQA value (0x0004 for my MC/VISA cards) */ + if (tvb_reported_length(tvb) == 28 || tvb_reported_length(tvb) == 30 || tvb_reported_length(tvb) == 33) { + + /* Check to see if there's a plausible ATQA value (0x0004 for my MC/VISA cards, and 0x0008 for MTCOS) */ + + if (tvb_get_ntohs(tvb, 4) == 0x0004 || tvb_get_ntohs(tvb, 4) == 0x08) { - if ((tvb_get_guint8(tvb, 4) == 0x00 && tvb_get_guint8(tvb, 5) == 0x04)) { - /* Add the ATQA/SENS_RES */ proto_tree_add_item(pn532_tree, hf_pn532_14443a_atqa, tvb, 4, 2, ENC_BIG_ENDIAN); - + /* Add the SAK/SEL_RES value */ proto_tree_add_item(pn532_tree, hf_pn532_14443a_sak, tvb, 6, 1, ENC_BIG_ENDIAN); - + /* Add the UID length */ proto_tree_add_item(pn532_tree, hf_pn532_14443a_uid_length, tvb, 7, 1, ENC_BIG_ENDIAN); - + /* Add the UID */ proto_tree_add_item(pn532_tree, hf_pn532_14443a_uid, tvb, 8, 4, ENC_BIG_ENDIAN); - + /* ATS length is probably prepended to the ATS data... */ - + /* Pass the ATS value to the Data dissector, since it's too long to handle normally Don't care about the "status word" at the end, right now */ next_tvb = tvb_new_subset_remaining(tvb, 13); |