Environment Details:
Card:
- MIFARE DESFire EV3
SDK:
- NXP TapLinx
Android:
- Android Studio + Kotlin
Transport:
- IsoDep
Library Interface:
- IDESFireEV1
Goal:
1. Create DESFire EV3 application
2. Change application master key (key 0)
3. Authenticate with new key
Working:
- PICC authentication
- formatPICC()
- createApplication()
- selectApplication()
Failing:
- authenticate() on newly created AES application
OR
- changeKey() with SW2=30Working:
- PICC authentication
- formatPICC()
- createApplication()
- selectApplication()
Failing:
- changeKey() with SW2=30
Logcat:
Integrity Error SW2 = 30
com.nxp.nfclib.desfire.DESFireUtil.invalidResponse(:260)
com.nxp.nfclib.desfire.DESFireResponse.invalidResponse(:174)
com.nxp.nfclib.desfire.DESFireEV2.changeKeyCommandTransfer(:1034)
com.nxp.nfclib.desfire.DESFireEV1.changeKeyHelper(:1215)
com.nxp.nfclib.desfire.DESFireEV2.changeKey(:851)
private fun createApplication() {
val s = EV1ApplicationKeySettings.Builder()
.setAppMasterKeyChangeable(true)
.setAppKeySettingsChangeable(true)
.setAuthenticationRequiredForFileManagement(true)
.setAuthenticationRequiredForDirectoryConfigurationData(true)
.setMaxNumberOfApplicationKeys(3)
.setKeyTypeOfApplicationKeys(KeyType.TWO_KEY_THREEDES)
.build()
desfire.createApplication(AID, s)
detail(" createApplication: AID=${AID.toHex()}, type=$KEY_TYPE, numKeys=3")
}
desfire.changeKey(keyNo, KeyType.TWO_KEY_THREEDES, oldKey, newKey, 0x00)