Merge pull request #3131 from q0jt/master

Improve felica validation and cleanup handling
This commit is contained in:
Iceman
2026-03-14 11:06:23 +07:00
committed by GitHub
+4 -4
View File
@@ -610,6 +610,7 @@ static bool waitCmdFelicaEx(bool iSelect, PacketResponseNG *resp, bool verbose,
if (logging) {
PrintAndLogEx(WARNING, "CRC ( " _RED_("fail") " )");
}
return false;
}
if (resp->data.asBytes[0] != 0xB2 || resp->data.asBytes[1] != 0x4D) {
@@ -795,8 +796,7 @@ static int CmdHFFelicaReader(const char *Cmd) {
if (cm) {
PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit");
}
CLIParserFree(ctx);
return read_felica_uid(cm, verbose);
}
@@ -4201,7 +4201,7 @@ static int felica_internal_authentication(
return PM3_ERFTRANS;
}
if (res.status_flags.status_flag1[0] != 0x00 && res.status_flags.status_flag2[0] != 0x00) {
if (res.status_flags.status_flag1[0] != 0x00 || res.status_flags.status_flag2[0] != 0x00) {
PrintAndLogEx(ERR, "\nError RC Write");
return PM3_ERFTRANS;
}
@@ -4330,7 +4330,7 @@ static int felica_external_authentication(
return PM3_ERFTRANS;
}
if (res.status_flags.status_flag1[0] != 0x00 && res.status_flags.status_flag2[0] != 0x00) {
if (res.status_flags.status_flag1[0] != 0x00 || res.status_flags.status_flag2[0] != 0x00) {
PrintAndLogEx(ERR, "\nExternal Authenticate: " _RED_("Failed"));
return PM3_ERFTRANS;
}