Implemented best-effor case to use Key B for reading

This commit is contained in:
Polle Vanhoof 2020-08-03 20:40:03 +02:00
parent ba072f16f6
commit 269b61e128

View File

@ -684,7 +684,9 @@ int main(int argc, char *const argv[])
failure = false;
} else {
// Error, now try read() with B key
if (res != NFC_ERFTRANS) {
if (res != NFC_EMFCAUTHFAIL) {
fprintf(stdout, "Failed reading with Key A after successfully testing Key A. This is unusual, but continuing anyway in case Key B succeeds...");
} else if (res != NFC_ERFTRANS) {
nfc_perror(r.pdi, "nfc_initiator_mifare_cmd");
goto error;
}