Javacard - garbage collection power loss

I noticed a very strange behavior on my smart cards (NXP J2E145, J3A081, J3C145 with an Omnikey 5121 reader): power loss immediately after calling the JavaCard method

JCSystem.requestObjectDeletion() 

can damage the card: after about 10% of such power outages, the ATR command works very slowly (1000 ms), and I do not get a response to any other APDUs (applet selection, card manager authentication, etc.).

I know that the behavior of requestObjectDeletion () depends on the specific implementation of the provider, so my question is quite wide and open ...

Does garbage collection collect "normally" in a single transaction?

Is there any β€œofficial” recommendation to NOT call requestObjectDeletion () in case of a possible power loss?

Do you have any experience with NXP cards?

EDIT:

  • JCSystem.isObjectDeletionSupported () == true on all my smart cards.
  • When trying to connect to the card manager applets of a damaged card, the JCOP shell in the Eclipse IDE reports this:

    ATR: 3BFB9600008131FE454F4450204D41502053414D3E

    ATR: T = 1
    jcshell: Unknown terminal issues. Last terminal error: the request could not be completed due to an I / O device error.

+5
source share
1 answer

Well, I think it might be an implementation error. In general, garbage collection is usually never needed and never used on smart cards. You should avoid it under any circumstances with a good applet design. Because in this way you never encounter memory problems that are harmful to a smart card installed once in a lifetime and that can be used for the rest of the life cycle. Garbage collection is in any case too long, and perhaps this programmer did not expect this to happen outside of a safe environment.

+4
source

Source: https://habr.com/ru/post/1211911/


All Articles