aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iso14443.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-02iso14443: fix conflict/typoAlexis La Goutte1-1/+1
'iso14443.write_block.number' exists multiple times with NOT compatible types: FT_BYTES and FT_UINT16 Change-Id: I1e92e470acf1bda89b894dd8603309f7168bb069 Reviewed-on: https://code.wireshark.org/review/34681 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-06ISO14443: Update some commandsUli Heilmeier1-13/+189
Updates short frames commands and added read/write for Type 2 tags. Change-Id: Ief7069cba8f6543290a246eda439b39c20c3079a Reviewed-on: https://code.wireshark.org/review/34190 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-20iso14443: add unverified crc to the proto treeMartin Kaiser1-9/+18
If an iso14443 message contains crc bytes but we do not know the card type, we cannot verify if the crc is correct or not. Add the crc bytes to the proto tree in this case and mark them as unverified. Change-Id: I2d95f2e4e5edc20095df58930b3176376a8786aa Reviewed-on: https://code.wireshark.org/review/33686 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-13register_decode_as_next_proto: remove the "title" parameterMartin Kaiser1-2/+1
Remove the "title" parameter from the register_decode_as_next_proto() function. This parameter is no longer required since decode_as_t does not have a title any more. Change-Id: I300c755bd465453aa91703b53ce9adc954e38c00 Reviewed-on: https://code.wireshark.org/review/33579 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-30iso14443: use the correct I-block payloadMartin Kaiser1-5/+8
When we reassemble I-blocks, we pass the payload to fragment_add_seq_next. To do so, we use the overall iso14443 tvb, an offset and the payload length as parameters. We then call process_reassembled_data to do reassembly. If the I-block was not fragmented, process_reassembled_data returns the only fragment + the rest of the packet after this fragment. This might be a misunderstanding on my part or something to be fixed in the reassembly routines. For now, we work around this by defining a new tvb for the data we submit to fragment_add_seq_next. (I ran into a similar issue years ago for DVB-CI. Add a comment about this. If it turns out that there's a better way to fix this, we should be fixing both dissectors.) Change-Id: Id83ab152529a5150669df3099df6f60be7a3a723 Reviewed-on: https://code.wireshark.org/review/33355 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2019-05-25iso14443: we reassemble APDUs, not TPDUsMartin Kaiser1-12/+12
Fix the field names and the filter strings accordingly. Change-Id: I4275abc04962a364dfea2ea76ca9877d82e0ae06 Reviewed-on: https://code.wireshark.org/review/33354 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2019-05-25iso14443: (trivial) i_block_frag_items is usedMartin Kaiser1-1/+1
remove the _U_ tag Change-Id: Id0cfb160903cf3a72adee20fa5c388d68c991a56 Reviewed-on: https://code.wireshark.org/review/33353 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2019-05-15iso14443: dissect the CID in the attrib messageMartin Kaiser1-5/+12
For type B cards, the PCD assigns a card identifier (CID) in the attrib message it sends to the card. The card sends the assigned CID back in its response. We already dissect the CID in the response. Dissect it in the attrib message as well. Change-Id: Ic0bd200f0e40496d8fe3121aa9ad601a269de36c Reviewed-on: https://code.wireshark.org/review/33183 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-7/+7
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-26iso14443: Initialize iso14443_trans->cmd.Anders Broman1-0/+1
Bug: 15634 Change-Id: Ibaeb063db74055e26805db21875b9085b45c3ebe Reviewed-on: https://code.wireshark.org/review/32581 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2018-04-09iso14443: make the payload dissector configurableMartin Kaiser1-2/+12
Add an iso14443.subdissector table where other protocols can register themselves for iso14443's payload. Register iso7816 dissector in this table. Change-Id: Idb17ae014449443448ec4c64017531bc69d806b3 Reviewed-on: https://code.wireshark.org/review/26821 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-09iso14443: decode the bitrates in the attrib messageMartin Kaiser1-0/+28
Change-Id: I10bd77d72984fcf045a3c80e900c034393b444ae Reviewed-on: https://code.wireshark.org/review/26822 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-20Define macros to calculate (2^N)^M, and use them in more places.Guy Harris1-4/+5
Change-Id: I4df1b35d8d2233c301f0ba9e119d012aebe9cd17 Reviewed-on: https://code.wireshark.org/review/25913 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-13Remove circuit APIMichael Mann1-4/+4
Replace with conversation API that limits the "endpoint" to a single uint32 value. The intention is to eventually have "layered" endpoints, because circuit_id was used in cases where src/dest port have already been populated (and are used for layers above). Those src/dest ports should just be treated as just another endpoint, but we currently only have support for one. Change-Id: Ic6aa7ef0241275aa4dfde9459194369b48c72960 Reviewed-on: https://code.wireshark.org/review/24369 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-09ISO 14443: Convert circuit API to conversation APIMichael Mann1-18/+15
Change-Id: Id007a3df5442cf4d21263acb17303b6d735aaa7d Reviewed-on: https://code.wireshark.org/review/24311 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-12iso14443: reassemble APDUs from I-blocksMartin Kaiser1-1/+100
Extract the payload from I-blocks and support reassembly of APDUs that are encapsulated in I-blocks. ISO14443 assumes that the fragments arrive in order and no fragments are missing. For now, we pass the reassembled APDU to the data dissector. Change-Id: I526f6e6d699b2a1dfc4593536154bc9b58dea96e Reviewed-on: https://code.wireshark.org/review/23506 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: Anders Broman <a.broman58@gmail.com>
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>