Hello community,

here is the log from the commit of package pcsc-lite for openSUSE:Factory 
checked in at 2012-04-02 10:39:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pcsc-lite (Old)
 and      /work/SRC/openSUSE:Factory/.pcsc-lite.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pcsc-lite", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/pcsc-lite/pcsc-lite.changes      2012-02-14 
11:25:32.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.pcsc-lite.new/pcsc-lite.changes 2012-04-02 
10:39:30.000000000 +0200
@@ -1,0 +2,15 @@
+Fri Mar 30 17:54:49 UTC 2012 - [email protected]
+
+- Updated to version 1.8.3
+  * ignore directories and hidden (.*) files when parsing a
+    configuration directory (like /etc/reader.conf.d/)
+  * fix a bug in PC/SC spy tool when loading of the real library
+    fails
+  * add
+      PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize,
+      PCSCv2_PART10_PROPERTY_wIdVendor,
+      PCSCv2_PART10_PROPERTY_wIdProduct
+    from PC/SC v2 part 10 release 2.02.09
+  * Some other minor improvements and bug corrections
+
+-------------------------------------------------------------------

Old:
----
  pcsc-lite-1.8.2.tar.bz2

New:
----
  pcsc-lite-1.8.3.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pcsc-lite.spec ++++++
--- /var/tmp/diff_new_pack.oNS3dr/_old  2012-04-02 10:39:34.000000000 +0200
+++ /var/tmp/diff_new_pack.oNS3dr/_new  2012-04-02 10:39:34.000000000 +0200
@@ -15,6 +15,7 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           pcsc-lite
 # FIXME: Maybe we should use /usr/lib/pcsc/drivers as others do:
 %define ifddir %{_libdir}/readers
@@ -32,7 +33,7 @@
 BuildRequires:  systemd
 %{?systemd_requires}
 %endif
-Version:        1.8.2
+Version:        1.8.3
 Release:        0
 Requires(pre):  pwdutils
 Url:            http://pcsclite.alioth.debian.org/
@@ -111,9 +112,9 @@
 License:        BSD-3-Clause ; GPL-3.0+
 Group:          Development/Libraries/C and C++
 Requires:       %{name} = %{version}-%{release}
+Requires:       glibc-devel
 Requires:       libpcsclite1 = %{version}-%{release}
 Requires:       libpcscspy0 = %{version}-%{release}
-Requires:       glibc-devel
 
 %description devel
 This package contains the development files for pcsc-lite. It allows to

++++++ pcsc-lite-1.8.2.tar.bz2 -> pcsc-lite-1.8.3.tar.bz2 ++++++
++++ 2575 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/ChangeLog new/pcsc-lite-1.8.3/ChangeLog
--- old/pcsc-lite-1.8.2/ChangeLog       2012-01-18 16:48:40.000000000 +0100
+++ new/pcsc-lite-1.8.3/ChangeLog       2012-03-30 14:11:48.000000000 +0200
@@ -1,3 +1,15 @@
+pcsc-lite-1.8.3: Ludovic Rousseau
+30 March 2012
+- ignore directories and hidden (.*) files when parsing a configuration
+  directory (like /etc/reader.conf.d/)
+- add Mac OS X for PC/SC spy tool
+- fix a bug in PC/SC spy tool when loading of the real library fails
+- add PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize,
+  PCSCv2_PART10_PROPERTY_wIdVendor and PCSCv2_PART10_PROPERTY_wIdProduct
+  from PC/SC v2 part 10 release 2.02.09 (not yet published)
+- Some other minor improvements and bug corrections
+
+
 pcsc-lite-1.8.2: Ludovic Rousseau
 18 January 2012
 - rename pcsc-spy.py to pcsc-spy and install it as a normal binary (in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/ChangeLog.svn new/pcsc-lite-1.8.3/ChangeLog.svn
--- old/pcsc-lite-1.8.2/ChangeLog.svn   2012-01-18 16:49:59.000000000 +0100
+++ new/pcsc-lite-1.8.3/ChangeLog.svn   2012-03-30 14:15:56.000000000 +0200
@@ -1,3 +1,131 @@
+2012-03-30  Ludovic Rousseau
+
+       * [r6253] ChangeLog, configure.in: Release 1.8.3
+
+2012-03-25  Ludovic Rousseau
+
+       * [r6249] UnitaryTests/FEATURE_CCID_ESC_COMMAND.py: This file is
+         now more or less a duplicate of
+         FEATURE_CCID_ESC_COMMAND_Xiring.py
+         
+         So remove it.
+       * [r6248] UnitaryTests/FEATURE_CCID_ESC_COMMAND_Xiring.py: Add
+         GET_SN command and some documentation
+
+2012-03-24  Ludovic Rousseau
+
+       * [r6247] UnitaryTests/FEATURE_CCID_ESC_COMMAND_Xiring.py: Unitary
+         test for FEATURE_CCID_ESC_COMMAND and Xiring Leo readers
+       * [r6246] UnitaryTests/FEATURE_CCID_ESC_COMMAND2.py,
+         UnitaryTests/FEATURE_CCID_ESC_COMMAND_Gemalto_features.py: Rename
+         FEATURE_CCID_ESC_COMMAND2.py in
+         FEATURE_CCID_ESC_COMMAND_Gemalto_features.p
+
+2012-03-23  Ludovic Rousseau
+
+       * [r6244] UnitaryTests/control_get_firmware.py: Use
+         getTlvProperties() and PCSCv2_PART10_PROPERTY_wIdVendor
+         
+         We now check the reader is a Gemalto one before sending an escape
+         code
+
+2012-03-20  Ludovic Rousseau
+
+       * [r6241] src/PCSC/reader.h: Add new properties for
+         FEATURE_GET_TLV_PROPERTIES
+         
+         dwMaxAPDUDataSize, wIdVendor and wIdProduct are/will be defined
+         in PCSC v2 part 10 release 2.02.09
+
+2012-02-28  Ludovic Rousseau
+
+       * [r6236] src/spy/pcsc-spy: _SCardControl(): parse the received
+         buffer only on success
+         
+         The received buffer (answer) is valid only if the command
+         execution succeeded.
+       * [r6235] src/spy/pcsc-spy: Add support of SCardControl132 for OS X
+       * [r6234] src/spy/libpcscspy.c: Fix compiler warning on OS X
+         
+         libpcscspy.c:580: warning: no previous prototype for
+         'SCardControl132'
+
+2012-02-21  Ludovic Rousseau
+
+       * [r6229] src/debuglog.c: log_xxd(): do not log with negative
+         length
+         
+         Thanks to Godfrey Chung for the bug report
+         http://archives.neohapsis.com/archives/dev/muscle/2012-q1/0043.html
+
+2012-02-04  Ludovic Rousseau
+
+       * [r6215] src/configfile.l: Skip non regular or "hidden" config
+         files
+         
+         Closes Debian bug #658322 "pcscd: fails to start if config
+         directory contains subdirectories"
+
+2012-01-24  Ludovic Rousseau
+
+       * [r6201] src/spy/pcsc-spy.pod: Document usage on Mac OS X
+       * [r6200] src/spy/libpcscspy.c: Mac OS X uses SCardControl132
+         instead of SCardControl
+         
+         On Mac OS X SCardControl() is used for the old version of the API
+         (without the dwControlCode) and SCardControl132() for the new
+         API.
+         
+         From /System/Library/Frameworks/PCSC.framework/Headers/winscard.h
+         /* To support the newer version of SCardControl, we define it as
+         follows. The old version number was 1.1.2, the new call appears
+         in 1.3.2 of pcsc-lite (or perhaps earlier). */
+         
+         #if !defined(USE_SCARD_CONTROL_112) #define SCardControl
+         SCardControl132 #endif /* USE_SCARD_CONTROL_112 */
+       * [r6199] src/spy/Makefile.am: Generate a Mac OS X PCSC.framework
+         hierarchy
+         
+         Mac OS X uses a framework and not just a library. The hiearchy is
+         simple: PCSC.framework PCSC.framework/PCSC ->
+         Versions/Current/PCS PCSC.framework/Versions
+         PCSC.framework/Versions/A PCSC.framework/Versions/A/PCSC
+         PCSC.framework/Versions/Current -> A
+       * [r6198] src/spy/libpcscspy.c: Add Mac OS X support
+       * [r6197] src/spy/libpcscspy.c: Use ULONG * instead of unsigned
+         long *
+         
+         See comment in revision 6195
+       * [r6196] src/spy/libpcscspy.c: Reformat
+       * [r6195] src/spy/libpcscspy.c: Use LONG/ULONG instead of
+         long/unsigned long
+         
+         The problem is that PCSC on Mac OS X do not use long but
+         uint32_t. So a (LONG * or LPDWORD *) parameter (like pcchReaders
+         in SCardListReaders) is not the same on Linux and Mac OS X for
+         64-bits CPUs.
+         
+         LONG is correctly defined on both Linux and Mac OS X so we use it
+         instead.
+       * [r6194] src/spy/libpcscspy.c: load_lib(): check dlsym() return
+         correct values
+         
+         If the pointer returned by dlsym("SCardEstablishContext") is our
+         own SCardEstablishContext() function then we will finish in a
+         endless recursion. Something went wrong and we stop immediatly
+         instead of crashing when the call stack is full.
+       * [r6193] src/spy/libpcscspy.c: Use an internal
+         pcsc_stringify_error() by default
+         
+         If the loading of the PCSC library fails all the functions are
+         set to use internal_error(). The only expection is now
+         pcsc_stringify_error() because the return value is not a LONG
+         error code but a C-string.
+         
+         This change fixes a crash when the application called printf() to
+         display the "string" returned by pcsc_stringify_error() if
+         SCardEstablishContext() failed in the spying library.
+
 2012-01-18  Ludovic Rousseau
 
        * [r6185] ChangeLog, configure.in: Release 1.8.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/configure.in new/pcsc-lite-1.8.3/configure.in
--- old/pcsc-lite-1.8.2/configure.in    2012-01-18 16:48:40.000000000 +0100
+++ new/pcsc-lite-1.8.3/configure.in    2012-03-30 14:11:48.000000000 +0200
@@ -3,7 +3,7 @@
 
 AC_PREREQ(2.58)
 
-AC_INIT(pcsc-lite, 1.8.2)
+AC_INIT(pcsc-lite, 1.8.3)
 AC_CONFIG_SRCDIR(src/pcscdaemon.c)
 AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip)
 AM_CONFIG_HEADER(config.h)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/PCSC/pcsclite.h new/pcsc-lite-1.8.3/src/PCSC/pcsclite.h
--- old/pcsc-lite-1.8.2/src/PCSC/pcsclite.h     2012-01-18 16:49:19.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/PCSC/pcsclite.h     2012-03-30 14:12:02.000000000 
+0200
@@ -190,7 +190,7 @@
 #define INFINITE                       0xFFFFFFFF      /**< Infinite timeout */
 #endif
 
-#define PCSCLITE_VERSION_NUMBER                "1.8.2" /**< Current version */
+#define PCSCLITE_VERSION_NUMBER                "1.8.3" /**< Current version */
 /** Maximum readers context (a slot is count as a reader) */
 #define PCSCLITE_MAX_READERS_CONTEXTS                  16
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/PCSC/reader.h new/pcsc-lite-1.8.3/src/PCSC/reader.h
--- old/pcsc-lite-1.8.2/src/PCSC/reader.h       2011-11-19 16:10:59.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/PCSC/reader.h       2012-03-30 10:42:19.000000000 
+0200
@@ -6,7 +6,7 @@
  * Copyright (C) 2005-2009
  *  Ludovic Rousseau <[email protected]>
  *
- * $Id: reader.h 6110 2011-11-19 13:18:41Z rousseau $
+ * $Id: reader.h 6241 2012-03-20 16:42:11Z rousseau $
  */
 
 /**
@@ -230,6 +230,9 @@
 #define PCSCv2_PART10_PROPERTY_bMaxPINSize 7
 #define PCSCv2_PART10_PROPERTY_sFirmwareID 8
 #define PCSCv2_PART10_PROPERTY_bPPDUSupport 9
+#define PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize 10
+#define PCSCv2_PART10_PROPERTY_wIdVendor 11
+#define PCSCv2_PART10_PROPERTY_wIdProduct 12
 
 #endif
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/configfile.c new/pcsc-lite-1.8.3/src/configfile.c
--- old/pcsc-lite-1.8.2/src/configfile.c        2011-02-22 23:25:12.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/configfile.c        2012-03-30 10:42:28.000000000 
+0200
@@ -480,7 +480,7 @@
  * Copyright (C) 2004-2010
  *  Ludovic Rousseau <[email protected]>
  *
- * $Id: configfile.l 5543 2011-01-21 08:39:43Z rousseau $
+ * $Id: configfile.l 6215 2012-02-04 09:08:36Z rousseau $
  */
 #line 17 "configfile.l"
 #include <dirent.h>
@@ -1976,10 +1976,21 @@
                        char filename[FILENAME_MAX];
                        int r;
 
-                       /* skip . and .. */
-                       if ((strcmp(direntry->d_name, ".") == 0) ||
-                               (strcmp(direntry->d_name, "..") == 0))
+                       /* skip non regular files */
+                       if (direntry->d_type != DT_REG)
+                       {
+                               Log2(PCSC_LOG_DEBUG, "Skipping non regular 
file: %s",
+                                       direntry->d_name);
+                               continue;
+                       }
+
+                       /* skip files starting with . like ., .., .svn, etc */
+                       if ('.' == direntry->d_name[0])
+                       {
+                               Log2(PCSC_LOG_DEBUG, "Skipping hidden file: %s",
+                                       direntry->d_name);
                                continue;
+                       }
 
                        snprintf(filename, sizeof(filename), "%s/%s",
                                readerconf_dir, direntry->d_name);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/configfile.l new/pcsc-lite-1.8.3/src/configfile.l
--- old/pcsc-lite-1.8.2/src/configfile.l        2011-01-29 14:50:59.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/configfile.l        2012-03-30 10:42:19.000000000 
+0200
@@ -10,7 +10,7 @@
  * Copyright (C) 2004-2010
  *  Ludovic Rousseau <[email protected]>
  *
- * $Id: configfile.l 5543 2011-01-21 08:39:43Z rousseau $
+ * $Id: configfile.l 6215 2012-02-04 09:08:36Z rousseau $
  */
 
 %{
@@ -249,10 +249,21 @@
                        char filename[FILENAME_MAX];
                        int r;
 
-                       /* skip . and .. */
-                       if ((strcmp(direntry->d_name, ".") == 0) ||
-                               (strcmp(direntry->d_name, "..") == 0))
+                       /* skip non regular files */
+                       if (direntry->d_type != DT_REG)
+                       {
+                               Log2(PCSC_LOG_DEBUG, "Skipping non regular 
file: %s",
+                                       direntry->d_name);
+                               continue;
+                       }
+
+                       /* skip files starting with . like ., .., .svn, etc */
+                       if ('.' == direntry->d_name[0])
+                       {
+                               Log2(PCSC_LOG_DEBUG, "Skipping hidden file: %s",
+                                       direntry->d_name);
                                continue;
+                       }
 
                        snprintf(filename, sizeof(filename), "%s/%s",
                                readerconf_dir, direntry->d_name);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/debuglog.c new/pcsc-lite-1.8.3/src/debuglog.c
--- old/pcsc-lite-1.8.2/src/debuglog.c  2011-10-11 22:27:42.000000000 +0200
+++ new/pcsc-lite-1.8.3/src/debuglog.c  2012-03-30 10:42:19.000000000 +0200
@@ -6,7 +6,7 @@
  * Copyright (C) 2002-2011
  *  Ludovic Rousseau <[email protected]>
  *
- * $Id: debuglog.c 6028 2011-10-11 14:18:43Z rousseau $
+ * $Id: debuglog.c 6229 2012-02-21 08:49:21Z rousseau $
  */
 
 /**
@@ -202,6 +202,10 @@
                || (DEBUGLOG_NO_DEBUG == LogMsgType))
                return;
 
+       /* len is an error value? */
+       if (len < 0)
+               return;
+
        log_xxd_always(priority, msg, buffer, len);
 } /* log_xxd */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/pcscd.h new/pcsc-lite-1.8.3/src/pcscd.h
--- old/pcsc-lite-1.8.2/src/pcscd.h     2012-01-18 16:49:19.000000000 +0100
+++ new/pcsc-lite-1.8.3/src/pcscd.h     2012-03-30 14:12:02.000000000 +0200
@@ -32,7 +32,7 @@
 
 #define PCSCLITE_SVC_IDENTITY          0x01030000      /**< Service ID */
 
-#define PCSCLITE_VERSION_NUMBER                "1.8.2" /**< Current version */
+#define PCSCLITE_VERSION_NUMBER                "1.8.3" /**< Current version */
 #define PCSCLITE_STATUS_POLL_RATE      400000          /**< Status polling 
rate */
 #define PCSCLITE_LOCK_POLL_RATE                100000          /**< Lock 
polling rate */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/spy/Makefile.am new/pcsc-lite-1.8.3/src/spy/Makefile.am
--- old/pcsc-lite-1.8.2/src/spy/Makefile.am     2012-01-18 14:59:30.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/spy/Makefile.am     2012-02-01 14:28:10.000000000 
+0100
@@ -17,3 +17,10 @@
 
 EXTRA_DIST = install_spy.sh uninstall_spy.sh pcsc-spy.pod
 CLEANFILES = pcsc-spy.1
+
+framework:
+       rm -rf PCSC.framework
+       mkdir -p PCSC.framework/Versions/A
+       cp .libs/libpcscspy.dylib PCSC.framework/Versions/A/PCSC
+       ln -s Versions/Current/PCSC PCSC.framework
+       ln -s A PCSC.framework/Versions/Current
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/spy/libpcscspy.c 
new/pcsc-lite-1.8.3/src/spy/libpcscspy.c
--- old/pcsc-lite-1.8.2/src/spy/libpcscspy.c    2012-01-15 18:20:52.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/spy/libpcscspy.c    2012-03-30 10:42:19.000000000 
+0200
@@ -16,7 +16,7 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-/* $Id: libpcscspy.c 6177 2012-01-15 17:20:00Z rousseau $ */
+/* $Id: libpcscspy.c 6234 2012-02-28 14:38:13Z rousseau $ */
 
 #include <dlfcn.h>
 #include <stdio.h>
@@ -34,6 +34,14 @@
 
 #define DEBUG
 
+#ifdef __APPLE__
+#define SCardControl SCardControl132
+
+PCSC_API int32_t SCardControl132(SCARDHANDLE hCard, uint32_t dwControlCode,
+        const void *pbSendBuffer, uint32_t cbSendLength,
+        void *pbRecvBuffer, uint32_t cbRecvLength, uint32_t *lpBytesReturned);
+#endif
+
 /* function prototypes */
 
 #define p_SCardEstablishContext(fct) LONG(fct)(DWORD dwScope, LPCVOID 
pvReserved1, LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
@@ -80,6 +88,11 @@
        return SCARD_F_INTERNAL_ERROR;
 }
 
+static const char * internal_stringify_error(void)
+{
+       return "No spy pcsc_stringify_error() function";
+}
+
 /* contains pointers to real functions */
 static struct
 {
@@ -122,7 +135,7 @@
        .SCardCancel = (p_SCardCancel(*))internal_error,
        .SCardGetAttrib = (p_SCardGetAttrib(*))internal_error,
        .SCardSetAttrib = (p_SCardSetAttrib(*))internal_error,
-       .pcsc_stringify_error = (p_pcsc_stringify_error(*))internal_error
+       .pcsc_stringify_error = 
(p_pcsc_stringify_error(*))internal_stringify_error
 };
 
 #define LOG log_line("%s:%d", __FILE__, __LINE__)
@@ -215,7 +228,7 @@
        spy_line("0x%08lX", arg);
 }
 
-static void spy_ptr_long(long *arg)
+static void spy_ptr_long(LONG *arg)
 {
        if (arg)
                spy_line("0x%08lX", *arg);
@@ -223,7 +236,7 @@
                spy_line("NULL");
 }
 
-static void spy_ptr_ulong(unsigned long *arg)
+static void spy_ptr_ulong(ULONG *arg)
 {
        if (arg)
                spy_line("0x%08lX", *arg);
@@ -266,7 +279,7 @@
     spy_line("%s", str);
 }
 
-static void spy_n_str(const char *str, unsigned long *len, int autoallocate)
+static void spy_n_str(const char *str, ULONG *len, int autoallocate)
 {
     spy_ptr_ulong(len);
     if (NULL == len)
@@ -289,7 +302,7 @@
 
             do
             {
-                spy_line("%s", s);
+                               spy_line("%s", s);
                 length += strlen(s)+1;
                 s += strlen(s)+1;
             } while(length < *len);
@@ -317,8 +330,19 @@
 static LONG load_lib(void)
 {
 
+#ifdef __APPLE__
+/* We should be able to directly use this
+ * #define LIBPCSC_NOSPY "/System/Library/Frameworks/PCSC.framework/PCSC"
+ * but for a yet unknown reason the dlsym() returns symbols from the spy
+ * library and not from the framework.
+ * Just copying the framework in /tmp does solve the problem.
+ */
+#define LIBPCSC_NOSPY "/tmp/PCSC"
+#define LIBPCSC "/tmp/PCSC"
+#else
 #define LIBPCSC_NOSPY "libpcsclite_nospy.so.1"
 #define LIBPCSC "libpcsclite.so.1"
+#endif
 
        /* first try to load the NOSPY library
         * this is used for programs doing an explicit dlopen like
@@ -339,6 +363,12 @@
 
 #define get_symbol(s) do { spy.s = dlsym(Lib_handle, #s); if (NULL == spy.s) { 
log_line("%s", dlerror()); return SCARD_F_INTERNAL_ERROR; } } while (0)
 
+       if (SCardEstablishContext == dlsym(Lib_handle, "SCardEstablishContext"))
+       {
+               log_line("Symbols dlsym error");
+               return SCARD_F_INTERNAL_ERROR;
+       }
+
        get_symbol(SCardEstablishContext);
        get_symbol(SCardReleaseContext);
        get_symbol(SCardIsValidContext);
@@ -353,7 +383,9 @@
        get_symbol(SCardTransmit);
        get_symbol(SCardListReaderGroups);
        get_symbol(SCardListReaders);
-       get_symbol(SCardFreeMemory);
+       /* Mac OS X do not have SCardFreeMemory() */
+       if (dlsym(Lib_handle, "SCardFreeMemory"))
+               get_symbol(SCardFreeMemory);
        get_symbol(SCardCancel);
        get_symbol(SCardGetAttrib);
        get_symbol(SCardSetAttrib);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/spy/pcsc-spy new/pcsc-lite-1.8.3/src/spy/pcsc-spy
--- old/pcsc-lite-1.8.2/src/spy/pcsc-spy        2012-01-18 14:59:30.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/spy/pcsc-spy        2012-03-30 10:42:19.000000000 
+0200
@@ -18,7 +18,7 @@
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# $Id: pcsc-spy 6184 2012-01-18 13:57:58Z rousseau $
+# $Id: pcsc-spy 6236 2012-02-28 14:42:18Z rousseau $
 
 import os
 import signal
@@ -170,6 +170,8 @@
         else:
             print self.indent + data + time
 
+        return rv_text
+
     def log_in(self, line):
         """ generic log for IN line """
         if self.color:
@@ -507,6 +509,12 @@
         bRecvLength = self.log_out2("bRecvLength")
         bRecvBuffer = self.log_buffer("bRecvBuffer", "out")
 
+        rv_text = self._log_rv()
+
+        # do not parse the received buffer in case of error
+        if rv_text != "SCARD_S_SUCCESS":
+            return
+
         def hex2int(data, lengh):
             return [int(x, 16) for x in data.split(" ")]
 
@@ -603,8 +611,6 @@
             for line in result:
                 print "  ", line
 
-        self._log_rv()
-
     def _SCardGetAttrib(self):
         """ SCardGetAttrib """
         self.log_name("SCardGetAttrib")
@@ -748,7 +754,7 @@
                     self._SCardConnect()
                 elif fct == 'SCardTransmit':
                     self._SCardTransmit()
-                elif fct == 'SCardControl':
+                elif fct == 'SCardControl' or fct == 'SCardControl132':
                     self._SCardControl()
                 elif fct == 'SCardGetAttrib':
                     self._SCardGetAttrib()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/pcsc-lite-1.8.2/src/spy/pcsc-spy.pod 
new/pcsc-lite-1.8.3/src/spy/pcsc-spy.pod
--- old/pcsc-lite-1.8.2/src/spy/pcsc-spy.pod    2012-01-18 14:59:30.000000000 
+0100
+++ new/pcsc-lite-1.8.3/src/spy/pcsc-spy.pod    2012-02-01 14:28:10.000000000 
+0100
@@ -91,6 +91,20 @@
 
 and run your PC/SC application.
 
+=head2 Mac OS X
+
+The installation is not automatic. In the pcsc-lite/src/spy directory do:
+ make framework
+
+Then copy the PCSC.framework directory in /tmp
+ cp -a PCSC.framework /tmp
+
+Copy the official PCSC.framework (binary only) in /tmp
+ cp /System/Library/Frameworks/PCSC.framework/PCSC /tmp
+
+Run the application to debug as:
+ DYLD_FRAMEWORK_PATH=/tmp pcsctest
+
 =head1 FILES
 
 F<~/pcsc-spy> FIFO file is used by F<libpcsclite.so.1> to send the raw

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to