Hello,
On Aug 12, 2010, at 5:23 AM, Nikolay Elenkov wrote:
> I am developing a (proprietary) dynamic card driver (Windows). I have the 
> basics
> setup working, I can load and login. However I am having some troubles with
> locking (transactions). Any advice is much appreciated.

For which card? Why not write an open source driver instead?  Are you writing a 
dynamic basic card driver (it's not ISO7816 or require SM for basic file 
operations as well?) or a PKCS#15 emulation driver?



> It appears that the framework calls pcsc_lock before calling my
> card_select_file/read_binary. That starts a card transaction
> (SCardBeginTransaction) and locks the card, but I would like to avoid that.
> I have my own library for communicating with the card, it does secure 
> messaging
> and what not, so I don't want to re-implement it using OpenSC APIs. At the
> moment I am ending the transaction before calling my own code, but is using
> internal APIs, so probably not a very good idea. I've noticed that if I set
> sc_reader_t.ops.lock/unlock to NULL  I could avoid locking but where should I
> set it? Do I have to implement a reader driver? Or is there a better way to 
> do this?

If you have a proprietary library to work with, maybe you can change it so that 
it would not lock the card itself?
If the library does everything (up to the point of creating transaction) then 
maybe it will not fit nicely at all into the OpenSC framework.

Dynamic drivers are supposed to be used with cards that don't want to "expose" 
their APDU commands and/or file structures. But I don't see why hiding them 
makes it any better either.

If you need a dynamic driver to "hide" the secure messaging keys (?) then maybe 
you can look around in the secure messaging branch [1] for inspiration on how 
to use that with your card.

[1] 
http://www.opensc-project.org/opensc/browser/branches/vtarasov/opensc-sm.trunk

-- 
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