mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-10 18:24:27 +08:00
cppcheck
This commit is contained in:
parent
e2f59d215f
commit
e5db57747c
1 changed files with 6 additions and 6 deletions
|
@ -1727,13 +1727,13 @@ void MifareEMemGet(uint8_t blockno, uint8_t blockcnt) {
|
||||||
// Load a card into the emulator memory
|
// Load a card into the emulator memory
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
int MifareECardLoadExt(uint8_t sectorcnt, uint8_t keyType) {
|
int MifareECardLoadExt(uint8_t sectorcnt, uint8_t keytype) {
|
||||||
int retval = MifareECardLoad(sectorcnt, keyType);
|
int retval = MifareECardLoad(sectorcnt, keytype);
|
||||||
reply_ng(CMD_HF_MIFARE_EML_LOAD, retval, NULL, 0);
|
reply_ng(CMD_HF_MIFARE_EML_LOAD, retval, NULL, 0);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MifareECardLoad(uint8_t sectorcnt, uint8_t keyType) {
|
int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) {
|
||||||
|
|
||||||
uint32_t cuid = 0;
|
uint32_t cuid = 0;
|
||||||
struct Crypto1State mpcs = {0, 0};
|
struct Crypto1State mpcs = {0, 0};
|
||||||
|
@ -1760,14 +1760,14 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keyType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint8_t sectorNo = 0; sectorNo < sectorcnt; sectorNo++) {
|
for (uint8_t sectorNo = 0; sectorNo < sectorcnt; sectorNo++) {
|
||||||
uint64_t ui64Key = emlGetKey(sectorNo, keyType);
|
uint64_t ui64Key = emlGetKey(sectorNo, keytype);
|
||||||
if (sectorNo == 0) {
|
if (sectorNo == 0) {
|
||||||
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(sectorNo), keyType, ui64Key, AUTH_FIRST)) {
|
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(sectorNo), keytype, ui64Key, AUTH_FIRST)) {
|
||||||
if (DBGLEVEL > DBG_ERROR) Dbprintf("Sector[%2d]. Auth error", sectorNo);
|
if (DBGLEVEL > DBG_ERROR) Dbprintf("Sector[%2d]. Auth error", sectorNo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(sectorNo), keyType, ui64Key, AUTH_NESTED)) {
|
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(sectorNo), keytype, ui64Key, AUTH_NESTED)) {
|
||||||
retval = PM3_ESOFT;
|
retval = PM3_ESOFT;
|
||||||
if (DBGLEVEL > DBG_ERROR) Dbprintf("Sector[%2d]. Auth nested error", sectorNo);
|
if (DBGLEVEL > DBG_ERROR) Dbprintf("Sector[%2d]. Auth nested error", sectorNo);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in a new issue