On Thu, 2010-09-23 at 16:46 +0300, Martin Paljak wrote: > Hello, > > On Sep 23, 2010, at 1:59 AM, Andre Zepezauer wrote: > > The meaning of max_recv_size is still unknown to me. Could someone > > explain it to me, please. Btw, one of these changes has broken 2048b > > keys for CardOS. It may be caused by the fact, that 2048b keys (and > > corresponding cryptograms) are exactly 256 byte in size. > Ideally, it should not exist, all cards and readers could do with 255/256 as > the maximum Lc/Le values (including 0=256). > > In real life, there are apparently deficiencies in hardware/software, either > smart card reader and driver or the smart card itself. > (I used to have a serial smart card reader that required setting it to 242, > if I remember correctly). > > I don't know if anyone uses it to force values based on the used reader, but > there are also a bunch of cards that limit this because they know the card > can't handle more:
This is an excerpt form a previous post [1] "Number Lr (length of response data) is the number of bytes present in the data field of the response APDU. [...] ***Number Lr shall be in the range zero to number Le.***" In my opinion it means, that the card is always free to send less than Le bytes. Therefore it should be safe to always request Le=sizeof(rbuf) bytes. Checking the actual number of bytes received is required anyway. There could be a reader of cause, which limits the size of transmitted APDUs. But looking at this table [2], I am not sure if this is a problem OpenSC should care about. Maybe Ludovic Rousseau could tell us more about the meaning of these numbers. [1] http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014906.html [2] http://pcsclite.alioth.debian.org/ccid/dwMaxCCIDMessageLength.html _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel