Hello,
On Sep 13, 2010, at 12:19 AM, Peter Koch wrote:
> tcos_init() does NOT set card->max_recv_size and therefore
> some default value (i.e. 256) was used.
> 
> With current svn this does not work anymore. sc_read_binary()
> checks wether count > card->max_recv_size and then tries
> to read count bytes in chunks of card->max_recv_size.
> If card->max_recv_size is 0 this fails.
> 
> Should I set card->max_recv_size and card->max_send_size
> in tcos_init()?
No. Sorry, this place was erroneously  left untouched and is fixed in SVN 
trunk. Please verify that it works as expected.

max_recv/send_size in both a reader driver and card driver should only be used 
instead of defaults (255/256) if they are set (>0), not magically propagated 
from a default reader limit to a reader limit to a  default card limit to a 
limited card limit.

In fact, as the driver->max_recv/send_ size is not used by reader drivers 
themselves, I don't think it makes sense to keep them as reader driver options. 
Instead, they should be moved to "default" options set. Especially as there is 
only a single reader driver enabled at a time now.


> This will fix the problem with TCOS-cards but there are other
> drivers that do NOT set max_recv_size (i.e. card-cardos.c)

No card driver should set it unless it can't handle 255/256 for Lc/Le, and the 
list of drivers that do this are:

card-acos5.c
card-akis.c
card-atrust-acos.c
card-entersafe.c
card-gpk.c
card-miocos.c
card-myeid.c
card-piv.c
card-starcos.c
card-westcos.c

-- 
Martin Paljak
@martinpaljak.net
+3725156495

_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to