On Mon, Sep 19, 2011 at 6:14 PM, Iuri Diniz <iuridi...@gmail.com> wrote:

> I've found that ct_card_lock is returning -7 (IFD_ERROR_LOCKED) for the
> second card 'CT_init (ctn=1, pn=0)'
> while is returning IFD_SUCCESS for the first one 'CT_init (ctn=0, pn=0)'
> (why?)
>

I've found the error :D and I did a dummy patch.

if in the second call (for second reader) pn is 1 'CT_init (ctn=1, pn=1)',
everything goes fine.

I've setted a breakpoint at CT_init and in the second call, I manually
setted pn to 1,

Someone could explain the reason of

pn = ((Channel == 0) ? 0 : Channel - 1)

at pcsc.c:94 (IFDHCreateChannel) ?

I have changed it to:
pn = Channel;


-- 
Iuri Diniz
http://iuridiniz.com [Sou um agitador, não um advogado]
http://blog.igdium.com [Linux on Limbo]
--- src/pcsc/pcsc.c.orig	2011-09-20 14:24:45.931648375 -0300
+++ src/pcsc/pcsc.c	2011-09-20 14:25:45.484880596 -0300
@@ -91,7 +91,7 @@
 		if (Channel > IFDH_MAX_READERS) {
 			pn = 0;
 		} else {
-			pn = ((Channel == 0) ? 0 : Channel - 1);
+			pn = Channel;
 		}
 		ret = CT_init(ctn, pn);
 
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to