OpenSC for EID Latvia

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OpenSC for EID Latvia

Juris Kaminskis
Hello,

I have built this OpenSC fork :


but I get following error when I do following with the card attached:

root@station:/home/juris # opensc-tool -a
Using reader with a card: SCM Microsystems Inc. SCR 3310 (21120702367313) 00 00
3b:dd:18:00:81:31:fe:45:90:4c:41:54:56:49:41:2d:65:49:44:90:00:8c
Assertion failed: (card->lock_count == 0), function sc_disconnect_card, file card.c, line 256.
Abort (core dumped)


Do you possibly know why it fails?

thanks
Juris

------------------------------------------------------------------------------

_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenSC for EID Latvia

Juris Kaminskis

2014-04-05 21:47 GMT+03:00 Juris Kaminskis <[hidden email]>:
Hello,

I have built this OpenSC fork :


but I get following error when I do following with the card attached:

root@station:/home/juris # opensc-tool -a
Using reader with a card: SCM Microsystems Inc. SCR 3310 (21120702367313) 00 00
3b:dd:18:00:81:31:fe:45:90:4c:41:54:56:49:41:2d:65:49:44:90:00:8c
Assertion failed: (card->lock_count == 0), function sc_disconnect_card, file card.c, line 256.
Abort (core dumped)


I was misled by error message, OpenSC version is not working for my card:

 # opensc-tool --list-driver
Configured card drivers:
  iasecc           IAS-ECC
  default          Default driver for unknown cards

and when I use driver iasecc I get following:

 # opensc-tool -c iasecc --serial
Using reader with a card: SCM Microsystems Inc. SCR 3310 (21120702367313) 00 00
Failed to connect to card: Card does not support the requested operation

How can I troubleshoot why the card is not working?
 

------------------------------------------------------------------------------

_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: OpenSC for EID Latvia

Martin Paljak-4
In reply to this post by Juris Kaminskis
On Sat, Apr 5, 2014 at 7:47 PM, Juris Kaminskis
<[hidden email]> wrote:

> root@station:/home/juris # opensc-tool -a
> Using reader with a card: SCM Microsystems Inc. SCR 3310 (21120702367313) 00
> 00
> 3b:dd:18:00:81:31:fe:45:90:4c:41:54:56:49:41:2d:65:49:44:90:00:8c
> Assertion failed: (card->lock_count == 0), function sc_disconnect_card, file
> card.c, line 256.
> Abort (core dumped)
>
>
> Do you possibly know why it fails?

Because the code is buggy and does not use equal amount of sc_unlock()
calls as it does sc_lock() calls.

Look at the diff of stock OpenSC vs the changed code to see if it adds
sc_lock() calls. I suspect some piece of code dealing with error
situations does not free the resource accordingly. This is a nice
example why assert-s are nice and apparently the code they release is
compiled with asserts off ?

Martin

--
Martin
+372 515 6495

------------------------------------------------------------------------------
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel