On Wed, 1 Aug 2007 16:06, [EMAIL PROTECTED] said: > the OpenPGP card specification on Java card. It is avaible from > sourceforge at http://sourceforge.net/projects/jopenpgpcard/. Feel free to
Cool. > and gnupg. I does not support key sizes above 1536 bits. You may have to > apply a patch to gnupg apdu.c implementing support for "SW_EXACT_LENGTH" BTW, we already have such a thing at a higher level. Anyway, I just added a similar patch to apdu.c (SVN trunk): --- apdu.c (revision 4543) +++ apdu.c (working copy) @@ -2648,6 +2649,7 @@ assert (sizeof (apdu) >= apdulen); /* As safeguard don't pass any garbage from the stack to the driver. */ memset (apdu+apdulen, 0, sizeof (apdu) - apdulen); + exact_length_hack: resultlen = RESULTLEN; rc = send_apdu (slot, apdu, apdulen, result, &resultlen, pininfo); if (rc || resultlen < 2) @@ -2658,7 +2660,14 @@ return rc? rc : SW_HOST_INCOMPLETE_CARD_RESPONSE; } sw = (result[resultlen-2] << 8) | result[resultlen-1]; - /* store away the returned data but strip the statusword. */ + if (!did_exact_length_hack && SW_EXACT_LENGTH_P (sw)) + { + apdu[apdulen-1] = (sw & 0x00ff); + did_exact_length_hack = 1; + goto exact_length_hack; + } + + /* Store away the returned data but strip the statusword. */ resultlen -= 2; if (DBG_CARD_IO) { Shalom-Salam, Werner _______________________________________________ Gnupg-users mailing list Gnupg-users@gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-users