[Pcsclite-muscle] A recent change causes SCardCancel() to block?

Ludovic Rousseau ludovic.rousseau at gmail.com
Thu Jun 15 13:00:41 UTC 2017


2017-06-14 11:43 GMT+02:00 Ran Benita <ran234 at gmail.com>:

> Hello,
>

Hello,


>
> I have noticed a change in behavior in one of the recent pcsclite
> releases. I am using pcsclite 1.8.21 and ccid 1.4.27 on ArchLinux.
>
> The program below calls a blocking SCardGetStatusChange, but before that
> spwans a thread which waits for a key press, then calls SCardCancel (on
> the same context). It is a port of the Rust program here:
> https://raw.githubusercontent.com/bluetech/pcsc-rust/
> 01bd4d80e366ef00f7006dabee45c8cb356d8566/pcsc/examples/cancel.rs
>
> Previously, the SCardCancel would return immediately and would cause
> SCardGetStatusChange to return SCARD_E_CANCELLED immediately.
>
> Now, SCardCancel blocks until SCardGetStatusChange times out, and only
> then returns SCARD_S_SUCCESS.
>
> Is this an intended change, or a regression? Or maybe I'm doing
> something wrong?
>

No. Your sample code is correct.
The bug is in pcsc-lite since 1.8.21 (latest version).
More precisely at this line:
https://github.com/LudovicRousseau/PCSC/commit/9a21c82330fc4b73ac00faf2c5cf948da5f8ab07#diff-320fdf2286b77c3aa12e4f0c174a5ac1L3082

It is now fixed in
https://github.com/LudovicRousseau/PCSC/commit/7a3738d2f8e48c669b0e3f485cb9dcabeffc941a

I will release a new pcsc-lite soon.

Thanks for the bug report.
Bye

-- 
 Dr. Ludovic Rousseau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20170615/066beba8/attachment.html>


More information about the Pcsclite-muscle mailing list