Hi, No problem, I only tested PIV "read-only" which works, I didn't see the assert()'s in iso7816_write/update_binary(), though I can't see why they are there? (can't find anything in 7816-4 about that?). Also, the problem with the current code is that the chaining size is hard-coded to 255 (which is of course working with PIV, but not with some other cards :-).
I'll look into the specs a bit more and propose a new patch. Cheers, /Mats On 12/18/09 5:00 PM, "Andreas Jellinghaus" <a...@dungeon.inka.de> wrote: ok, so the change fixes one card and breaks another. lets get back to this issue next year, once we are all back from vacation. merry xmas and happy new years :) Regards, Andreas Am Freitag 18 Dezember 2009 16:53:51 schrieb Douglas E. Engert: > This patch may break the PIV card, because it changed the > line 1792: card->max_send_size = 0xffff; > > > The PIV card does not directly support read/write binary, > but get/put_data commands which transfer the whole object > using adpu chaining using 255 and 256. Its not using extended > apdu either. > > To emulate the read/write binary it sets the card_max_* sizes > to 0xffff to allow the caller to read/write the whole object > rather then 255 byte chunks or records. > > So the max_*_size values are used in two different ways, > for read/write and for apdu lengths. > > Since there is no "close" command there is no way to know when > the last write_binary is done. Using the 0xffff a write is done > all in one operation. > > The attached patch might work, would would needs to be tested. > (I am on vacation starting today till after the first, so this > is not a good time to make a change.) > > The piv_general_io routine that does the sc_transmit_apdu > is also used for a number of other operations, so a lot of testing > will be needed. Scanned by Check Point Total Security Gateway.
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel