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

[question] problem loading an applet on Yubikey Neo
https://forum.yubico.com/viewtopic.php?f=26&t=1457
Page 1 of 1

Author:  bobo [ Tue Sep 02, 2014 12:42 pm ]
Post subject:  [question] problem loading an applet on Yubikey Neo

Hello,

I tried hard to load an applet on the Yubikey but without success...

Please note that I correctly configured the Yubikey to allow CCID as described here: http://www.yubico.com/2012/12/yubikey-n ... te-device/

I was also able to load/remove some javacard applets from .cap files generated using the JCDK 2.2.2.

However, I cannot load applet generated from the last JCDK 3.0.4.
For example, I was not able to load the 'HelloWorld' applet provided with the JCDK 3.0.4. compiled by oracle (http://www.oracle.com/technetwork/java/ ... 43229.html).

I also tried to build the HelloWorld cap file from sources but without success. I used Netbeans IDE 8.0 with the java card plugin and JCDK 3.0.4 classic edition on Windows 8 . I received the following error using GPJ to load the cap file:

Code:

F:\Dropbox\NetBeansJava\gpj\gpj-20120310>java -jar gpj.jar -load HelloWorld.cap -install
Found terminals: [PC/SC terminal Yubico Yubikey NEO OTP+CCID 0]
Found card in terminal: Yubico Yubikey NEO OTP+CCID 0
ATR: 3B FA 13 00 00 81 31 FE 15 59 75 62 69 6B 65 79 4E 45 4F A6
DEBUG: Command  APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
DEBUG: Response APDU: 6A 82
Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82
DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
DEBUG: Response APDU: 6A 82
Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW: 6A 82
DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
DEBUG: Response APDU: 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65 01 FF 9F 6E 06 47 91 12 10 38 00 73 4A 06 07 2A 86
 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B 02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64 0B 06 09 2A 86 48 86 FC 6B
 04 02 55 65 0B 06 09 2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01 04 01 2A 02 6E 01 02 90 00
Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
DEBUG: Command  APDU: 80 50 00 00 08 FB A5 CA 3F 44 E7 1A 51
DEBUG: Response APDU: 00 00 31 07 00 63 24 96 70 07 FF 02 00 2D 06 0C DF 9A 37 DD 07 B2 86 E1 76 7A DF 9B 90 00
DEBUG: Command  APDU: 84 82 00 00 10 22 47 D6 85 26 F5 AC 9E 7C 0A CE FF 7F C8 DF 01
DEBUG: Response APDU: 90 00
DEBUG: Command  APDU: 84 82 00 00 08 22 47 D6 85 26 F5 AC 9E
DEBUG: Response APDU: 90 00
DEBUG: packagePath: com/sun/jcclassic/samples/helloworld/javacard/
DEBUG: package: com.sun.jcclassic.samples.helloworld
DEBUG: package AID: A0 00 00 00 62 03 01 0C 01
DEBUG: applet AIDs: [A0 00 00 00 62 03 01 0C 01 01 ]
DEBUG: Command  APDU: 80 E6 02 00 16 09 A0 00 00 00 62 03 01 0C 01 08 A0 00 00 00 03 00 00 00 00 00 00
DEBUG: Response APDU: 00 90 00
DEBUG: Command  APDU: 80 E6 02 00 16 09 A0 00 00 00 62 03 01 0C 01 08 A0 00 00 00 03 00 00 00 00 00 00
DEBUG: Response APDU: 00 90 00
DEBUG: Command  APDU: 80 E8 00 00 FF C4 82 01 43 01 00 13 DE CA FF ED 01 02 04 00 01 09 A0 00 00 00 62 03 01 0C 01 02 00
 1F 00 13 00 1F 00 0E 00 15 00 36 00 0C 00 74 00 0A 00 13 00 00 00 6C 00 00 00 00 00 00 02 01 00 04 00 15 02 05 01 07 A0
 00 00 00 62 01 01 00 01 07 A0 00 00 00 62 00 01 03 00 0E 01 0A A0 00 00 00 62 03 01 0C 01 01 00 14 06 00 0C 00 80 03 01
 00 01 07 01 00 00 00 1F 07 00 74 00 02 10 18 8C 00 01 18 11 01 00 90 0B 87 00 18 8B 00 02 7A 02 30 8F 00 03 3D 8C 00 04
 3B 7A 05 23 19 8B 00 05 2D 1A 03 25 61 0A 1A 04 25 10 A4 6B 03 7A 19 8B 00 06 32 03 29 04 1F 65 1B 1A 08 AD 00 16 04 1F
 8D 00 07 3B 16 04 1F 41 29 04 19 08 8B 00 08 32 70 E6 19 8B 00 09 3B 19 16 04 08 41 8B 00 0A 19 03 08 8B 00 0B 19 AD 00
 03 16 04 8B 00 0C 7A 08 00 0A 00 00 00 00 00 00 00 00 00 00 05 00 36 00 0D 02 00
DEBUG: Response APDU: 6A 80
DEBUG: Command  APDU: 80 E8 00 00 FF C4 82 01 43 01 00 13 DE CA FF ED 01 02 04 00 01 09 A0 00 00 00 62 03 01 0C 01 02 00
 1F 00 13 00 1F 00 0E 00 15 00 36 00 0C 00 74 00 0A 00 13 00 00 00 6C 00 00 00 00 00 00 02 01 00 04 00 15 02 05 01 07 A0
 00 00 00 62 01 01 00 01 07 A0 00 00 00 62 00 01 03 00 0E 01 0A A0 00 00 00 62 03 01 0C 01 01 00 14 06 00 0C 00 80 03 01
 00 01 07 01 00 00 00 1F 07 00 74 00 02 10 18 8C 00 01 18 11 01 00 90 0B 87 00 18 8B 00 02 7A 02 30 8F 00 03 3D 8C 00 04
 3B 7A 05 23 19 8B 00 05 2D 1A 03 25 61 0A 1A 04 25 10 A4 6B 03 7A 19 8B 00 06 32 03 29 04 1F 65 1B 1A 08 AD 00 16 04 1F
 8D 00 07 3B 16 04 1F 41 29 04 19 08 8B 00 08 32 70 E6 19 8B 00 09 3B 19 16 04 08 41 8B 00 0A 19 03 08 8B 00 0B 19 AD 00
 03 16 04 8B 00 0C 7A 08 00 0A 00 00 00 00 00 00 00 00 00 00 05 00 36 00 0D 02 00
DEBUG: Response APDU: 6A 80
net.sourceforge.gpj.cardservices.exceptions.GPLoadException: Load failed, SW: 6A 80
        at net.sourceforge.gpj.cardservices.GlobalPlatformService.loadCapFile(Unknown Source)
        at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(Unknown Source)


Any idea on what causes the problem?

Thanks in advance for your help!

Author:  bobo [ Tue Sep 02, 2014 1:03 pm ]
Post subject:  Re: [question] problem loading an applet on Yubikey Neo

For the sake of completeness, I also tried to load the same Helloworld cap file from oracle with GPShell without success:

Code:
F:\Downloads\Progs\GPShell-1.4.4\GPShell-1.4.4>GPShell.exe gpinstall.txt
mode_211
enable_trace
establish_context
card_connect
select -AID a000000003000000
Command --> 00A4040008A000000003000000
Wrapped command --> 00A4040008A000000003000000
Response <-- 6F658408A000000003000000A5599F6501FF9F6E06479112103800734A06072A864886FC6B01600C060A2A864886FC6B02020101630
906072A864886FC6B03640B06092A864886FC6B040255650B06092B8510864864020103660C060A2B060104012A026E01029000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4
e4f
Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864886FC6B03640B06092A864886FC6B040255650B0
6092B8510864864020103660C060A2B060104012A026E01029000
Command --> 805000000832462DBE18310D0F00
Wrapped command --> 805000000832462DBE18310D0F00
Response <-- 00003107006324967007FF02002EDA7D1A9E34DA7C090ABAEC9755139000
Command --> 84820100106727A81A39AA12FB4C8DD264E3EF4B88
Wrapped command --> 84820100106727A81A39AA12FB4C8DD264E3EF4B88
Response <-- 9000
install -file helloworld-sun.cap -instParam 00 -priv 00
Command --> 80E602001C09A00000006203010C0108A0000000030000000006EF04C60201C00000
Wrapped command --> 84E602002409A00000006203010C0108A0000000030000000006EF04C60201C00057B690DAA536FBA700
Response <-- 009000
Command --> 80E80000EFC48201B2010013DECAFFED010204000109A00000006203010C0102001F0013001F000E00150036000C0074000A00130000
006C00000000000002010004001502050107A0000000620101000107A000000062000103000E010AA00000006203010C0101001406000C0080030100
0107010000001F070074000210188C000118110100900B8700188B00027A02308F00033D8C00043B7A0523198B00052D1A0325610A1A042510A46B03
7A198B0006320329041F651B1A08AD0016041F8D00073B16041F41290419088B00083270E6198B00093B19160408418B000A1903088B000B19AD0003
16048B000C7A08000A00
Wrapped command --> 84E80000F7C48201B2010013DECAFFED010204000109A00000006203010C0102001F0013001F000E00150036000C0074000A
00130000006C00000000000002010004001502050107A0000000620101000107A000000062000103000E010AA00000006203010C0101001406000C00
800301000107010000001F070074000210188C000118110100900B8700188B00027A02308F00033D8C00043B7A0523198B00052D1A0325610A1A0425
10A46B037A198B0006320329041F651B1A08AD0016041F8D00073B16041F41290419088B00083270E6198B00093B19160408418B000A1903088B000B
19AD000316048B000C7A08000A009C91E10B50BF7E4B
Response <-- 6A80
load() returns 0x80206A80 (6A80: Wrong data / Incorrect values in command data.)

Author:  Tom [ Tue Sep 02, 2014 2:17 pm ]
Post subject:  Re: [question] problem loading an applet on Yubikey Neo

What serial number is your Yubikey NEO?

http://www.yubico.com/2014/07/yubikey-neo-updates/

Author:  bobo [ Tue Sep 02, 2014 3:30 pm ]
Post subject:  Re: [question] problem loading an applet on Yubikey Neo

hello,

The serial number on my Yubikey is 2276188 (thus below 3000000).
I don't think the problem is related to the card manager keys, since I am able to load/delete some applets built with JCDK 2.2.2

As far as I know, the applets sources provided by Yubikey (eg. ykneo-openpgp, ykneo-oath) are all built using the 'old' JCDK 2.2.2.
The problem comes when I try to load applets build with JCDK 3.0.4.

Is there a specific guide for building cap file with JCDK 3.0.4 (similar to https://github.com/Yubico/ykneo-openpgp ... ilding.txt for jcdk-2.2.2)?

Currently, I use Netbeans 8.0 IDE with the Javacard plugin made by Tim Boudreau and the JCDK 3.0.4 on Windows 8 (https://netbeans.org/kb/docs/javame/java-card.html). The cap file is generated without error but I cannot load it on the Yubikey.

Author:  Tom [ Wed Sep 03, 2014 8:39 am ]
Post subject:  Re: [question] problem loading an applet on Yubikey Neo

Here, in the lab I have success with a 3.0.1 unfortunately I don't know about 3.0.4

Will check.

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