mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Continue reading credentials if one fails (e.g. when using different site keys)
This commit is contained in:
parent
1f8217ec2e
commit
cb6a1db852
2 changed files with 10 additions and 1 deletions
|
@ -771,7 +771,12 @@ static int hfgal_read_card(uint32_t aid, uint8_t *site_key, bool verbose, bool q
|
||||||
// Read & decode credentials
|
// Read & decode credentials
|
||||||
GallagherCredentials_t creds = {0};
|
GallagherCredentials_t creds = {0};
|
||||||
res = hfgal_read_creds_app(&dctx, current_aid, site_key, &creds, verbose);
|
res = hfgal_read_creds_app(&dctx, current_aid, site_key, &creds, verbose);
|
||||||
|
if (res != PM3_SUCCESS && res != HFGAL_AUTH_FAIL)
|
||||||
HFGAL_RET_IF_ERR_MAYBE_MSG(res, !quiet, "Failed reading card application credentials");
|
HFGAL_RET_IF_ERR_MAYBE_MSG(res, !quiet, "Failed reading card application credentials");
|
||||||
|
if (res == HFGAL_AUTH_FAIL) {
|
||||||
|
PrintAndLogEx(WARNING, "Invalid site key for AID %06X", current_aid);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "GALLAGHER (AID %06X) - Region: " _GREEN_("%u") ", Facility: " _GREEN_("%u")
|
PrintAndLogEx(SUCCESS, "GALLAGHER (AID %06X) - Region: " _GREEN_("%u") ", Facility: " _GREEN_("%u")
|
||||||
", Card No.: " _GREEN_("%u") ", Issue Level: " _GREEN_("%u"), current_aid,
|
", Card No.: " _GREEN_("%u") ", Issue Level: " _GREEN_("%u"), current_aid,
|
||||||
|
|
|
@ -40,4 +40,8 @@ int hfgal_diversify_key(uint8_t *site_key, uint8_t *uid, uint8_t uid_len,
|
||||||
#define HFGAL_RET_IF_ERR_WITH_MSG(res, ...) if (res != PM3_SUCCESS) { PrintAndLogEx(ERR, __VA_ARGS__); return res; }
|
#define HFGAL_RET_IF_ERR_WITH_MSG(res, ...) if (res != PM3_SUCCESS) { PrintAndLogEx(ERR, __VA_ARGS__); return res; }
|
||||||
#define HFGAL_RET_IF_ERR_MAYBE_MSG(res, verbose, ...) if (res != PM3_SUCCESS) { if (verbose) PrintAndLogEx(ERR, __VA_ARGS__); return res; }
|
#define HFGAL_RET_IF_ERR_MAYBE_MSG(res, verbose, ...) if (res != PM3_SUCCESS) { if (verbose) PrintAndLogEx(ERR, __VA_ARGS__); return res; }
|
||||||
|
|
||||||
|
// The response code when an invalid key is used for authentication
|
||||||
|
// Returned in /client/src/mifare/desfirecore.c, line 1185 (if DesfireExchangeEx fails)
|
||||||
|
#define HFGAL_AUTH_FAIL 7
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue