When uninstalling an applet only (e.g. Kind.Application), with globalplatform library of v19.06.16 (latest maven), the uninstall fails
Caused by: pro.javacard.gp.GPException: DELETE failed: 0x6A88 (Referenced data not found)
However, performing the same action without force option, the task is succesfull.
I noticed this on OpenPGP applets (yubikey for example: https://github.com/Yubico/ykneo-openpgp)
Information about your card
USB Gemplus reader with JavaCOS A40 card
Product -was not certain what is this supposed to mean, if applet, then OpenPGP applets.
OpenPGP applet version 1.0.2, of sdk 2.2.1/2.2.2
Expected behaviour
The applet instance is removed with or without force option. Additionaly, the app could delete package too with force option enabled (this is what I've tried to implement, and how I found this)
Describe the bug
When uninstalling an applet only (e.g. Kind.Application), with globalplatform library of v19.06.16 (latest maven), the uninstall fails
Caused by: pro.javacard.gp.GPException: DELETE failed: 0x6A88 (Referenced data not found)
However, performing the same action without force option, the task is succesfull. I noticed this on OpenPGP applets (yubikey for example: https://github.com/Yubico/ykneo-openpgp)Information about your card
Expected behaviour
The applet instance is removed with or without force option. Additionaly, the app could delete package too with force option enabled (this is what I've tried to implement, and how I found this)
Full log
Log from GP.exe, the same happens with the library from maven
``` GlobalPlatformPro v20.01.23-0-g5ad373b Running on Windows 8.1 6.3 amd64, Java 1.8.0_211 by Oracle Corporation # Detected readers from JNA2PCSC [*] Gemplus USB Key Smart Card Reader 1 SCardConnect("Gemplus USB Key Smart Card Reader 1", T=*) -> T=1, 3BF81300008131FE454A434F5076323431B7 SCardBeginTransaction("Gemplus USB Key Smart Card Reader 1") Reader: Gemplus USB Key Smart Card Reader 1 ATR: 3BF81300008131FE454A434F5076323431B7 More information about your card: http://smartcard-atr.appspot.com/parse?ATR=3BF81300008131FE454A434F5076323431B7 A>> T=1 (4+0000) 00A40400 00 A<< (0103+2) (52ms) 6F658408A000000003000000A5599F6501FF9F6E06479100783400734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012A026E0102 9000 [TRACE] GPSession - [6F] [TRACE] GPSession - [84] A000000003000000 [TRACE] GPSession - [A5] [TRACE] GPSession - [9F65] FF [TRACE] GPSession - [9F6E] 479100783400 [TRACE] GPSession - [73] [TRACE] GPSession - [06] 2A864886FC6B01 [TRACE] GPSession - [60] [TRACE] GPSession - [06] 2A864886FC6B02020101 [TRACE] GPSession - [63] [TRACE] GPSession - [06] 2A864886FC6B03 [TRACE] GPSession - [64] [TRACE] GPSession - [06] 2A864886FC6B040215 [TRACE] GPSession - [65] [TRACE] GPSession - [06] 2B8510864864020103 [TRACE] GPSession - [66] [TRACE] GPSession - [06] 2B060104012A026E0102 [DEBUG] GPSession - Auto-detected ISD: A000000003000000 [TRACE] GPData - GET DATA(CPLC) A>> T=1 (4+0000) 80CA9F7F 00 A<< (0045+2) (23ms) 9F7F2A479051674791007834002240002890962581481222470000000009373830323839300000000000000000 9000 [WARN] GPData - Invalid CPLC date: 3830 CPLC: ICFabricator=4790 ICType=5167 OperatingSystemID=4791 OperatingSystemReleaseDate=0078 (2010-03-19) OperatingSystemReleaseLevel=3400 ICFabricationDate=2240 (2012-08-27) ICSerialNumber=00289096 ICBatchIdentifier=2581 ICModuleFabricator=4812 ICModulePackagingDate=2247 (2012-09-03) ICCManufacturer=0000 ICEmbeddingDate=0000 (2010-01-01) ICPrePersonalizer=0937 ICPrePersonalizationEquipmentDate=3830 (invalid date format) ICPrePersonalizationEquipmentID=32383930 ICPersonalizer=0000 ICPersonalizationDate=0000 (2010-01-01) ICPersonalizationEquipmentID=00000000 [TRACE] GPData - GET DATA(IIN) A>> T=1 (4+0000) 80CA0042 00 A<< (0000+2) (11ms) 6A88 [DEBUG] GPData - GET DATA(IIN): N/A [TRACE] GPData - GET DATA(CIN) A>> T=1 (4+0000) 80CA0045 00 A<< (0000+2) (11ms) 6A88 [DEBUG] GPData - GET DATA(CIN): N/A Card Data: [TRACE] GPData - GET DATA(Card Data) A>> T=1 (4+0000) 80CA0066 00 A<< (0078+2) (33ms) 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012A026E0102 9000 [TRACE] GPData - [66] [TRACE] GPData - [73] [TRACE] GPData - [06] 2A864886FC6B01 [TRACE] GPData - [60] [TRACE] GPData - [06] 2A864886FC6B02020101 [TRACE] GPData - [63] [TRACE] GPData - [06] 2A864886FC6B03 [TRACE] GPData - [64] [TRACE] GPData - [06] 2A864886FC6B040215 [TRACE] GPData - [65] [TRACE] GPData - [06] 2B8510864864020103 [TRACE] GPData - [66] [TRACE] GPData - [06] 2B060104012A026E0102 Tag 6: 1.2.840.114283.1 -> Global Platform card Tag 60: 1.2.840.114283.2.2.1.1 -> GP Version: 2.1.1 Tag 63: 1.2.840.114283.3 Tag 64: 1.2.840.114283.4.2.21 -> GP SCP02 i=15 Tag 65: 1.3.656.840.100.2.1.3 Tag 66: 1.3.6.1.4.1.42.2.110.1.2 -> JavaCard v2 Card Capabilities: [TRACE] GPData - GET DATA(Card Capabilities) A>> T=1 (4+0000) 80CA0067 00 A<< (0000+2) (12ms) 6A88 [DEBUG] GPData - GET DATA(Card Capabilities): N/A [TRACE] GPData - GET DATA(Key Info Template) A>> T=1 (4+0000) 80CA00E0 00 A<< (0020+2) (17ms) E012C00401FF8010C00402FF8010C00403FF8010 9000 [TRACE] GPKeyInfo - [E0] [TRACE] GPKeyInfo - [C0] 01FF8010 [TRACE] GPKeyInfo - [C0] 02FF8010 [TRACE] GPKeyInfo - [C0] 03FF8010 Version: 255 (0xFF) ID: 1 (0x01) type: DES3 length: 16 Version: 255 (0xFF) ID: 2 (0x02) type: DES3 length: 16 Version: 255 (0xFF) ID: 3 (0x03) type: DES3 length: 16 Key version suggests factory keys Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F [WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02 [WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02 [WARN] PlaintextKeys - Don't know how to calculate KCV, defaulting to SCP02 [INFO] GPSession - Using card master keys: ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for null [TRACE] GPSession - Generated host challenge: 916FBB175787D87F A>> T=1 (4+0008) 80500000 08 916FBB175787D87F 00 A<< (0028+2) (49ms) 00002240002890962581FF0208BE6EDF650B5FB62BBC2A6A69A638D7 9000 [DEBUG] GPSession - Host challenge: 916FBB175787D87F [DEBUG] GPSession - Card challenge: 08BE6EDF650B5FB6 [DEBUG] GPSession - Card reports SCP02 with key version 255 (0xFF) [INFO] GPSession - Diversified card keys: ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for SCP02 [INFO] GPSession - Session keys: ENC=2C5E835A75097E9E21F872300DD0D805 MAC=188FAA55815A82427287FEE7935AE3F6 RMAC=F25545E596A03169776FA003288110A0, card keys=ENC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) MAC=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) DEK=404142434445464748494A4B4C4D4E4F (KCV: 8BAF47) for SCP02 [DEBUG] GPSession - Verified card cryptogram: 2BBC2A6A69A638D7 [DEBUG] GPSession - Calculated host cryptogram: 44EE46FF9AAE9190 [TRACE] SCP02Wrapper - MAC input: 848201001044EE46FF9AAE9190 A>> T=1 (4+0016) 84820100 10 44EE46FF9AAE91906D44D27663FB1873 A<< (0000+2) (49ms) 9000 [TRACE] SCP02Wrapper - MAC input: 84F280020A4F00 A>> T=1 (4+0010) 84F28002 0A 4F0033B18DDE1EB83C99 00 A<< (0019+2) (30ms) E3114F08A0000000030000009F700101C5019E 9000 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] A000000003000000 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [C5] 9E [TRACE] SCP02Wrapper - MAC input: 84F240020A4F00 A>> T=1 (4+0010) 84F24002 0A 4F00CC1FD7C4BF01E893 00 A<< (0093+2) (56ms) E3134F0A4A43416C6754657375319F700107C50100E3154F0CF276A288BCFBA69D34F310019F700107C50100E3144F0BA0000003080000100001009F700107C50100E3194F10D27600012401020000000000000100009F700107C50100 9000 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] 4A43416C675465737531 [TRACE] GPRegistry - [9F70] 07 [TRACE] GPRegistry - [C5] 00 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] F276A288BCFBA69D34F31001 [TRACE] GPRegistry - [9F70] 07 [TRACE] GPRegistry - [C5] 00 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] A000000308000010000100 [TRACE] GPRegistry - [9F70] 07 [TRACE] GPRegistry - [C5] 00 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] D2760001240102000000000000010000 [TRACE] GPRegistry - [9F70] 07 [TRACE] GPRegistry - [C5] 00 [TRACE] SCP02Wrapper - MAC input: 84F210020A4F00 A>> T=1 (4+0010) 84F21002 0A 4F004FA61696122863B7 00 A<< (0123+2) (71ms) E31B4F094A43416C67546573759F700101840A4A43416C675465737531E31F4F0BF276A288BCFBA69D34F3109F700101840CF276A288BCFBA69D34F31001E31B4F08A0000003080000109F700101840BA000000308000010000100E31E4F06D276000124019F7001018410D2760001240102000000000000010000 9000 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] 4A43416C6754657375 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [84] 4A43416C675465737531 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] F276A288BCFBA69D34F310 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [84] F276A288BCFBA69D34F31001 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] A000000308000010 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [84] A000000308000010000100 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] D27600012401 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [84] D2760001240102000000000000010000 [TRACE] SCP02Wrapper - MAC input: 84F220020A4F00 A>> T=1 (4+0010) 84F22002 0A 4F009B7878D5102AE0FF 00 A<< (0066+2) (52ms) E30F4F094A43416C67546573759F700101E3114F0BF276A288BCFBA69D34F3109F700101E30E4F08A0000003080000109F700101E30C4F06D276000124019F700101 9000 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] 4A43416C6754657375 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] F276A288BCFBA69D34F310 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] A000000308000010 [TRACE] GPRegistry - [9F70] 01 [TRACE] GPRegistry - [E3] [TRACE] GPRegistry - [4F] D27600012401 [TRACE] GPRegistry - [9F70] 01 [DEBUG] GPRegistry - Registry already contains PKG: 4A43416C6754657375, 1 [DEBUG] GPRegistry - Registry already contains PKG: F276A288BCFBA69D34F310, 1 [DEBUG] GPRegistry - Registry already contains PKG: A000000308000010, 1 [DEBUG] GPRegistry - Registry already contains PKG: D27600012401, 1 [TRACE] DMTokenGenerator - No private key for token generation provided [TRACE] GPSession - TLV payload: [TRACE] GPSession - [4F] D2760001240102000000000000010000 [TRACE] SCP02Wrapper - MAC input: 84E400801A4F10D2760001240102000000000000010000 A>> T=1 (4+0026) 84E40080 1A 4F10D2760001240102000000000000010000AE09EBDE9F83767B A<< (0000+2) (35ms) 6A88 Could not delete AID: D2760001240102000000000000010000 SCardEndTransaction("Gemplus USB Key Smart Card Reader 1") SCardDisconnect("Gemplus USB Key Smart Card Reader 1", true) tx:165/rx:603 ```