Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

In FluffyPGP Applet, is the putKey() function codes exist a BUG?

Open source implementation of the OpenPGP smart card version 2.0 on a java card.

Moderator: Ellisun

TeddyBear
Posts: 2
Joined: Fri Dec 11, 2015 6:42 am
Points: 0
Contact:

In FluffyPGP Applet, is the putKey() function codes exist a BUG?

Postby TeddyBear » Fri Dec 11, 2015 6:45 am

I tried the incoming APDU commands of the putKey() function, but it failed. If my incoming APDU satisfies this 'If' , but other "If" sentence will be not satisfied.
such as:

I send "10DB3FFF244D82039FB600007F48159100928180938180948180958180968180978201005F48820380" It will throw exception in this codes:

Code: Select all

"if (Util.arrayCompare(buffer, ISO7816.OFFSET_CDATA, expectedRSAKeyImportFormat, (short) 0,
                            (short) expectedRSAKeyImportFormat.length) != 0) {
        ISOException.throwIt(ISO7816.SW_DATA_INVALID);
      }"


But If I send "10DB3FFF234D82039F00007F48159100928180938180948180958180968180978201005F48820380" It will occurre error in here:

Code: Select all

"KeyPair key = getKey(commandChainingBuffer[TEMP_PUT_KEY_KEY_TYPE]);"

And I do not know how to do?

User avatar
UNKNwYSHSA
Posts: 628
Joined: Thu May 21, 2015 4:05 am
Points: 2979
Contact:

Re: In FluffyPGP Applet, is the putKey() function codes exist a BUG?

Postby UNKNwYSHSA » Mon Dec 14, 2015 4:59 am

The format data must change 2 bytes:
1 key_type (format_offset + 4);
2 eLength (format_offset + 10);
And from the source code, 3 the short value at (offset + 2) and (offset + 33) shall plus eLength;

So the "first command" is:
"10DB3FFF 23 4D8203A2A4(B6/B8)007F48159103928180938180948180958180968180978201005F48820383"
1 039F + 3 => 03A2;
2 key type: A4/B6/B8;
3 eLength: 03;
4 0380 + 3 => 0383;
You can try.
sense and simplicity

TeddyBear
Posts: 2
Joined: Fri Dec 11, 2015 6:42 am
Points: 0
Contact:

Re: In FluffyPGP Applet, is the putKey() function codes exist a BUG?

Postby TeddyBear » Tue Dec 15, 2015 5:15 am

thanks, I will try it, if I have other question, can I ask you again? :D

User avatar
UNKNwYSHSA
Posts: 628
Joined: Thu May 21, 2015 4:05 am
Points: 2979
Contact:

Re: In FluffyPGP Applet, is the putKey() function codes exist a BUG?

Postby UNKNwYSHSA » Tue Dec 15, 2015 6:02 am

Yes, it is my pleasure. :lol:
sense and simplicity


Return to “FluffyPGPApplet”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer