Discussion:
[strongSwan-dev] PKCS#11 provider and WaitForSlotEvent
Klaus Richter
2017-09-09 15:21:41 UTC
Permalink
Hi,

we are using the Atos middleware for CardOS 5.x cards on Linux (pcsc-lite 1.8.22), and the p11 library gets stuck at cleanup. They set a mutex for WaitForSlotEvent which allegedly is not cleaned up when the thread is canceled.

Is there any way to "properly" cancel the call before the thread is removed? Is this just a bug on their side (I'm not sure what the specification says about this)? Have you had similar behavior with other middleware?

If they are unable to fix it, the only workaround I see is to not handle slot events, at all. Which isn't a good idea.

Kind regards,
Klaus
Klaus Richter
2017-09-24 10:10:23 UTC
Permalink
Hi,

any comments on this?

If I kill charon-cmd when the library gets stuck, it sometimes hangs pcscd. So this isn't a proper workaround, either.

Kind regards,
Klaus
Post by Klaus Richter
Hi,
we are using the Atos middleware for CardOS 5.x cards on Linux (pcsc-lite 1.8.22), and the p11 library gets stuck at cleanup. They set a mutex for WaitForSlotEvent which allegedly is not cleaned up when the thread is canceled.
Is there any way to "properly" cancel the call before the thread is removed? Is this just a bug on their side (I'm not sure what the specification says about this)? Have you had similar behavior with other middleware?
If they are unable to fix it, the only workaround I see is to not handle slot events, at all. Which isn't a good idea.
Kind regards,
Klaus
Luka Logar
2017-09-25 18:00:45 UTC
Permalink
Hi Klaus,

See my comment (and patch) here:
https://github.com/LudovicRousseau/PCSC/commit/7a3738d2f8e48c669b0e3f485cb9dcabeffc941a

Kind regards
Luk
Klaus Richter
2017-09-27 11:18:13 UTC
Permalink
Hi Luk,

thanks, I tried your patch but it doesn't help in my case. Note, that it only occurs with the Atos library, not with opensc-pkcs11.so.

Kind regards,
Klaus
Post by Luka Logar
Hi Klaus,
https://github.com/LudovicRousseau/PCSC/commit/7a3738d2f8e48c669b0e3f485cb9dcabeffc941a
Loading...