On Mon, 2011-02-07 at 16:00 -0600, Douglas E. Engert wrote:
> >> Attached is a patch that implements a sc_ctx_use_reader, to pass in two 
> >> void
> >> pointers to an underling driver. The code to use this from cardmod.c to the
> >> cardmod code in reader-pcsc.c (or where ever it ends up) will be added as 
> >> part
> >> of a much larger patch.
> >>
> >> The intent is to keep this sc_ctx_use_reader patch simple and small so it
> >> can be committed soon.
> >
> > The essence of both proposals side-by-sideĀ¹:
> 
> Actually not.
> 
> The use_reader version can be called multiple times to change the handles
> as this  is one of the major issues I found with the way the BaseCSP calls
> the cardmod. The cardmod.c can then call sc_ctx_use_reader just after
> the call to sc_context_create, and can call it later if the BaseCSP
> provides different handles.

Why not calling sc_context_create() for every pair of "hSCardCtx,hSCard"
the cardmod is unaware of? From a context created in that way a new
p15card can be instantiated. And that would let to a nice one-to-one
mapping between "hSCardCtx,hSCard" and p15cards.

>From a pair of "hSCardCtx,hSCard" (provided with every call) you can
then easily lookup the right p15card. And everything else goes as usual.

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

Reply via email to