-2

I downloaded FluffyPGP Applet from http://javacardos.com/javacardforum/viewtopic.php?f=35&t=26&sid, and I tried the incoming APDU commands of the putKey() function, but it failed. If my incoming APDU satisfies this 'If', but others will be not satisfied.

Is there a bug in this function?

vojta
  • 5,591
  • 2
  • 24
  • 64
TeddyBear
  • 112
  • 4
  • "If my incoming APDU satisfies this 'If', but others will be not satisfied." - I do not understand this sentence. Could you please add some more details? What have you tried so far? What error messages did you get? Nobody will be able to help you without this extra information. – vojta Dec 11 '15 at 07:08
  • I send "10DB3FFF234D82039FB600007F48159100928180938180948180958180968180978201005F48820380" It will throw exception in this codes: "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: "KeyPair key = getKey(commandChainingBuffer[TEMP_PUT_KEY_KEY_TYPE]);" And I do not know how to do? – TeddyBear Dec 11 '15 at 10:27
  • I [edited your question](http://stackoverflow.com/review/suggested-edits/10531200), please could you verify the text and confirm the links to the applet source code? – vlp Dec 11 '15 at 22:16

1 Answers1

0

Not proficient with FluffyPGP applet and GPG Card v2.0.1 specification, but reading the sources my bet is the command APDU should be (did not try):

10DB3FFF234D82039FB6007F481591XX928180938180948180958180968180978201005F4882038‌0
                              EE .. public exponent length (put your length here)
                  TT .. key type = 0xB6

But it only initiates the chaining, you really should study the API specification, probably the section 4.3.3.7.

Good luck!

vlp
  • 7,811
  • 2
  • 23
  • 51