Fix was attempting to credential file when --noappcreate was passed

This commit is contained in:
Matt Moran 2022-01-13 21:06:21 +13:00
commit aa6b74a08d

View file

@ -941,11 +941,10 @@ static int CmdGallagherClone(const char *cmd) {
HFGAL_RET_ERR(PM3_EFATAL, "Could not find an available AID, please specify with --aid");
if (verbose)
PrintAndLogEx(INFO, "Using available AID: %06X", aid);
} else {
// Check that AID is available
if (aid_exists(&dctx, aid, verbose))
HFGAL_RET_ERR(PM3_EINVARG, "AID already exists: %06X", aid);
}
// Check that AID is available
else if (!no_app_create && aid_exists(&dctx, aid, verbose))
HFGAL_RET_ERR(PM3_EINVARG, "AID already exists: %06X", aid);
// Update Card Application Directory
if (!no_cad_update) {
@ -969,12 +968,12 @@ static int CmdGallagherClone(const char *cmd) {
res = hfgal_create_creds_app(&dctx, site_key, aid, verbose);
HFGAL_RET_IF_ERR_WITH_MSG(res, "Failed creating Gallagher application");
}
// Create credential files
// Don't need to set keys here, they're generated automatically
res = hfgal_create_creds_file(&dctx, site_key, aid, &creds, verbose);
HFGAL_RET_IF_ERR_WITH_MSG(res, "Failed creating Gallagher credential file");
}
PrintAndLogEx(SUCCESS, "Done");
PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`hf gallagher reader`") " to verify");