aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iso14443.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-14iso14443: fix the request-response trackingMartin Kaiser1-13/+31
Distinguish between Waiting Time Extension (WTX) messages and other messages. Use a composite key for the wmem tree that consists of a boolean wtx flag and the request packet number. Change-Id: I7783aabb231fe145a8d8c0d65c88b553d5a5b533 Reviewed-on: https://code.wireshark.org/review/23063 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-29iso14443: dissect the type B bit rate infoMartin Kaiser1-2/+54
Change-Id: I71b4d3c8f22c32f1aaf89f147bc6a20ce54aec4d Reviewed-on: https://code.wireshark.org/review/21409 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-02Use col_append_sep_str() for fixed stringsStig Bjørlykke1-4/+4
Change from col_append_sep_fstr() to col_append_sep_str() when appending strings without formatting. Change-Id: I315aca9b815c204a5bc78f7326402c40d1325f0e Reviewed-on: https://code.wireshark.org/review/20846 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-11iso14443: use proto_tree_add_checksum()Martin Kaiser1-50/+76
replace our own function for dissecting the CRC with the generic proto_tree_add_checksum() Change-Id: I569c877836a7b771b01a37b57b6c50fc0183e9a7 Reviewed-on: https://code.wireshark.org/review/19601 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-11-12iso14443: dissect the TA(1) byte in the ATSMartin Kaiser1-2/+51
Change-Id: I17785d32ca1f5ef69731c5dfba04892aa09648a0 Reviewed-on: https://code.wireshark.org/review/18756 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-10iso14443: the uid size is a generated itemMartin Kaiser1-1/+3
Change-Id: I77952e0099ed8103c8316becafc700866b4c46d8 Reviewed-on: https://code.wireshark.org/review/16366 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-10iso14443: expert info for invalid uid sizeMartin Kaiser1-5/+16
Change-Id: I3181375c3a2c8a905e1fd8bb722ac27902735ff0 Reviewed-on: https://code.wireshark.org/review/16365 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-07-03iso14443: expert info if the crc is wrongMartin Kaiser1-12/+18
Change-Id: I1b59a7d7bf0f9f304f816558f38ce5d52deb504e Reviewed-on: https://code.wireshark.org/review/16263 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-06-11iso14443: dissect attrib's p3 byteMartin Kaiser1-4/+15
Change-Id: Iec3595a9ee0f7037af1f949804f1022f315d1edc Reviewed-on: https://code.wireshark.org/review/15824 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-10iso14443 ats: show explicitly if TA(1), TB(1) and TC(1) are transmittedMartin Kaiser1-0/+21
Change-Id: I3f6e2bb73da901de0c6127564612fba86d49ddb4 Reviewed-on: https://code.wireshark.org/review/15335 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-07iso14443: show nad and cid info in the atsMartin Kaiser1-9/+37
re-use the boolean hf variables from the atqb in the ats, the info if nad and cid are supported is in different positions than in the atqb therefore, we can't use a bitmask for the hf variables fetch the correct bit manually instead Change-Id: I8ba36ff9662052edcc7899f24d1110fdc4834c2e Reviewed-on: https://code.wireshark.org/review/15282 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-05-05iso14443: add sfgiMartin Kaiser1-1/+9
Change-Id: Id8328cb7ca8674564a7230c7395dbeb24ffcea27 Reviewed-on: https://code.wireshark.org/review/15273 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-23iso14443: use the array_length() macroMartin Kaiser1-2/+1
Change-Id: Id4431885fb78d8d8679e98111d9f007491c3f13e Reviewed-on: https://code.wireshark.org/review/15069 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-03-18iso14443: fix the dissection of ATQAMartin Kaiser1-11/+36
the two bytes are sent LSB first all fields are defined relative to the entire 16bit value Change-Id: Iaea2b98fcb1f57224fbbd1c4c58473a7f810055d Reviewed-on: https://code.wireshark.org/review/14513 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-16iso14443: fix the NAK/ACK bit of an R-blockMartin Kaiser1-7/+7
if the bit is set, it's an R(NAK) block Change-Id: I0e44bd72d1c2a69a582792d08bf450e6ef2d163b Reviewed-on: https://code.wireshark.org/review/13976 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-15iso14443: fix the order of the ATS bytesMartin Kaiser1-4/+4
TL and T0 are followed by TA(1), TB(1) and TC(1), in this order Change-Id: I356da8bb475d55f36e5b9ff02d35fcf35c457223 Reviewed-on: https://code.wireshark.org/review/13961 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-15iso14443: dissect FWI in the ATSMartin Kaiser1-8/+15
use the same hf as for ATQB's FWI Change-Id: I2c1db117688e16e91fc4072d9b6f4bba46f64fd6 Reviewed-on: https://code.wireshark.org/review/13960 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-15iso14443: move ATS dissection to a separate functionMartin Kaiser1-56/+68
Change-Id: I04d9b610aac0f5387870be63b1d0dde9940bfa5b Reviewed-on: https://code.wireshark.org/review/13959 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-13iso14443: verify the CRC of all messagesMartin Kaiser1-49/+85
define a function to dissect the CRC depending on the card type add a circuit for an activated card to keep track of the card type define a new circuit type CT_ISO1443 for this purpose, the circuit ID is always 0 as we support only a single active card Change-Id: I7250f834301612ba50743258ca7bdbe0199de3ea Reviewed-on: https://code.wireshark.org/review/13908 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-05iso14443: add items for the actual length fieldsMartin Kaiser1-5/+64
the messages contain "length codes" instead of the actual lengths use a simple conversion table to covert length codes into lengths add generated items for the actual lengths Change-Id: Ic10aed0d20cfca30524cf767798df4eec2330592 Reviewed-on: https://code.wireshark.org/review/13734 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-05iso14443: move the dissection of the attrib command to a separate functionMartin Kaiser1-55/+68
Change-Id: I929a9e5ce22d87a169d94c5ff660f48512cb5134 Reviewed-on: https://code.wireshark.org/review/13733 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-05iso14443: make max_frame_size_code more genericMartin Kaiser1-7/+21
it's used by two messages, the relative position inside the current byte is different don't use a static bitmask for the hf Change-Id: I6a145cad46bab1afd22f66f144e7e4e9909f0b15 Reviewed-on: https://code.wireshark.org/review/13732 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-02-05iso14443: dissect some more fieldsMartin Kaiser1-3/+45
Change-Id: Ic1f20b94d9930150b60af4802bf8653713562a33 Reviewed-on: https://code.wireshark.org/review/13731 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-01-25Move the proto data stuff out of frame_data.[ch].Guy Harris1-1/+1
It's not tied to the frame_data structure any more, so it belongs by itself. Clean up some #includes while we're at it; in particular, frame_data.h doesn't use anything related to tvbuffs, so don't have it gratuitiously include tvbuff.h. Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c Reviewed-on: https://code.wireshark.org/review/13518 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-6/+6
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-22[iso14443] dissect two more components of the ATQBMartin Kaiser1-6/+24
Change-Id: I4fc1962a391549e880dcdf52dfa13a94d3568ea8 Reviewed-on: https://code.wireshark.org/review/13483 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-1/+1
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-31[iso14443] continue dissection of the ATSMartin Kaiser1-4/+62
display the individual bytes the next step is to dissect the meaning of their bits Change-Id: Id93bcdb3913886365dbd0fb3fdedc7ed0c63be93 Reviewed-on: https://code.wireshark.org/review/12957 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-12[iso14443] dissect the PCB byte and payload of I, R and S-blocksMartin Kaiser1-46/+126
Change-Id: Ia7c3e09d147d8e46acaf4476b82acdde88a400b9 Reviewed-on: https://code.wireshark.org/review/12567 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-12[iso14443] dissect some more components of the ATQBMartin Kaiser1-45/+138
and move ATQB dissection into a separate function Change-Id: Iaa6b4aaaa70bb33ddd334ed4d5c39ffc15454e4c Reviewed-on: https://code.wireshark.org/review/12566 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-7/+7
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-25Fix copy-and-pasteo.Guy Harris1-1/+1
Presumably the intent was to check for either of the two "CRC dropped" event types. (CID 1340186.) Change-Id: Ieea8f5ab80bebbdbb683998a6747e5130d46b92d Reviewed-on: https://code.wireshark.org/review/12127 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-25Fix typo.Guy Harris1-5/+14
Convert the if-chain to a switch() statement while we're at it; if it had been one originally, the compiler would have reported that there were duplicate cases and failed. (CID 1340190.) Change-Id: I297ab32c51842af889bd6bebe764c0e45d57cea0 Reviewed-on: https://code.wireshark.org/review/12125 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-21ISO14443: Fix Dead Store (Dead assignement/Dead increment) Warning found by ↵Alexis La Goutte1-1/+1
Clang Change-Id: I63f0b3891030ccc001f81fde94121adad37b555b Reviewed-on: https://code.wireshark.org/review/12004 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-19use the official DLT for ISO14443Martin Kaiser1-1/+7
add DLT_ISO14443 to pcap_to_wtap_map[] define WTAP_ENCAP_ISO14443, link it to the iso14443 dissector Change-Id: Id837197c4d66071094f9336d60db36a371424807 Reviewed-on: https://code.wireshark.org/review/11959 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-18[iso14443] add simple components of an R-blockMartin Kaiser1-1/+5
an S-block has no block number, fix this while at it Change-Id: I16113fde5f78d77d7db6b7cec8d4dfa46f0187aa Reviewed-on: https://code.wireshark.org/review/11944 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-17[iso14443] start dissecting the PCB of an S-blockMartin Kaiser1-4/+10
S-blocks have a block number exactly like I-blocks, give the hf variable a more generic name Change-Id: I25774496f88bd27b1978662e4a781ddeb5e44b45 Reviewed-on: https://code.wireshark.org/review/11920 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-17[iso14443] do a more precise check for uid-related commandsMartin Kaiser1-1/+1
make sure that we don't treat an S-block as a uid command Change-Id: Ibe001cd346eff462040df5259c7a88fa7f94bf78 Reviewed-on: https://code.wireshark.org/review/11918 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-17[iso14443] dissect I-block PCB componentsMartin Kaiser1-6/+39
Change-Id: I076ce2f4f7dca455a8ee12445fcbf17a9f120f49 Reviewed-on: https://code.wireshark.org/review/11917 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-17update the ISO1443 dissectorMartin Kaiser1-71/+556
handle the ..._CRC_DROPPED events use pinfo->p2p_dir to store the direction pass a boolean 'crc_dropped' to the sub-dissectors for message types subtree for an ISO1443 message dissect most components of most messages Change-Id: I2570dd4d941e5db7fa541723b70ccad6ce70ab49 Reviewed-on: https://code.wireshark.org/review/11912 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2015-11-12Squelch a compiler warning.Guy Harris1-1/+1
Change-Id: I9e9746dc5f17daea7830ddc37f5df0ba16def397 Reviewed-on: https://code.wireshark.org/review/11762 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-12dissector for ISO14443 protocolsMartin Kaiser1-0/+593
This is a dissector for the ISO14443 protocols between a contactless smartcard and a card reader. The overall approach is similar to DVB-CI. We have a pseudo-header in front of the captured data that has information about the type of the captured data and the direction. For now, the dissector registers itself by name so it can be linked to a user-DLT. I am applying for an official DLT. Change-Id: I9c4a28ef5b220f205baf58381bf1962996887a9d Reviewed-on: https://code.wireshark.org/review/11663 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>