The exclusive promotional activities on JCOP J3H145 card and Feitian R301 Smartcard Reader are in full swing. Please check this page for details.

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?

Post by 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: 630
Joined: Thu May 21, 2015 4:05 am
Points :3031
Contact:

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

Post by 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?

Post by 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: 630
Joined: Thu May 21, 2015 4:05 am
Points :3031
Contact:

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

Post by UNKNwYSHSA » Tue Dec 15, 2015 6:02 am

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

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer