[pkg-opensc-commit] [opensc] 125/295: Restore blocking WaitForSlotEvent functionality for recent PCSC-Lite versions
Eric Dorland
eric at moszumanska.debian.org
Sat Jun 24 21:11:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository opensc.
commit 3cb24ebc79eb6b88c0238177a17d86a34c18d0cf
Author: Jakub Jelen <jjelen at redhat.com>
Date: Thu Nov 10 16:29:47 2016 +0100
Restore blocking WaitForSlotEvent functionality for recent PCSC-Lite versions
* Add configure-time dependency on pcsclite (required version from comments in reader-pcsc.c)
* The functionality is already supported in PCSC-Lite
* For older PCSC-Lite versions still return CKR_FUNCTION_NOT_SUPPORTED
# closes #899
---
configure.ac | 5 ++++-
src/pkcs11/pkcs11-global.c | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 75cf031..b12390c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -583,7 +583,10 @@ if test "${enable_pcsc}" = "yes"; then
if test "${WIN32}" != "yes"; then
PKG_CHECK_EXISTS(
[libpcsclite],
- [PKG_CHECK_MODULES([PCSC], [libpcsclite])]
+ [PKG_CHECK_MODULES([PCSC], [libpcsclite >= 1.6.5],
+ [AC_DEFINE([PCSCLITE_GOOD], [1], [Sufficient version of PCSC-Lite with all the required features])],
+ [:]
+ )]
)
if test -z "${PCSC_CFLAGS}"; then
case "${host}" in
diff --git a/src/pkcs11/pkcs11-global.c b/src/pkcs11/pkcs11-global.c
index 2571cc7..9af60e3 100644
--- a/src/pkcs11/pkcs11-global.c
+++ b/src/pkcs11/pkcs11-global.c
@@ -641,10 +641,11 @@ CK_RV C_WaitForSlotEvent(CK_FLAGS flags, /* blocking/nonblocking flag */
return CKR_ARGUMENTS_BAD;
sc_log(context, "C_WaitForSlotEvent(block=%d)", !(flags & CKF_DONT_BLOCK));
+#ifndef PCSCLITE_GOOD
/* Not all pcsc-lite versions implement consistently used functions as they are */
- /* FIXME: add proper checking into build to check correct pcsc-lite version for SCardStatusChange/SCardCancel */
if (!(flags & CKF_DONT_BLOCK))
return CKR_FUNCTION_NOT_SUPPORTED;
+#endif /* PCSCLITE_GOOD */
rv = sc_pkcs11_lock();
if (rv != CKR_OK)
return rv;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git
More information about the pkg-opensc-commit
mailing list