Skip to content

Commit

Permalink
fixed IsoDep protocol parser
Browse files Browse the repository at this point in the history
  • Loading branch information
josevcm committed Jun 12, 2022
1 parent 7306f58 commit b95a53c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nfc-app/app-qt/src/main/cpp/model/StreamModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ struct StreamModel::Impl
int command = (*frame)[0];

// ISO-DEP protocol S(Deselect)
if ((command & 0xF7) == 0xC2 && frame->limit() == 3)
if ((command & 0xF7) == 0xC2 && frame->limit() >= 3 && frame->limit() <= 4)
return "S(Deselect)";

// ISO-DEP protocol S(WTX)
if ((command & 0xF7) == 0xF2 && frame->limit() == 3)
if ((command & 0xF7) == 0xF2 && frame->limit() >= 3 && frame->limit() <= 4)
return "S(WTX)";

// ISO-DEP protocol R(ACK)
Expand All @@ -415,7 +415,7 @@ struct StreamModel::Impl
return "R-Block";

// ISO-DEP protocol S-Block
if ((command & 0xC7) == 0xC2 && frame->limit() == 4)
if ((command & 0xC7) == 0xC2 && frame->limit() >= 3 && frame->limit() <= 4)
return "S-Block";

return {};
Expand Down

0 comments on commit b95a53c

Please sign in to comment.