Javacard - power loss during garbage collection

假装没事ソ 提交于 2019-11-27 02:31:26

问题


I noticed some very strange behaviour on my smartcards (NXP J2E145, J3A081, J3C145 with an Omnikey 5121 reader): A power loss right after calling JavaCard method

JCSystem.requestObjectDeletion()

can damage the card: after about 10% of such power cuts the ATR command is very slow (1000ms) and I get no response to any other APDUs (applet selection, card manager authentication etc.).

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

Is garbage collecting processed "usually" in a single transaction?

Is there any "official" recommendation NOT to call requestObjectDeletion() in case of a possible power loss?

Do you have any similar experience with cards by NXP?

EDIT:

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

    ATR: 3BFB9600008131FE454F4450204D41502053414D3E

    ATR: T = 1
    jcshell: Unknown problems with terminal. Last terminal error: The request could not be performed because of an I/O device error.


回答1:


I think this may be an implementation bug. In general, garbage collection is never needed nor used on smart cards.

You should avoid Garbage Collection under any circumstances by good applet design. That way you should never run into memory problems. Applets are commonly installed only once in their lifetime and should be usable for the rest of the life-cycle of the card.

Garbage Collection generally takes too long for normal use cases. Maybe that is why the programmer of the Java Card or underlying system libraries didn't expect it to happen outside a secure environment.



来源:https://stackoverflow.com/questions/28147582/javacard-power-loss-during-garbage-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!