Commit 363a4613 authored by axel.maurer's avatar axel.maurer
Browse files

delete App error fixed

parent 7debcdba
......@@ -519,20 +519,26 @@ int DeleteApp(int masterAppId, int appId, char *resultStr)
}
else
{
if (!mks.KeySettings.FreeCreateDelete)
{
if (!DesfireCardOpenApp(masterAppId, AUTH_KEY_MASTER))
{
sprintf(resultStr, "13,Error opening App: 0x%x with Key: %d", KIT_MASTER, AUTH_KEY_MASTER);
return false;
}
}
else
if (!mks.KeySettings.FreeCreateDelete) // no authentication necessary
{
if (!DesfireCardOpenApp(appId, AUTH_KEY_MASTER))
if (!DesfireCardOpenApp(masterAppId, AUTH_KEY_MASTER)) // authentication with picc masterkey
{
sprintf(resultStr, "13,Error opening App: 0x%x with Key: %d", KIT_MASTER, AUTH_KEY_MASTER);
return false;
sprintf(mBuffer, "Error opening App: 0x%x with Key: %d, trying with appKey", KIT_MASTER, AUTH_KEY_MASTER);
PrintLnDebug(mBuffer);
if (!DesfireCardOpenApp(appId, AUTH_KEY_MASTER)) // authentication necessary with appId, App deleted, error ignored
{
sprintf(mBuffer, "Error opening App for deleteing: 0x%x with Key: %d", appId, AUTH_KEY_MASTER);
PrintLnDebug(mBuffer);
sprintf(resultStr, "131,%s", mBuffer);
return false;
} else {
sprintf(mBuffer, "Trying to delete App 0x%x ignoring error", appId);
PrintLnDebug(mBuffer);
DESFire_DeleteApplication(CRYPTO_ENV0, appId);
return(true);
}
} else {
}
}
}
......
......@@ -16,8 +16,8 @@ set FIRMWARE_PATH=Firmware\TWN4_xCx401_STD204_Multi_CDC_Standard.bix
rem eventuell zu setzende Compiler Switches. Es können auch mehrere -D gesetzt werden
set DEBUG= -DDEBUG
set READER_ACTION= -DREADER_ACTION=1
rem set SECURE= -DSECURE
@REM set READER_ACTION= -DREADER_ACTION=1
@REM set SECURE= -DSECURE
c:
......@@ -32,7 +32,7 @@ if errorlevel 1 goto ende
del "App_KITC100_%PROJECT%.elf" "App_KITC100_%PROJECT%.lst" "App_KITC100_%PROJECT%.map" "App_KITC100_%PROJECT%.hex" "TWN4_%DEV_VERSION%.bix"
taskkill /IM coolterm.exe /F
"%ELATEC_DIR%\Tools\flash" USB %BIX_FILE%
rem exit
exit
timeout /T 2
python .\reader_test.py
:ende
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment