Yubico Forum
https://forum.yubico.com/

[SOLVED] What tools do you use for debugging Neo applets?
https://forum.yubico.com/viewtopic.php?f=26&t=1325
Page 1 of 1

Author:  hiviah [ Mon Feb 24, 2014 5:57 pm ]
Post subject:  [SOLVED] What tools do you use for debugging Neo applets?

Hi,

I already have complete toolchain with JCKit, ant, Eclipse + eclipse-jcde, gpshell that allows me to build and upload an applet such as OpenPGP to the Yubikey.

I was wondering if you use any tools for simulation/debugging before the applet is put on the card. So far I've seen three tools - jcardsim, CREF and JCWDE. I'm not sure though if any of these can be used not just as simulators, but to debug as well (e.g. set breakpoints, inspect variables).

I've seen several mentions of Eclipse JCOP tools on this forum, but haven't found where to get them (all links I googled seem to be outdated or gone).

Author:  martinpaljak [ Mon Feb 24, 2014 8:27 pm ]
Post subject:  Re: [QUESTION] What tools do you use for debugging Neo apple

hiviah wrote:
Hi,

I already have complete toolchain with JCKit, ant, Eclipse + eclipse-jcde, gpshell that allows me to build and upload an applet such as OpenPGP to the Yubikey.

I was wondering if you use any tools for simulation/debugging before the applet is put on the card. So far I've seen three tools - jcardsim, CREF and JCWDE. I'm not sure though if any of these can be used not just as simulators, but to debug as well (e.g. set breakpoints, inspect variables).

I've seen several mentions of Eclipse JCOP tools on this forum, but haven't found where to get them (all links I googled seem to be outdated or gone).



Shameless plug: I believe the easiest tool for working with applets from command line on any JavaCard (including NEO) is my GlobalPlatform tool:

https://github.com/martinpaljak/GlobalP ... om-openkms

No need for scripts or specifying cryptic hex constants all over the place unless you have to. Simple command line options that should do the trick 99% of the time.

For debugging applets I think jcardsim might have the best chance of becoming something useful. I have my own "mock javacard classes" that allow to run unit tests. You might get "debugger cards" from some vendor with a 500€ SDK as well.

Author:  hiviah [ Tue Feb 25, 2014 2:42 pm ]
Post subject:  Re: [QUESTION] What tools do you use for debugging Neo apple

Thanks for the tip, Martin.

Do you perhaps also know if jsimcard could simulate they Neo button keypress? I've found that the button state should be accessible from applet, but requires JCOP tools - that's why I asked how to get them. Actually I just noticed it was coincidentally you who asked the linked Neo button question.

Author:  martinpaljak [ Tue Feb 25, 2014 2:48 pm ]
Post subject:  Re: [QUESTION] What tools do you use for debugging Neo apple

hiviah wrote:
Thanks for the tip, Martin.

Do you perhaps also know if jsimcard could simulate they Neo button keypress? I've found that the button state should be accessible from applet, but requires JCOP tools - that's why I asked how to get them. Actually I just noticed it was coincidentally you who asked the linked Neo button question.


You need a NDA with NXP as well I suspect. JCOP tools itself is not the point, it is just a toolkit (but I don't know as I don't have JCOP tools). You could emulate a full-blown 102 key keyboard, but that is not the point either, the final hardware/firmware matters.

Author:  hiviah [ Tue Feb 25, 2014 6:08 pm ]
Post subject:  Re: [QUESTION] What tools do you use for debugging Neo apple

Quote:
You need a NDA with NXP as well I suspect.

Do I understand it right that if I want to use detecting the button state from applet on an actual Yubikey, I need NDA? Does is require some proprietary code from NXP to be used in my applet?

EDIT: seems that way - NDA is required for the button.

Author:  martinpaljak [ Tue Mar 04, 2014 2:23 am ]
Post subject:  Re: [QUESTION] What tools do you use for debugging Neo apple

hiviah wrote:
Thanks for the tip, Martin.

Do you perhaps also know if jsimcard could simulate they Neo button keypress? I've found that the button state should be accessible from applet, but requires JCOP tools - that's why I asked how to get them. Actually I just noticed it was coincidentally you who asked the linked Neo button question.


Not really related, but after looking at the jcardsim code I decided it is not fit for my purposes and made my own emulator:

https://github.com/martinpaljak/vJCRE#i ... avacardvre

It is still a bit raw and doesn't implement many algorithms, but the javacard*.* codebase is complete, from covering all basic API-s up to JC3.0.4. So once I get to releasing a JAR file it can easily be used inside an IDE instead of the api.jar. Right now only RSA is implemented, but that is due to change ASAP.

The main motivator for this is the ability to run on Android, which I'll add later this week.
Talking about the button - I could easily add whatever extensions to the emulator, but I don't know what purposes this would serve. It would only matter if you would actually have a device where the emulated API would *do* something.

Nevertheless, as I want to use some weirdo integration with Android, I'll be experimenting with extending the API in a "meaningful and portable way" so maybe providing something for "external keyboard" as wel.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/