diff -Nru acsccid-1.1.0/aclocal.m4 acsccid-1.1.1/aclocal.m4 --- acsccid-1.1.0/aclocal.m4 2014-12-10 08:34:11.000000000 +0000 +++ acsccid-1.1.1/aclocal.m4 2015-11-03 04:02:33.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -235,7 +235,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -247,10 +247,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -266,12 +266,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +333,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -385,7 +385,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -416,7 +416,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -607,7 +607,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -683,7 +683,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -773,8 +773,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -848,6 +848,9 @@ AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -877,7 +880,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -888,7 +891,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -898,7 +901,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -917,7 +920,7 @@ rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Copyright (C) 1998-2013 Free Software Foundation, Inc. +# Copyright (C) 1998-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -938,7 +941,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -973,7 +976,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1023,7 +1026,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1062,7 +1065,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1091,7 +1094,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1138,7 +1141,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1157,7 +1160,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1238,7 +1241,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1298,7 +1301,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1326,7 +1329,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1345,7 +1348,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru acsccid-1.1.0/ChangeLog acsccid-1.1.1/ChangeLog --- acsccid-1.1.0/ChangeLog 2014-12-10 08:34:49.000000000 +0000 +++ acsccid-1.1.1/ChangeLog 2015-11-03 04:02:52.000000000 +0000 @@ -1,3 +1,307 @@ +2015-11-03 Godfrey Chung + + * README: Update README for v1.1.1. + +2015-11-03 Godfrey Chung + + * configure.ac: Update the version to 1.1.1 in configure.ac. + +2015-11-03 Godfrey Chung + + * src/ccid_usb.c: Use pthread_exit() in CardDetectionThread(). + +2015-11-03 Godfrey Chung + + * src/ccid_usb.c: Break if the device was disconnected in + CardDetectionThread(). + +2015-11-03 Godfrey Chung + + * src/ccid_usb.c: Fix segmentation fault on Mac OS X in + CardDetectionThread(). The local variable reader_index was incorrectly passed as pointer to + the thread. + +2015-10-27 Godfrey Chung + + * src/Info.plist.src: Info.plist: use hex values in the + documentation. Merge from ccid 1.4.21. + +2015-10-27 Godfrey Chung + + * src/ccid_usb.c: OpenUSBByName(): free the device list in case of + error. Merge from ccid 1.4.21. + +2015-10-27 Godfrey Chung + + * src/ccid.h, src/ccid_usb.c, src/ifdhandler.c: Add Feitain R502 + dual interface reader into CCID driver. The Feitian R502 DUAL reader has 3 interfaces. Merge from ccid + 1.4.21. + +2015-10-27 Godfrey Chung + + * src/ccid_usb.c: OpenUSBByName(): fix the order of interfaces in + log. Merge from ccid 1.4.21. + +2015-10-27 Godfrey Chung + + * src/ccid_usb.c: OpenUSBByName(): add more time on Mac OS X. Merge from ccid 1.4.21. + +2015-10-27 Godfrey Chung + + * src/ccid_usb.c: Use libusb_error_name() to display the error name. Merge from ccid 1.4.21. + +2015-08-10 Godfrey Chung + + * MacOSX/configure: MacOSX/configure: use /usr/local/libexec/... on + El Capitan. Merge from ccid 1.4.20. + +2015-08-10 Godfrey Chung + + * src/ccid.c: The O2 Micro Oz776 reader only supports 9600 bps. Merge from ccid 1.4.20. + +2015-07-27 Godfrey Chung + + * src/ifdhandler.c: Update the copyright in src/ifdhandler.c. + +2015-07-27 Godfrey Chung + + * src/commands.c: Update the copyright in src/commands.c. + +2015-07-27 Godfrey Chung + + * src/ccid.h: Update the copyright in src/ccid.h. + +2015-07-27 Godfrey Chung + + * src/ccid.c: Update the copyright in src/ccid.c. + +2015-07-24 Godfrey Chung + + * src/ccid.c: Patch APG8201 (PID: 8205) in ccid_open_hack_post(). + +2015-07-24 Godfrey Chung + + * src/commands.c: Return 6B 80 if the parameter is invalid in + SecurePINModify(). + +2015-07-24 Godfrey Chung + + * src/commands.c: Return 6B 80 if the parameter is invalid in + SecurePINVerify(). + +2015-07-24 Godfrey Chung + + * src/ifdhandler.c: Enable bPPDUSupport over SCardTransmit in + IFDHControl(). + +2015-07-24 Godfrey Chung + + * src/ifdhandler.c: Process SPE pseudo APDU in IFDHTransmitToICC(). It implements SPE pseudo APDU from PC/SC v2.02.02 Part 10 + Supplement. + +2015-07-06 Godfrey Chung + + * src/ifdhandler.c: Handle ACS_APG8201Z2 in IFDHControl(). + +2015-07-06 Godfrey Chung + + * src/ccid.h: Add ACS_APG8201Z2 to src/ccid.h. + +2015-07-06 Godfrey Chung + + * src/supported_readers.txt: Add supported readers. APG8201Z (PID: 8205) + +2015-07-24 Godfrey Chung + + * src/commands.c: Return 64 02 if two "new PIN" entries do not match + in CCID_Receive(). + +2015-07-24 Godfrey Chung + + * src/commands.c: Return IFD_ERROR_INSUFFICIENT_BUFFER if rx_length + < 2 in CCID_Receive(). + +2015-06-04 Godfrey Chung + + * src/acr38cmd.c: Update the copyright in src/acr38cmd.c. + +2015-06-04 Godfrey Chung + + * src/ccid_usb.c: Update the copyright in src/ccid_usb.c. + +2015-06-04 Godfrey Chung + + * src/supported_readers.txt: Add supported readers. ACR3201 ICC Reader + +2015-06-04 Godfrey Chung + + * configure.ac: Update LIBUSB_NEEDED_VERSION to 1.0.9 in + configure.ac. libusb_error_name() is available on libusb 1.0.9 or later. + +2015-06-03 Godfrey Chung + + * src/acr38cmd.c: Replace ccid_error() with acr38_error() in + ACR38_Receive(). + +2015-06-03 Godfrey Chung + + * src/ifdhandler.c: Merge src/ifdhandler.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/commands.h: Import src/commands.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/commands.c: Merge src/commands.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid_usb.h: Import src/ccid_usb.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid_usb.c: Merge src/ccid_usb.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid_ifdhandler.h: Merge src/ccid_ifdhandler.h from ccid + 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid.h: Merge src/ccid.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid.c: Merge src/ccid.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * MacOSX/configure: Merge MacOSX/configure from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * MacOSX/configure, configure.ac, src/debug.c, src/debug.h: Enable + syslog logging on Yosemite. Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ifdhandler.c: IFDHSleep(): timout parameter is in ms not µs. Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ifdhandler.c: Fix typos in comments. Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid.c: Use CmdEscapeCheck() in + set_gemalto_firmware_features(). Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/commands.c, src/commands.h: Add CmdEscapeCheck(). Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid.c, src/ccid.h, src/commands.c: Add log_level parameter to + ccid_error(). Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid_usb.c: Ignore errno and use libusb returned value only. Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid_usb.c: Use libusb_error_name() instead of strerror(). Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/ccid.c, src/ccid.h, src/ccid_usb.c: Remove ZLP patch for + Gemalto IDBridge CT30 and K30. Merge from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * MacOSX/reader.h: Import MacOSX/reader.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * MacOSX/ifdhandler.h: Import MacOSX/ifdhandler.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * MacOSX/debuglog.h: Import MacOSX/debuglog.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/towitoko/README: Import src/towitoko/README from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/openct/proto-t1.h: Import src/openct/proto-t1.h from ccid + 1.4.19. + +2015-06-03 Godfrey Chung + + * src/openct/checksum.h: Import src/openct/checksum.h from ccid + 1.4.19. + +2015-06-03 Godfrey Chung + + * src/utils.h: Import src/utils.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/utils.c: Import src/utils.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/tokenparser.l: Import src/tokenparser.l from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/strlcpycat.h: Import src/strlcpycat.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/strlcpy.c: Import src/strlcpy.c from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/parser.h: Import src/parser.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/misc.h: Import src/misc.h from ccid 1.4.19. + +2015-06-03 Godfrey Chung + + * src/defs.h: Merge src/defs.h from ccid 1.4.19. + +2015-05-11 Eugene Crosser + + * src/ccid_usb.c: Workaround for APDU sequence bug in ACR122U Older versions of ACR122U USB NFC reader have a bug: if last APDU + written to the device was longer than 54 bytes, then response APDU + read from the device has sequence number one less than it must be. + Vendor says that this bug is fixed in the devices manufactured later + than certain date. This patch accepts response APDU with off by one + sequence number if they arrive from this reader, and previously sent + APDU was long enough to trigger the problem. Signed-off-by: Eugene Crosser + +2015-02-06 Godfrey Chung + + * src/supported_readers.txt: Add supported readers. ACR1251 Reader. + +2014-12-29 Godfrey Chung + + * src/acr38cmd.c: Fix uninitialized variable warning in + ACR38_CmdPowerOn(). + +2014-12-18 Godfrey Chung + + * src/ccid_usb.c: Fix the mutex lock problem in + Multi_InterruptRead(). The mutex is not locked if the code go to again label. + 2014-12-08 Godfrey Chung * README: Update README for v1.1.0. diff -Nru acsccid-1.1.0/config/ar-lib acsccid-1.1.1/config/ar-lib --- acsccid-1.1.0/config/ar-lib 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/ar-lib 2015-11-03 04:02:35.000000000 +0000 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff -Nru acsccid-1.1.0/config/compile acsccid-1.1.1/config/compile --- acsccid-1.1.0/config/compile 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/compile 2015-11-03 04:02:35.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff -Nru acsccid-1.1.0/config/config.guess acsccid-1.1.1/config/config.guess --- acsccid-1.1.0/config/config.guess 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/config.guess 2015-11-03 04:02:35.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -235,6 +249,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -579,8 +596,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -932,6 +950,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1020,7 +1041,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} diff -Nru acsccid-1.1.0/config/config.sub acsccid-1.1.1/config/config.sub --- acsccid-1.1.0/config/config.sub 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/config.sub 2015-11-03 04:02:35.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-09-11' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +255,13 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -305,7 +306,7 @@ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -313,6 +314,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -327,6 +329,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -372,12 +377,13 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ @@ -424,12 +430,13 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -437,6 +444,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -513,6 +521,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -774,6 +785,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1365,7 +1379,7 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ diff -Nru acsccid-1.1.0/config/depcomp acsccid-1.1.1/config/depcomp --- acsccid-1.1.0/config/depcomp 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/depcomp 2015-11-03 04:02:35.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru acsccid-1.1.0/config/install-sh acsccid-1.1.1/config/install-sh --- acsccid-1.1.0/config/install-sh 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/install-sh 2015-11-03 04:02:35.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,81 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # $RANDOM is not portable (e.g. dash); use it when possible to + # lower collision chance + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so + # create the $tmpdir first (and fail if unsuccessful) to make sure + # that nobody tries to guess the $tmpdir name. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +377,51 @@ # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue + test X"$d" = X && continue - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +456,12 @@ # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +474,24 @@ # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff -Nru acsccid-1.1.0/config/missing acsccid-1.1.1/config/missing --- acsccid-1.1.0/config/missing 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/missing 2015-11-03 04:02:35.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru acsccid-1.1.0/config/ylwrap acsccid-1.1.1/config/ylwrap --- acsccid-1.1.0/config/ylwrap 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/config/ylwrap 2015-11-03 04:02:35.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-01-12.17; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey . # diff -Nru acsccid-1.1.0/config.h.in acsccid-1.1.1/config.h.in --- acsccid-1.1.0/config.h.in 2014-12-10 08:34:12.000000000 +0000 +++ acsccid-1.1.1/config.h.in 2015-11-03 04:02:34.000000000 +0000 @@ -125,6 +125,9 @@ /* composite device are seen as multi-slots */ #undef USE_COMPOSITE_AS_MULTISLOT +/* Use syslog(3) for debug */ +#undef USE_SYSLOG + /* Version number of package */ #undef VERSION diff -Nru acsccid-1.1.0/configure acsccid-1.1.1/configure --- acsccid-1.1.0/configure 2014-12-10 08:34:12.000000000 +0000 +++ acsccid-1.1.1/configure 2015-11-03 04:02:34.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for acsccid 1.1.0. +# Generated by GNU Autoconf 2.69 for acsccid 1.1.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='acsccid' PACKAGE_TARNAME='acsccid' -PACKAGE_VERSION='1.1.0' -PACKAGE_STRING='acsccid 1.1.0' +PACKAGE_VERSION='1.1.1' +PACKAGE_STRING='acsccid 1.1.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -756,6 +756,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -793,6 +794,7 @@ enable_multi_thread enable_usbdropdir enable_pcsclite +enable_syslog enable_embedded ' ac_precious_vars='build_alias @@ -849,6 +851,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1101,6 +1104,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1238,7 +1250,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1351,7 +1363,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures acsccid 1.1.0 to adapt to many kinds of systems. +\`configure' configures acsccid 1.1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1391,6 +1403,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1421,7 +1434,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of acsccid 1.1.0:";; + short | recursive ) echo "Configuration of acsccid 1.1.1:";; esac cat <<\_ACEOF @@ -1450,6 +1463,7 @@ --enable-usbdropdir=DIR directory containing USB drivers (default to pcscd config or $(prefix)/pcsc/drivers) --disable-pcsclite do not use pcsc-lite debug support + --enable-syslog use syslog instead of printf for debug (Yosemite) --enable-embedded limit RAM and CPU ressources by disabling features (log) @@ -1548,7 +1562,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -acsccid configure 1.1.0 +acsccid configure 1.1.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1967,7 +1981,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by acsccid $as_me 1.1.0, which was +It was created by acsccid $as_me 1.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2345,7 +2359,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2537,7 +2551,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2831,7 +2845,7 @@ # Define the identity of the package. PACKAGE='acsccid' - VERSION='1.1.0' + VERSION='1.1.1' cat >>confdefs.h <<_ACEOF @@ -2865,8 +2879,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -12548,7 +12562,7 @@ # check if libusb is used -LIBUSB_NEEDED_VERSION="1.0.8" +LIBUSB_NEEDED_VERSION="1.0.9" if test "x$use_libusb" != xno ; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0\""; } >&5 @@ -13416,6 +13430,21 @@ fi +# --enable-syslog +# Check whether --enable-syslog was given. +if test "${enable_syslog+set}" = set; then : + enableval=$enable_syslog; use_syslog="${enableval}" +else + use_syslog=no +fi + + +if test x$use_syslog = xyes; then + +$as_echo "#define USE_SYSLOG 1" >>confdefs.h + +fi + # class driver is disabled class=no NOCLASS="--no-class" @@ -13470,6 +13499,7 @@ bundle directory name: ${bundle} USB drop directory: ${usbdropdir} compiled for pcsc-lite: ${pcsclite} +syslog debug: ${use_syslog} class driver: ${class} EOF @@ -14020,7 +14050,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by acsccid $as_me 1.1.0, which was +This file was extended by acsccid $as_me 1.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14086,7 +14116,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -acsccid config.status 1.1.0 +acsccid config.status 1.1.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru acsccid-1.1.0/configure.ac acsccid-1.1.1/configure.ac --- acsccid-1.1.0/configure.ac 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/configure.ac 2015-11-03 03:17:55.000000000 +0000 @@ -4,7 +4,7 @@ # Require autoconf 2.61 AC_PREREQ([2.69]) -AC_INIT([acsccid], [1.1.0]) +AC_INIT([acsccid], [1.1.1]) AC_CONFIG_SRCDIR(src/ifdhandler.c) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE(1.8 dist-bzip2 no-dist-gzip foreign subdir-objects) @@ -99,7 +99,7 @@ [ use_libusb="${enableval}" ], [ use_libusb=yes ] ) # check if libusb is used -LIBUSB_NEEDED_VERSION="1.0.8" +LIBUSB_NEEDED_VERSION="1.0.9" if test "x$use_libusb" != xno ; then PKG_CHECK_EXISTS([libusb-1.0], [ PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= $LIBUSB_NEEDED_VERSION, [], @@ -205,6 +205,15 @@ fi AM_CONDITIONAL(WITHOUT_PCSC, test "${pcsclite}" != "yes") +# --enable-syslog +AC_ARG_ENABLE(syslog, + AS_HELP_STRING([--enable-syslog],[use syslog instead of printf for debug (Yosemite)]), + [ use_syslog="${enableval}" ], [ use_syslog=no ] ) + +if test x$use_syslog = xyes; then + AC_DEFINE(USE_SYSLOG, 1, [Use syslog(3) for debug]) +fi + # class driver is disabled class=no NOCLASS="--no-class" @@ -255,6 +264,7 @@ bundle directory name: ${bundle} USB drop directory: ${usbdropdir} compiled for pcsc-lite: ${pcsclite} +syslog debug: ${use_syslog} class driver: ${class} EOF diff -Nru acsccid-1.1.0/debian/changelog acsccid-1.1.1/debian/changelog --- acsccid-1.1.0/debian/changelog 2014-12-11 03:51:05.000000000 +0000 +++ acsccid-1.1.1/debian/changelog 2015-11-05 06:17:16.000000000 +0000 @@ -1,3 +1,10 @@ +acsccid (1.1.1-1) unstable; urgency=low + + * New upstream release. + * Removed the version from libusb-1.0-0-dev in debian/control. + + -- Godfrey Chung Thu, 05 Nov 2015 14:17:02 +0800 + acsccid (1.1.0-1) unstable; urgency=low * New upstream release. diff -Nru acsccid-1.1.0/debian/control acsccid-1.1.1/debian/control --- acsccid-1.1.0/debian/control 2014-12-10 10:03:58.000000000 +0000 +++ acsccid-1.1.1/debian/control 2015-11-05 06:12:56.000000000 +0000 @@ -7,7 +7,7 @@ debhelper (>= 9~), flex, libpcsclite-dev (>= 1.8.3~), - libusb-1.0-0-dev (>= 1.0.8~), + libusb-1.0-0-dev, perl, pkg-config Standards-Version: 3.9.6 diff -Nru acsccid-1.1.0/MacOSX/configure acsccid-1.1.1/MacOSX/configure --- acsccid-1.1.0/MacOSX/configure 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/MacOSX/configure 2015-08-10 06:28:06.000000000 +0000 @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. -# $Id: configure 6792 2013-11-25 13:03:21Z rousseau $ +# $Id$ # to use # ./MacOSX/configure @@ -76,6 +76,25 @@ CONFIGURE_ARGS="--disable-dependency-tracking" +# Are we on a CryptoTokenKit system? (like Mac OS X 10.10 Yosemite) +if [ -d /System/Library/CryptoTokenKit ] +then + # so we use syslog(3) to log errors + CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-syslog" +fi + +# get the Mac OS X major version. Example: El Capitan 10.11 -> 10011 +MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 * 1000 + $2}') + +if [ 10011 -gt $MAC_VERSION ] +then + # Mac OS X < 10.11 + DROPDIR="/usr/libexec/SmartCardServices/drivers" +else + # Mac OS X >= 10.11 (El Capitan) + DROPDIR="/usr/local/libexec/SmartCardServices/drivers" +fi + # do not build a static driver # (building fails when linking statically with libusb) CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-static" @@ -108,7 +127,7 @@ LIBUSB_CFLAGS="$LIBUSB_CFLAGS" \ LIBUSB_LIBS="$LIBUSB_LIBS" \ LDFLAGS="$LDFLAGS" \ - --enable-usbdropdir=/usr/libexec/SmartCardServices/drivers \ + --enable-usbdropdir="$DROPDIR" \ $CONFIGURE_ARGS \ "$@" diff -Nru acsccid-1.1.0/MacOSX/debuglog.h acsccid-1.1.1/MacOSX/debuglog.h --- acsccid-1.1.0/MacOSX/debuglog.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/MacOSX/debuglog.h 2015-06-03 09:46:42.000000000 +0000 @@ -18,9 +18,6 @@ 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. -Changes to this license can be made only by the copyright author with -explicit written consent. - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -32,7 +29,7 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: debuglog.h 6851 2014-02-14 15:43:32Z rousseau $ + * $Id$ */ /** @@ -101,9 +98,9 @@ #define Log9(priority, fmt, data1, data2, data3, data4, data5, data6, data7, data8) do { } while(0) #define LogXxd(priority, msg, buffer, size) do { } while(0) -#define DebugLogA(a) -#define DebugLogB(a, b) -#define DebugLogC(a, b,c) +#define DebugLogA(a) +#define DebugLogB(a, b) +#define DebugLogC(a, b,c) #else diff -Nru acsccid-1.1.0/MacOSX/ifdhandler.h acsccid-1.1.1/MacOSX/ifdhandler.h --- acsccid-1.1.0/MacOSX/ifdhandler.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/MacOSX/ifdhandler.h 2015-06-03 09:46:42.000000000 +0000 @@ -20,9 +20,6 @@ 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. -Changes to this license can be made only by the copyright author with -explicit written consent. - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -34,7 +31,7 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ifdhandler.h 6851 2014-02-14 15:43:32Z rousseau $ + * $Id$ */ /** @@ -51,7 +48,7 @@ homogeneous fashion. This document assumes that the driver developer is experienced with standards such as ISO-7816-(1, 2, 3, 4), EMV and MCT specifications. For listings of these specifications please access the -above web site. +above web site. @section UsbReaders USB readers @@ -125,6 +122,8 @@ SCM Microsystems USB Reader @endverbatim +The reader name must use the ASCII character set. + @subsection CFBundleExecutable The executable name which exists in the particular platform's directory. @@ -192,7 +191,7 @@ @endverbatim As indicated in the XML file the DTD is available at -http://www.apple.com/DTDs/PropertyList-1.0.dtd. +http://www.apple.com/DTDs/PropertyList-1.0.dtd. @section SerialReaders Serial readers @@ -511,7 +510,7 @@ pdwBytesReturned. @note - @p *pdwBytesReturned should be set to zero on error. + @p *pdwBytesReturned should be set to zero on error. @return Error codes @retval IFD_SUCCESS Successful (\ref IFD_SUCCESS) @@ -552,7 +551,7 @@ possible to query IFDHICCPresence() for card status. USB readers can ignore the @p Channel parameter and query the USB bus -for the particular reader by manufacturer and product id. +for the particular reader by manufacturer and product id. @ingroup IFDHandler @param[in] Lun Logical Unit Number\n @@ -661,7 +660,7 @@ /** This function should set the slot/card capabilities for a particular slot/card specified by @p Lun. Again, if you have only 1 card slot and -don't mind loading a new driver for each reader then ignore @p Lun. +don't mind loading a new driver for each reader then ignore @p Lun. @ingroup IFDHandler @param[in] Lun Logical Unit Number @@ -683,7 +682,7 @@ /** This function should set the Protocol Type Selection (PTS) of a -particular card/slot using the three PTS parameters sent +particular card/slot using the three PTS parameters sent @ingroup IFDHandler @param[in] Lun Logical Unit Number @@ -693,7 +692,7 @@ - \ref SCARD_PROTOCOL_T1 T=1 protocol @param[in] Flags Logical OR of possible values to determine which PTS values -to negotiate +to negotiate - \ref IFD_NEGOTIATE_PTS1 - \ref IFD_NEGOTIATE_PTS2 - \ref IFD_NEGOTIATE_PTS3 @@ -807,7 +806,7 @@ specified by @p Lun. In cases where the device supports asynchronous card insertion/removal detection, it is advised that the driver manages this through a thread so the driver does not have to send and receive a -command each time this function is called. +command each time this function is called. @ingroup IFDHandler @param[in] Lun Logical Unit Number diff -Nru acsccid-1.1.0/MacOSX/reader.h acsccid-1.1.1/MacOSX/reader.h --- acsccid-1.1.0/MacOSX/reader.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/MacOSX/reader.h 2015-06-03 09:46:42.000000000 +0000 @@ -18,9 +18,6 @@ 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. -Changes to this license can be made only by the copyright author with -explicit written consent. - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -32,7 +29,7 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: reader.h 6851 2014-02-14 15:43:32Z rousseau $ + * $Id$ */ /** diff -Nru acsccid-1.1.0/Makefile.in acsccid-1.1.1/Makefile.in --- acsccid-1.1.0/Makefile.in 2014-12-10 08:34:13.000000000 +0000 +++ acsccid-1.1.1/Makefile.in 2015-11-03 04:02:35.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -78,16 +88,6 @@ build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ - README config/ar-lib config/compile config/config.guess \ - config/config.sub config/install-sh config/missing \ - config/ltmain.sh $(top_srcdir)/config/ar-lib \ - $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ - $(top_srcdir)/config/config.sub \ - $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ - $(top_srcdir)/config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -95,6 +95,8 @@ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -158,6 +160,15 @@ CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \ + $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing AUTHORS COPYING ChangeLog INSTALL \ + NEWS README config/ar-lib config/compile config/config.guess \ + config/config.sub config/install-sh config/ltmain.sh \ + config/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -330,6 +341,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -372,7 +384,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -602,15 +613,15 @@ $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -646,17 +657,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -833,6 +844,8 @@ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am +.PRECIOUS: Makefile + libtool: $(LIBTOOL_DEPS) $(SHELL) ./config.status libtool diff -Nru acsccid-1.1.0/README acsccid-1.1.1/README --- acsccid-1.1.0/README 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/README 2015-11-03 03:55:37.000000000 +0000 @@ -17,7 +17,7 @@ Linux - pcsclite 1.8.3 or above -- libusb 1.0.8 or above +- libusb 1.0.9 or above - flex - perl - pkg-config @@ -48,6 +48,7 @@ VID PID Reader Reader Name ---- ---- ------------------- ----------------------------- 072F B301 ACR32-A1 ACS ACR32 ICC Reader +072F B304 ACR3201-A1 ACS ACR3201 ICC Reader 072F 8300 ACR33U-A1 ACS ACR33U-A1 3SAM ICC Reader 072F 8302 ACR33U-A2 ACS ACR33U-A2 3SAM ICC Reader 072F 8307 ACR33U-A3 ACS ACR33U-A3 3SAM ICC Reader @@ -89,6 +90,7 @@ 072F 221B ACR1251U-C ACS ACR1251U-C Smart Card Reader 072F 2232 ACR1251UK ACS ACR1251K Dual Reader 072F 2242 ACR1251U-C3 ACS ACR1251 1S Dual Reader +072F 2238 ACR1251U-C9 ACS ACR1251 Reader 072F 223B ACR1252U-A1 ACS ACR1252 1S CL Reader 072F 223E ACR1252U-A2 ACS ACR1252 CL Reader 072F 223D ACR1252U BL ACS ACR1252 USB FW_Upgrade v100 @@ -117,6 +119,7 @@ 072F 0100 AET65 ACS AET65 ICC Reader 072F 8201 APG8201-A1 ACS APG8201 072F 8202 [OEM Reader] [OEM Reader Name] +072F 8205 [OEM Reader] [OEM Reader Name] 072F 90DB CryptoMate64 ACS CryptoMate64 072F B200 ACOS5T1 ACS CryptoMate (T1) 072F B106 ACOS5T2 ACS CryptoMate (T2) @@ -136,6 +139,39 @@ History ------- +v1.1.1 (3/11/2015) +- Fix the mutex lock problem in Multi_InterruptRead(). +- Fix uninitialized variable warning in ACR38_CmdPowerOn(). +- Fix APDU sequence bug in ACR122U. +- Merge with ccid 1.4.19. + - Use libusb_error_name() instead of strerror(). + - Ignore errno and use libusb returned value only. + - IFDHSleep(): timout parameter is in ms not µs. + - Enable syslog logging on Yosemite. +- Merge with ccid 1.4.20. + - MacOSX/configure: use /usr/local/libexec/... on El Capitan. +- Merge with ccid 1.4.21. + - Use libusb_error_name() to display the error name. + - OpenUSBByName(): add more time on Mac OS X. + - OpenUSBByName(): fix the order of interfaces in log. + - OpenUSBByName(): free the device list in case of error. + - Info.plist: use hex values in the documentation. +- Replace ccid_error() with acr38_error() in ACR38_Receive(). +- Update LIBUSB_NEEDED_VERSION to 1.0.9 in configure.ac. +- Return IFD_ERROR_INSUFFICIENT_BUFFER if rx_length < 2 in CCID_Receive(). +- Return 64 02 if two "new PIN" entries do not match in CCID_Receive(). +- Implements SPE pseudo APDU from PC/SC v2.02.02 Part 10 Supplement. +- Enable bPPDUSupport over SCardTransmit in IFDHControl(). +- Return 6B 80 if the parameter is invalid in SecurePINVerify(). +- Return 6B 80 if the parameter is invalid in SecurePINModify(). +- Fix segmentation fault on Mac OS X in CardDetectionThread(). +- Break if the device was disconnected in CardDetectionThread(). +- Use pthread_exit() in CardDetectionThread(). +- Add the following readers support: + ACR1251 Reader + ACR3201 ICC Reader + OEM Reader (VID: 072F, PID: 8205) + v1.1.0 (10/12/2014) - Add the following readers support: ACR1255U-J1 PICC Reader @@ -361,7 +397,7 @@ ------------------------------------------------------------------------------- -Copyright (C) 2009-2014 Advanced Card Systems Ltd. +Copyright (C) 2009-2015 Advanced Card Systems Ltd. Copyright (C) 2003-2011 Ludovic Rousseau Copyright (C) 2000-2001 Carlos Prados Copyright (C) 2003 Olaf Kirch diff -Nru acsccid-1.1.0/src/acr38cmd.c acsccid-1.1.1/src/acr38cmd.c --- acsccid-1.1.0/src/acr38cmd.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/acr38cmd.c 2015-06-18 02:53:14.000000000 +0000 @@ -1,6 +1,6 @@ /* acr38cmd.c: Emulated CCID reader commands for ACR38 non-CCID reader - Copyright (C) 2011-2014 Advanced Card Systems Ltd. + Copyright (C) 2011-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -112,7 +112,7 @@ unsigned int length; RESPONSECODE return_value = IFD_SUCCESS; _ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index); - unsigned char option; + unsigned char option = ACR38_OPTION_NONE; /* store length of buffer[] */ length = *nlength; @@ -436,7 +436,7 @@ if (cmd[ACR38_STATUS_OFFSET] != 0) { - ccid_error(cmd[ACR38_STATUS_OFFSET], __FILE__, __LINE__, __FUNCTION__); + acr38_error(cmd[ACR38_STATUS_OFFSET], __FILE__, __LINE__, __FUNCTION__); return IFD_COMMUNICATION_ERROR; } diff -Nru acsccid-1.1.0/src/ccid.c acsccid-1.1.1/src/ccid.c --- acsccid-1.1.0/src/ccid.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ccid.c 2015-08-10 06:12:59.000000000 +0000 @@ -1,7 +1,7 @@ /* ccid.c: CCID common code Copyright (C) 2003-2010 Ludovic Rousseau - Copyright (C) 2009-2014 Advanced Card Systems Ltd. + Copyright (C) 2009-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,7 @@ */ /* - * $Id: ccid.c 6976 2014-09-04 11:35:46Z rousseau $ + * $Id$ */ #include @@ -78,19 +78,7 @@ ccid_descriptor->readTimeout = 60*1000; /* 60 seconds */ break; - case GEMPCTWIN: - case GEMPCKEY: - case DELLSCRK: - /* Only the chipset with firmware version 2.00 is "bogus" - * The reader may send packets of 0 bytes when the reader is - * connected to a USB 3 port */ - if (0x0200 == ccid_descriptor->IFD_bcdDevice) - { - ccid_descriptor->zlp = TRUE; - DEBUG_INFO1("ZLP fixup"); - } - break; - + case OZ776: case OZ776_7772: ccid_descriptor->dwMaxDataRate = 9600; break; @@ -235,8 +223,8 @@ unsigned int len_features = sizeof *gf_features; RESPONSECODE ret; - ret = CmdEscape(reader_index, cmd, sizeof cmd, - (unsigned char*)gf_features, &len_features, 0); + ret = CmdEscapeCheck(reader_index, cmd, sizeof cmd, + (unsigned char*)gf_features, &len_features, 0, TRUE); if ((IFD_SUCCESS == ret) && (len_features == sizeof *gf_features)) { @@ -577,11 +565,15 @@ case ACS_APG8201: case ACS_APG8201Z: + case ACS_APG8201Z2: ccid_descriptor->wLcdLayout = 0x0210; // APG8201 uses short APDU exchange - ccid_descriptor->dwFeatures &= ~CCID_CLASS_EXCHANGE_MASK; - ccid_descriptor->dwFeatures |= CCID_CLASS_SHORT_APDU; + if (ccid_descriptor->dwFeatures & CCID_CLASS_TPDU) + { + ccid_descriptor->dwFeatures &= ~CCID_CLASS_EXCHANGE_MASK; + ccid_descriptor->dwFeatures |= CCID_CLASS_SHORT_APDU; + } break; case ACS_ACR85_PINPAD_READER_ICC: @@ -824,7 +816,8 @@ * ccid_error * ****************************************************************************/ -void ccid_error(int error, const char *file, int line, const char *function) +void ccid_error(int log_level, int error, const char *file, int line, + const char *function) { #ifndef NO_LOG const char *text; @@ -943,7 +936,7 @@ text = var_text; break; } - log_msg(PCSC_LOG_ERROR, "%s:%d:%s %s", file, line, function, text); + log_msg(log_level, "%s:%d:%s %s", file, line, function, text); #endif } /* ccid_error */ diff -Nru acsccid-1.1.0/src/ccid.h acsccid-1.1.1/src/ccid.h --- acsccid-1.1.0/src/ccid.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ccid.h 2015-10-27 09:14:12.000000000 +0000 @@ -1,7 +1,7 @@ /* ccid.h: CCID structures Copyright (C) 2003-2010 Ludovic Rousseau - Copyright (C) 2009-2014 Advanced Card Systems Ltd. + Copyright (C) 2009-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,7 +19,7 @@ */ /* - * $Id: ccid.h 6922 2014-06-16 13:55:33Z rousseau $ + * $Id$ */ #ifdef __APPLE__ @@ -147,11 +147,6 @@ */ struct GEMALTO_FIRMWARE_FEATURES *gemalto_firmware_features; - /* - * Zero Length Packet fixup (boolean) - */ - char zlp; - // Pointer to array of bStatus unsigned char *bStatus; @@ -250,6 +245,7 @@ #define HP_CCIDSMARTCARDKEYBOARD 0x03F00036 #define KOBIL_IDTOKEN 0x0D46301D #define FUJITSUSMARTKEYB 0x0BF81017 +#define FEITIANR502DUAL 0x096E060D // CCID readers #define ACS_ACR32_ICC_READER 0x072fb301 @@ -294,6 +290,7 @@ #define ACS_AET62_1SAM_PICC_READER 0x072f0103 #define ACS_APG8201 0x072f8201 #define ACS_APG8201Z 0x072f8202 +#define ACS_APG8201Z2 0x072f8205 // non-CCID readers #define ACS_ACR38U 0x072f9000 @@ -335,7 +332,8 @@ int ccid_open_hack_pre(unsigned int reader_index); int ccid_open_hack_post(unsigned int reader_index); -void ccid_error(int error, const char *file, int line, const char *function); +void ccid_error(int log_level, int error, const char *file, int line, + const char *function); _ccid_descriptor *get_ccid_descriptor(unsigned int reader_index); void acr38_error(int error, const char *file, int line, const char *function); void EnablePicc(unsigned int reader_index, int enabled); diff -Nru acsccid-1.1.0/src/ccid_ifdhandler.h acsccid-1.1.1/src/ccid_ifdhandler.h --- acsccid-1.1.0/src/ccid_ifdhandler.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ccid_ifdhandler.h 2015-06-03 09:46:42.000000000 +0000 @@ -19,7 +19,7 @@ */ /* - * $Id: ccid_ifdhandler.h 6876 2014-03-23 12:00:57Z rousseau $ + * $Id$ */ #ifndef _ccid_ifd_handler_h_ diff -Nru acsccid-1.1.0/src/ccid_usb.c acsccid-1.1.1/src/ccid_usb.c --- acsccid-1.1.0/src/ccid_usb.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ccid_usb.c 2015-11-03 02:10:34.000000000 +0000 @@ -1,7 +1,7 @@ /* ccid_usb.c: USB access routines using the libusb library Copyright (C) 2003-2010 Ludovic Rousseau - Copyright (C) 2009-2014 Advanced Card Systems Ltd. + Copyright (C) 2009-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -19,14 +19,13 @@ */ /* - * $Id: ccid_usb.c 6975 2014-09-04 11:33:05Z rousseau $ + * $Id$ */ #define __CCID_USB__ #include #include -#include #include # ifdef S_SPLINT_S # include @@ -129,6 +128,9 @@ // Max packet size of bulk out endpoint int bulkOutMaxPacketSize; + + // For a workaround for ACR122U + int last_write_size; } _usbDevice; /* The _usbDevice structure must be defined before including ccid_usb.h */ @@ -245,6 +247,7 @@ #else /* 100 ms delay */ struct timespec sleep_time = { 0, 100 * 1000 * 1000 }; + int count_libusb = 10; #endif int interface_number = -1; int i; @@ -331,15 +334,14 @@ rv = libusb_init(&ctx); if (rv != 0) { - DEBUG_CRITICAL2("libusb_init failed: %d", rv); + DEBUG_CRITICAL2("libusb_init failed: %s", libusb_error_name(rv)); return_value = STATUS_UNSUCCESSFUL; goto end1; } } #ifdef __APPLE__ - /* give some time to libusb to detect the new USB devices on Mac OS X */ - nanosleep(&sleep_time, NULL); +again_libusb: #endif cnt = libusb_get_device_list(ctx, &devs); if (cnt < 0) @@ -424,7 +426,8 @@ /* simulate a composite device as when libudev is used */ if ((GEMALTOPROXDU == readerID) - || (GEMALTOPROXSU == readerID)) + || (GEMALTOPROXSU == readerID) + || (FEITIANR502DUAL == readerID)) { /* * We can't talk to the two CCID interfaces @@ -576,8 +579,8 @@ r = libusb_open(dev, &dev_handle); if (r < 0) { - DEBUG_CRITICAL4("Can't libusb_open(%d/%d): %d", - bus_number, device_address, r); + DEBUG_CRITICAL4("Can't libusb_open(%d/%d): %s", + bus_number, device_address, libusb_error_name(r)); continue; } @@ -602,8 +605,9 @@ if (r < 0) { (void)libusb_close(dev_handle); - DEBUG_CRITICAL4("Can't set configuration on %d/%d: %d", - bus_number, device_address, r); + DEBUG_CRITICAL4("Can't set configuration on %d/%d: %s", + bus_number, device_address, + libusb_error_name(r)); continue; } } @@ -614,8 +618,8 @@ { #endif (void)libusb_close(dev_handle); - DEBUG_CRITICAL4("Can't get config descriptor on %d/%d: %d", - bus_number, device_address, r); + DEBUG_CRITICAL4("Can't get config descriptor on %d/%d: %s", + bus_number, device_address, libusb_error_name(r)); continue; } #ifdef __APPLE__ @@ -662,7 +666,7 @@ /* an interface was specified and it is not the * current one */ DEBUG_INFO3("Found interface %d but expecting %d", - interface_number, interface); + interface, interface_number); DEBUG_INFO3("Wrong interface for USB device %d/%d." " Checking next one.", bus_number, device_address); @@ -676,8 +680,8 @@ if (r < 0) { (void)libusb_close(dev_handle); - DEBUG_CRITICAL4("Can't claim interface %d/%d: %d", - bus_number, device_address, r); + DEBUG_CRITICAL4("Can't claim interface %d/%d: %s", + bus_number, device_address, libusb_error_name(r)); claim_failed = TRUE; interface_number = -1; continue; @@ -702,7 +706,7 @@ /* reset for a next reader */ if (static_interface > 2) - static_interface = 1; + static_interface = (FEITIANR502DUAL == readerID) ? 0: 1; #endif /* Get Endpoints values*/ @@ -858,7 +862,6 @@ usbDevice[reader_index].ccid.sIFD_serial_number = NULL; usbDevice[reader_index].ccid.gemalto_firmware_features = NULL; - usbDevice[reader_index].ccid.zlp = FALSE; if (desc.iSerialNumber) { unsigned char serial[128]; @@ -980,7 +983,7 @@ } // Create thread for card detection - r = pthread_create(&usbDevice[reader_index].hThread, NULL, CardDetectionThread, &reader_index); + r = pthread_create(&usbDevice[reader_index].hThread, NULL, CardDetectionThread, (void *) (intptr_t) reader_index); if (r != 0) { pthread_mutex_destroy(usbDevice[reader_index].pTransferLock); @@ -1000,6 +1003,20 @@ end: if (usbDevice[reader_index].dev_handle == NULL) { + /* free the libusb allocated list & devices */ + libusb_free_device_list(devs, 1); + +#ifdef __APPLE__ + /* give some time to libusb to detect the new USB devices on Mac OS X */ + if (count_libusb > 0) + { + count_libusb--; + DEBUG_INFO2("Wait after libusb: %d", count_libusb); + nanosleep(&sleep_time, NULL); + + goto again_libusb; + } +#endif close_libusb_if_needed(); if (claim_failed) return STATUS_COMM_ERROR; @@ -1041,16 +1058,6 @@ (void)snprintf(debug_header, sizeof(debug_header), "-> %06X ", (int)reader_index); - if (usbDevice[reader_index].ccid.zlp) - { /* Zero Length Packet */ - int dummy_length; - - /* try to read a ZLP so transfer length = 0 - * timeout of 1 ms */ - (void)libusb_bulk_transfer(usbDevice[reader_index].dev_handle, - usbDevice[reader_index].bulk_in, NULL, 0, &dummy_length, 1); - } - // Fix APG8201 and ACR85 ICC cannot receive command properly // Add delay for APG8201 and ACR85 ICC if ((usbDevice[reader_index].ccid.readerID == ACS_APG8201) || @@ -1059,6 +1066,9 @@ delayed = TRUE; } + // Workaround for ACR122U reader + usbDevice[reader_index].last_write_size = length; + // Send command by dividing number of packets pos = 0; while (length > 0) @@ -1078,9 +1088,9 @@ { DEBUG_CRITICAL5("write failed (%d/%d): %d %s", usbDevice[reader_index].bus_number, - usbDevice[reader_index].device_address, rv, strerror(errno)); + usbDevice[reader_index].device_address, rv, libusb_error_name(rv)); - if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv)) + if (LIBUSB_ERROR_NO_DEVICE == rv) return STATUS_NO_SUCH_DEVICE; return STATUS_UNSUCCESSFUL; @@ -1139,9 +1149,9 @@ *length = 0; DEBUG_CRITICAL5("read failed (%d/%d): %d %s", usbDevice[reader_index].bus_number, - usbDevice[reader_index].device_address, rv, strerror(errno)); + usbDevice[reader_index].device_address, rv, libusb_error_name(rv)); - if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv)) + if (LIBUSB_ERROR_NO_DEVICE == rv) return STATUS_NO_SUCH_DEVICE; return STATUS_UNSUCCESSFUL; @@ -1198,9 +1208,9 @@ *length = 0; DEBUG_CRITICAL5("read failed (%d/%d): %d %s", usbDevice[reader_index].bus_number, - usbDevice[reader_index].device_address, rv, strerror(errno)); + usbDevice[reader_index].device_address, rv, libusb_error_name(rv)); - if ((ENODEV == errno) || (LIBUSB_ERROR_NO_DEVICE == rv)) + if (LIBUSB_ERROR_NO_DEVICE == rv) return STATUS_NO_SUCH_DEVICE; return STATUS_UNSUCCESSFUL; @@ -1214,6 +1224,12 @@ if ((*length >= BSEQ_OFFSET) && (buffer[BSEQ_OFFSET] < *ccid_descriptor->pbSeq -1)) { + // Workaround for ACR122U reader + if ((ccid_descriptor->readerID == ACS_ACR122U) && + (usbDevice[reader_index].last_write_size > 64) && + (buffer[BSEQ_OFFSET] == *ccid_descriptor->pbSeq -2)) + return STATUS_SUCCESS; + duplicate_frame++; if (duplicate_frame > 10) { @@ -1608,7 +1624,7 @@ { DEBUG_CRITICAL5("control failed (%d/%d): %d %s", usbDevice[reader_index].bus_number, - usbDevice[reader_index].device_address, ret, strerror(errno)); + usbDevice[reader_index].device_address, ret, libusb_error_name(ret)); return ret; } @@ -1735,7 +1751,7 @@ /* if libusb_interrupt_transfer() times out we get EILSEQ or EAGAIN */ DEBUG_COMM4("InterruptRead (%d/%d): %s", usbDevice[reader_index].bus_number, - usbDevice[reader_index].device_address, strerror(errno)); + usbDevice[reader_index].device_address, libusb_error_name(ret)); return_value = IFD_COMMUNICATION_ERROR; } @@ -2021,7 +2037,6 @@ interrupt_mask = 0x02 << (2 * (usbDevice[reader_index].ccid.bCurrentSlotIndex % 4)); /* Wait until the condition is signaled or a timeout occurs */ - pthread_mutex_lock(&msExt->mutex); gettimeofday(&local_time, NULL); cond_wait_until.tv_sec = local_time.tv_sec; cond_wait_until.tv_nsec = local_time.tv_usec * 1000; @@ -2030,6 +2045,8 @@ cond_wait_until.tv_nsec += 1000000 * (timeout % 1000); again: + pthread_mutex_lock(&msExt->mutex); + rv = pthread_cond_timedwait(&msExt->condition, &msExt->mutex, &cond_wait_until); @@ -2150,7 +2167,7 @@ // Card detection thread static void *CardDetectionThread(void *pParam) { - int reader_index = *((int *) pParam); + int reader_index = (int) pParam; int rv = 0; int status = 0; int actual_length = 0; @@ -2240,6 +2257,15 @@ libusb_free_transfer(transfer); + /* Break if the device was disconnected. */ + if (status == LIBUSB_TRANSFER_NO_DEVICE) + { + DEBUG_COMM3("%d/%d: Device disconnected", + usbDevice[reader_index].bus_number, + usbDevice[reader_index].device_address); + break; + } + switch (status) { case LIBUSB_TRANSFER_COMPLETED: @@ -2311,6 +2337,7 @@ usbDevice[reader_index].bus_number, usbDevice[reader_index].device_address); - return ((void *) 0); + pthread_exit(NULL); + return NULL; } #endif diff -Nru acsccid-1.1.0/src/ccid_usb.h acsccid-1.1.1/src/ccid_usb.h --- acsccid-1.1.0/src/ccid_usb.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ccid_usb.h 2015-06-03 09:46:42.000000000 +0000 @@ -18,7 +18,7 @@ */ /* - * $Id: ccid_usb.h 5473 2011-01-04 09:52:26Z rousseau $ + * $Id$ */ #ifndef __CCID_USB_H__ diff -Nru acsccid-1.1.0/src/commands.c acsccid-1.1.1/src/commands.c --- acsccid-1.1.0/src/commands.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/commands.c 2015-08-10 06:03:08.000000000 +0000 @@ -2,7 +2,7 @@ commands.c: Commands sent to the card Copyright (C) 2003-2010 Ludovic Rousseau Copyright (C) 2005 Martin Paljak - Copyright (C) 2010-2014 Advanced Card Systems Ltd. + Copyright (C) 2010-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -20,7 +20,7 @@ */ /* - * $Id: commands.c 6975 2014-09-04 11:33:05Z rousseau $ + * $Id$ */ #include @@ -49,6 +49,7 @@ #include "defs.h" #include "ccid_ifdhandler.h" #include "debug.h" +#include "utils.h" /* All the pinpad readers I used are more or less bogus * I use code to change the user command and make the firmware happy */ @@ -179,7 +180,7 @@ /* Status Information? */ if (0x40 == tmp[0]) - ccid_error(tmp[2], __FILE__, __LINE__, __FUNCTION__); + ccid_error(PCSC_LOG_ERROR, tmp[2], __FILE__, __LINE__, __FUNCTION__); return IFD_COMMUNICATION_ERROR; } @@ -246,7 +247,7 @@ if (buffer[STATUS_OFFSET] & CCID_COMMAND_FAILED) { - ccid_error(buffer[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + ccid_error(PCSC_LOG_ERROR, buffer[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ if (0xBB == buffer[ERROR_OFFSET] && /* Protocol error in EMV mode */ ((GEMPC433 == ccid_descriptor->readerID) @@ -325,7 +326,19 @@ if (TxLength < 19+4 /* 4 = APDU size */) /* command too short? */ { DEBUG_INFO3("Command too short: %d < %d", TxLength, 19+4); - return IFD_NOT_SUPPORTED; + + /* 6B 80: Invalid parameter in passed structure */ + if (*RxLength < 2) + { + return IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6B; + RxBuffer[1] = 0x80; + *RxLength = 2; + return IFD_SUCCESS; + } } /* On little endian machines we are all set. */ @@ -345,7 +358,19 @@ if (dw2i(TxBuffer, 15) + 19 != TxLength) /* ulDataLength field coherency */ { DEBUG_INFO3("Wrong lengths: %d %d", dw2i(TxBuffer, 15) + 19, TxLength); - return IFD_NOT_SUPPORTED; + + /* 6B 80: Invalid parameter in passed structure */ + if (*RxLength < 2) + { + return IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6B; + RxBuffer[1] = 0x80; + *RxLength = 2; + return IFD_SUCCESS; + } } /* make sure bEntryValidationCondition is valid @@ -659,7 +684,19 @@ if (TxLength < 24+4 /* 4 = APDU size */) /* command too short? */ { DEBUG_INFO3("Command too short: %d < %d", TxLength, 24+4); - return IFD_NOT_SUPPORTED; + + /* 6B 80: Invalid parameter in passed structure */ + if (*RxLength < 2) + { + return IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6B; + RxBuffer[1] = 0x80; + *RxLength = 2; + return IFD_SUCCESS; + } } /* On little endian machines we are all set. */ @@ -680,7 +717,19 @@ if (dw2i(TxBuffer, 20) + 24 != TxLength) /* ulDataLength field coherency */ { DEBUG_INFO3("Wrong lengths: %d %d", dw2i(TxBuffer, 20) + 24, TxLength); - return IFD_NOT_SUPPORTED; + + /* 6B 80: Invalid parameter in passed structure */ + if (*RxLength < 2) + { + return IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6B; + RxBuffer[1] = 0x80; + *RxLength = 2; + return IFD_SUCCESS; + } } /* Make sure in the beginning if bNumberMessage is valid or not. @@ -688,7 +737,19 @@ if ((TxBuffer[11] > 3) && (TxBuffer[11] != 0xFF)) { DEBUG_INFO2("Wrong bNumberMessage: %d", TxBuffer[11]); - return IFD_NOT_SUPPORTED; + + /* 6B 80: Invalid parameter in passed structure */ + if (*RxLength < 2) + { + return IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6B; + RxBuffer[1] = 0x80; + *RxLength = 2; + return IFD_SUCCESS; + } } /* Make sure bEntryValidationCondition is valid @@ -885,6 +946,21 @@ const unsigned char TxBuffer[], unsigned int TxLength, unsigned char RxBuffer[], unsigned int *RxLength, unsigned int timeout) { + return CmdEscapeCheck(reader_index, TxBuffer, TxLength, RxBuffer, RxLength, + timeout, FALSE); +} /* CmdEscape */ + + +/***************************************************************************** + * + * Escape (with check of gravity) + * + ****************************************************************************/ +RESPONSECODE CmdEscapeCheck(unsigned int reader_index, + const unsigned char TxBuffer[], unsigned int TxLength, + unsigned char RxBuffer[], unsigned int *RxLength, unsigned int timeout, + int mayfail) +{ unsigned char *cmd_in, *cmd_out; status_t res; unsigned int length_in, length_out; @@ -980,7 +1056,9 @@ if (cmd_out[STATUS_OFFSET] & CCID_COMMAND_FAILED) { - ccid_error(cmd_out[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + /* mayfail: the error may be expected and not fatal */ + ccid_error(mayfail ? PCSC_LOG_INFO : PCSC_LOG_ERROR, + cmd_out[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ return_value = IFD_COMMUNICATION_ERROR; } @@ -998,7 +1076,7 @@ ccid_descriptor -> readTimeout = old_read_timeout; return return_value; -} /* Escape */ +} /* EscapeCheck */ /***************************************************************************** @@ -1082,7 +1160,7 @@ if (cmd[STATUS_OFFSET] & CCID_COMMAND_FAILED) { - ccid_error(cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + ccid_error(PCSC_LOG_ERROR, cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ return_value = IFD_COMMUNICATION_ERROR; } @@ -1203,7 +1281,7 @@ && (buffer[ERROR_OFFSET] != 0xFE)) { return_value = IFD_COMMUNICATION_ERROR; - ccid_error(buffer[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + ccid_error(PCSC_LOG_ERROR, buffer[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ } return return_value; @@ -1449,7 +1527,7 @@ case 0x40: /* Status Information */ - ccid_error(rx_buffer[2], __FILE__, __LINE__, __FUNCTION__); + ccid_error(PCSC_LOG_ERROR, rx_buffer[2], __FILE__, __LINE__, __FUNCTION__); return IFD_COMMUNICATION_ERROR; case 0x80: @@ -1508,22 +1586,30 @@ if (cmd[STATUS_OFFSET] & CCID_COMMAND_FAILED) { - ccid_error(cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + ccid_error(PCSC_LOG_ERROR, cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ switch (cmd[ERROR_OFFSET]) { case 0xFF: // Abort // ACR83U, ACR85 and APG8201 // Invalid parameter in PIN verification/modification data structure if (*rx_length < 2) - return IFD_COMMUNICATION_ERROR; + return IFD_ERROR_INSUFFICIENT_BUFFER; rx_buffer[0]= 0x6B; rx_buffer[1]= 0x80; *rx_length = 2; return IFD_SUCCESS; + case 0x84: // Two "new PIN" entries do not match. + if (*rx_length < 2) + return IFD_ERROR_INSUFFICIENT_BUFFER; + rx_buffer[0]= 0x64; + rx_buffer[1]= 0x02; + *rx_length = 2; + return IFD_SUCCESS; + case 0xEF: /* cancel */ if (*rx_length < 2) - return IFD_COMMUNICATION_ERROR; + return IFD_ERROR_INSUFFICIENT_BUFFER; rx_buffer[0]= 0x64; rx_buffer[1]= 0x01; *rx_length = 2; @@ -1531,7 +1617,7 @@ case 0xF0: /* timeout */ if (*rx_length < 2) - return IFD_COMMUNICATION_ERROR; + return IFD_ERROR_INSUFFICIENT_BUFFER; rx_buffer[0]= 0x64; rx_buffer[1]= 0x00; *rx_length = 2; @@ -2274,7 +2360,7 @@ if (cmd[STATUS_OFFSET] & CCID_COMMAND_FAILED) { - ccid_error(cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ + ccid_error(PCSC_LOG_ERROR, cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__); /* bError */ if (0x00 == cmd[ERROR_OFFSET]) /* command not supported */ return IFD_NOT_SUPPORTED; else diff -Nru acsccid-1.1.0/src/commands.h acsccid-1.1.1/src/commands.h --- acsccid-1.1.0/src/commands.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/commands.h 2015-06-03 09:46:42.000000000 +0000 @@ -18,7 +18,7 @@ */ /* - * $Id: commands.h 6783 2013-10-24 09:36:52Z rousseau $ + * $Id$ */ #define SIZE_GET_SLOT_STATUS 10 @@ -41,6 +41,11 @@ const unsigned char TxBuffer[], unsigned int TxLength, unsigned char RxBuffer[], unsigned int *RxLength, unsigned int timeout); +RESPONSECODE CmdEscapeCheck(unsigned int reader_index, + const unsigned char TxBuffer[], unsigned int TxLength, + unsigned char RxBuffer[], unsigned int *RxLength, unsigned int timeout, + int mayfail); + RESPONSECODE CmdPowerOff(unsigned int reader_index); RESPONSECODE CmdGetSlotStatus(unsigned int reader_index, diff -Nru acsccid-1.1.0/src/debug.c acsccid-1.1.1/src/debug.c --- acsccid-1.1.0/src/debug.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/debug.c 2015-06-03 09:46:42.000000000 +0000 @@ -18,7 +18,7 @@ */ /* - * $Id: debug.c 6975 2014-09-04 11:33:05Z rousseau $ + * $Id$ */ @@ -32,6 +32,10 @@ #include #include +#ifdef USE_SYSLOG +#include +#endif + #include "strlcpycat.h" #undef LOG_TO_STDERR @@ -50,6 +54,24 @@ struct timeval new_time = { 0, 0 }; struct timeval tmp; int delta; +#ifdef USE_SYSLOG + int syslog_level; + + switch(priority) + { + case PCSC_LOG_CRITICAL: + syslog_level = LOG_CRIT; + break; + case PCSC_LOG_ERROR: + syslog_level = LOG_ERR; + break; + case PCSC_LOG_INFO: + syslog_level = LOG_INFO; + break; + default: + syslog_level = LOG_DEBUG; + } +#else const char *color_pfx = "", *color_sfx = ""; const char *time_pfx = "", *time_sfx = ""; static int initialized = 0; @@ -105,6 +127,7 @@ break; } } +#endif gettimeofday(&new_time, NULL); if (0 == last_time.tv_sec) @@ -128,9 +151,13 @@ (void)vsnprintf(debug_buffer, sizeof debug_buffer, fmt, argptr); va_end(argptr); +#ifdef USE_SYSLOG + syslog(syslog_level, "%.8d %s", delta, debug_buffer); +#else (void)fprintf(LOG_STREAM, "%s%.8d%s %s%s%s\n", time_pfx, delta, time_sfx, color_pfx, debug_buffer, color_sfx); fflush(LOG_STREAM); +#endif } /* log_msg */ void log_xxd(const int priority, const char *msg, const unsigned char *buffer, @@ -152,6 +179,10 @@ c += 3; } +#ifdef USE_SYSLOG + syslog(LOG_DEBUG, "%s", debug_buffer); +#else (void)fprintf(LOG_STREAM, "%s\n", debug_buffer); fflush(LOG_STREAM); +#endif } /* log_xxd */ diff -Nru acsccid-1.1.0/src/debug.h acsccid-1.1.1/src/debug.h --- acsccid-1.1.0/src/debug.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/debug.h 2015-06-03 09:46:42.000000000 +0000 @@ -18,7 +18,7 @@ */ /* - * $Id: debug.h 6967 2014-09-02 13:50:50Z rousseau $ + * $Id$ */ /* diff -Nru acsccid-1.1.0/src/defs.h acsccid-1.1.1/src/defs.h --- acsccid-1.1.0/src/defs.h 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/defs.h 2015-06-03 09:46:42.000000000 +0000 @@ -19,7 +19,7 @@ */ /* - * $Id: defs.h 6926 2014-06-17 09:22:00Z rousseau $ + * $Id$ */ #include diff -Nru acsccid-1.1.0/src/ifdhandler.c acsccid-1.1.1/src/ifdhandler.c --- acsccid-1.1.0/src/ifdhandler.c 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/ifdhandler.c 2015-10-27 09:22:43.000000000 +0000 @@ -1,7 +1,7 @@ /* ifdhandler.c: IFDH API Copyright (C) 2003-2010 Ludovic Rousseau - Copyright (C) 2009-2014 Advanced Card Systems Ltd. + Copyright (C) 2009-2015 Advanced Card Systems Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -18,7 +18,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* $Id: ifdhandler.c 6977 2014-09-04 11:36:54Z rousseau $ */ +/* $Id$ */ #include @@ -86,6 +86,9 @@ static unsigned int T1_card_timeout(double f, double d, int TC1, int BWI, int CWI, int clock_frequency); static int get_IFSC(ATR_t *atr, int *i); +static RESPONSECODE process_spe_ppdu(unsigned int reader_index, + unsigned char TxBuffer[], unsigned int TxLength, + unsigned char RxBuffer[], unsigned int *RxLength); static RESPONSECODE CreateChannelByNameOrChannel(DWORD Lun, @@ -383,7 +386,7 @@ * TAG_IFD_POLLING_THREAD_KILLABLE then we could use a much longer delay * and be killed before pcscd exits */ - (void)usleep(timeout); + (void)usleep(timeout * 1000); return IFD_SUCCESS; } @@ -413,7 +416,7 @@ * ignore Lun. * * Tag - the tag for the information requested example: TAG_IFD_ATR - - * return the Atr and it's size (required). these tags are defined in + * return the Atr and its size (required). these tags are defined in * ifdhandler.h * * Length - the length of the returned data Value - the value of the @@ -525,6 +528,9 @@ (ACS_ACR1251K_DUAL_READER == readerID) || (ACS_ACR1252_1S_CL_READER == readerID)) *Value = 2; + + if (FEITIANR502DUAL == readerID) + *Value = 3; } #endif DEBUG_INFO2("Reader supports %d slot(s)", *Value); @@ -1258,7 +1264,7 @@ * Action - Action to be taken on the card. * * IFD_POWER_UP - Power and reset the card if not done so (store the - * ATR and return it and it's length). + * ATR and return it and its length). * * IFD_POWER_DOWN - Power down the card if not done already * (Atr/AtrLength should be zero'd) @@ -1268,7 +1274,7 @@ * * Atr - Answer to Reset of the card. The driver is responsible for * caching this value in case IFDHGetCapabilities is called requesting - * the ATR and it's length. This should not exceed MAX_ATR_SIZE. + * the ATR and its length. This should not exceed MAX_ATR_SIZE. * * AtrLength - Length of the Atr. This should not exceed * MAX_ATR_SIZE. @@ -1672,6 +1678,16 @@ } } + /* Process SPE pseudo APDU (PC/SC v2.02.02 Part 10 Supplement). */ + if ((TxLength > 3) + && (memcmp(TxBuffer, "\xFF\xC2\x01", 3) == 0)) + { + rx_length = *RxLength; + return_value = process_spe_ppdu(reader_index, TxBuffer, TxLength, + RxBuffer, &rx_length); + goto err; + } + rx_length = *RxLength; return_value = CcidSlots[reader_index].pXfrBlock(reader_index, TxLength, TxBuffer, &rx_length, RxBuffer, SendPci.Protocol); @@ -1885,7 +1901,8 @@ iBytesReturned += sizeof(PCSC_TLV_STRUCTURE); // APG8201Z supports vendor specific feature - if (ACS_APG8201Z == ccid_descriptor -> readerID) + if ((ACS_APG8201Z == ccid_descriptor -> readerID) + || (ACS_APG8201Z2 == ccid_descriptor -> readerID)) { pcsc_tlv -> tag = 0x80; pcsc_tlv -> length = 0x04; /* always 0x04 */ @@ -2056,7 +2073,8 @@ /* ACR83, APG8201 and APG8201Z */ if ((ACS_ACR83U == ccid_descriptor -> readerID) || (ACS_APG8201 == ccid_descriptor -> readerID) - || (ACS_APG8201Z == ccid_descriptor -> readerID)) + || (ACS_APG8201Z == ccid_descriptor -> readerID) + || (ACS_APG8201Z2 == ccid_descriptor -> readerID)) { /* bMinPINSize */ RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bMinPINSize; @@ -2077,9 +2095,10 @@ /* bPPDUSupport */ RxBuffer[p++] = PCSCv2_PART10_PROPERTY_bPPDUSupport; RxBuffer[p++] = 1; /* length */ - RxBuffer[p++] = 1; + RxBuffer[p++] = 0x03; /* bit0: PPDU is supported over SCardControl using - * FEATURE_CCID_ESC_COMMAND */ + * FEATURE_CCID_ESC_COMMAND + * bit1: PPDU is supported over SCardTransmit */ /* wIdVendor */ { @@ -2189,7 +2208,8 @@ if ((ACS_ACR83U == ccid_descriptor -> readerID) || (ACS_ACR85_PINPAD_READER_ICC == ccid_descriptor -> readerID) || (ACS_APG8201 == ccid_descriptor -> readerID) || - (ACS_APG8201Z == ccid_descriptor -> readerID)) + (ACS_APG8201Z == ccid_descriptor -> readerID) || + (ACS_APG8201Z2 == ccid_descriptor -> readerID)) { // Get firmware version if (IOCTL_SMARTCARD_GET_FIRMWARE_VERSION == dwControlCode) @@ -2909,3 +2929,333 @@ return ifsc; } /* get_IFSC */ + +static RESPONSECODE process_spe_ppdu(unsigned int reader_index, + unsigned char TxBuffer[], unsigned int TxLength, + unsigned char RxBuffer[], unsigned int *RxLength) +{ + RESPONSECODE ret = IFD_SUCCESS; + _ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index); + int supported = FALSE; + unsigned char buffer[43]; + unsigned int length = 0; + unsigned int tmp = 0; + + /* P2: Feature Number */ + switch (TxBuffer[3]) + { + case 0: /* GET_FEATURE_REQUEST */ + supported = TRUE; + + if (ccid_descriptor->bPINSupport & CCID_CLASS_PIN_VERIFY) + { + buffer[length++] = FEATURE_VERIFY_PIN_DIRECT; + } + + if (ccid_descriptor->bPINSupport & CCID_CLASS_PIN_MODIFY) + { + buffer[length++] = FEATURE_MODIFY_PIN_DIRECT; + } + + if (ccid_descriptor->bPINSupport) + { + buffer[length++] = FEATURE_IFD_PIN_PROPERTIES; + } + + buffer[length++] = FEATURE_GET_TLV_PROPERTIES; + buffer[length++] = FEATURE_CCID_ESC_COMMAND; + + if ((ccid_descriptor->readerID == ACS_APG8201Z) + || (ccid_descriptor->readerID == ACS_APG8201Z2)) + { + buffer[length++] = 0x80; + } + + /* 90 00: Feature executed successfully. */ + if (*RxLength < length + 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + memcpy(RxBuffer, buffer, length); + length += 2; + RxBuffer[length - 2] = 0x90; + RxBuffer[length - 1] = 0x00; + *RxLength = length; + } + break; + + case FEATURE_VERIFY_PIN_DIRECT: + if (ccid_descriptor->bPINSupport & CCID_CLASS_PIN_VERIFY) + { + supported = TRUE; + + /* Check the length and Lc. */ + /* Minimum Length: CLA + INS + P1 + P2 + Lc + data */ + if ((TxLength < 6) || (TxBuffer[4] != TxLength - 5)) + { + /* 67 00: Wrong length; no further indication */ + if (*RxLength < 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x67; + RxBuffer[1] = 0x00; + *RxLength = 2; + } + } + else + { + tmp = *RxLength; + ret = SecurePINVerify(reader_index, TxBuffer + 5, TxLength - 5, + RxBuffer, &tmp); + *RxLength = tmp; + } + } + break; + + case FEATURE_MODIFY_PIN_DIRECT: + if (ccid_descriptor->bPINSupport & CCID_CLASS_PIN_MODIFY) + { + supported = TRUE; + + /* Check the length and Lc. */ + /* Minimum Length: CLA + INS + P1 + P2 + Lc + data */ + if ((TxLength < 6) || (TxBuffer[4] != TxLength - 5)) + { + /* 67 00: Wrong length; no further indication */ + if (*RxLength < 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x67; + RxBuffer[1] = 0x00; + *RxLength = 2; + } + } + else + { + tmp = *RxLength; + ret = SecurePINModify(reader_index, TxBuffer + 5, TxLength - 5, + RxBuffer, &tmp); + *RxLength = tmp; + } + } + break; + + case FEATURE_IFD_PIN_PROPERTIES: + if (ccid_descriptor->bPINSupport) + { + supported = TRUE; + + if (*RxLength < 6) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = ccid_descriptor->wLcdLayout & 0xFF; + RxBuffer[1] = (ccid_descriptor->wLcdLayout >> 8) & 0xFF; + RxBuffer[2] = 0x07; /* bEntryValidationCondition */ + RxBuffer[3] = 0x00; /* bTimeOut2 */ + RxBuffer[4] = 0x90; + RxBuffer[5] = 0x00; + *RxLength = 6; + } + } + break; + + case FEATURE_GET_TLV_PROPERTIES: + supported = TRUE; + + /* wLcdLayout */ + buffer[length++] = PCSCv2_PART10_PROPERTY_wLcdLayout; + buffer[length++] = 2; + buffer[length++] = ccid_descriptor->wLcdLayout & 0xFF; + buffer[length++] = (ccid_descriptor->wLcdLayout >> 8) & 0xFF; + + if (ccid_descriptor->wLcdLayout) + { + /* wLcdMaxCharacters */ + buffer[length++] = PCSCv2_PART10_PROPERTY_wLcdMaxCharacters; + buffer[length++] = 2; + tmp = ccid_descriptor->wLcdLayout & 0xFF; + buffer[length++] = tmp & 0xFF; + buffer[length++] = (tmp >> 8) & 0xFF; + + /* wLcdMaxLines */ + buffer[length++] = PCSCv2_PART10_PROPERTY_wLcdMaxLines; + buffer[length++] = 2; + tmp = (ccid_descriptor->wLcdLayout >> 8) & 0xFF; + buffer[length++] = tmp & 0xFF; + buffer[length++] = (tmp >> 8) & 0xFF; + } + + /* bTimeOut2 */ + buffer[length++] = PCSCv2_PART10_PROPERTY_bTimeOut2; + buffer[length++] = 1; + buffer[length++] = 0x00; + + /* ACR83, APG8201 and APG8201Z. */ + if ((ccid_descriptor->readerID == ACS_ACR83U) + || (ccid_descriptor->readerID == ACS_APG8201) + || (ccid_descriptor->readerID == ACS_APG8201Z) + || (ccid_descriptor->readerID == ACS_APG8201Z2)) + { + /* bMinPINSize */ + buffer[length++] = PCSCv2_PART10_PROPERTY_bMinPINSize; + buffer[length++] = 1; + buffer[length++] = 1; + + /* bMaxPINSize */ + buffer[length++] = PCSCv2_PART10_PROPERTY_bMaxPINSize; + buffer[length++] = 1; + buffer[length++] = 16; + + /* bEntryValidationCondition */ + buffer[length++] = PCSCv2_PART10_PROPERTY_bEntryValidationCondition; + buffer[length++] = 1; + buffer[length++] = 0x07; + } + + /* bPPDUSupport */ + buffer[length++] = PCSCv2_PART10_PROPERTY_bPPDUSupport; + buffer[length++] = 1; + buffer[length++] = 0x03; + + /* wIdVendor */ + tmp = (ccid_descriptor->readerID >> 16) & 0xFFFF; + buffer[length++] = PCSCv2_PART10_PROPERTY_wIdVendor; + buffer[length++] = 2; + buffer[length++] = tmp & 0xFF; + buffer[length++] = (tmp >> 8) & 0xFF; + + /* wIdProduct */ + tmp = ccid_descriptor->readerID & 0xFFFF; + buffer[length++] = PCSCv2_PART10_PROPERTY_wIdProduct; + buffer[length++] = 2; + buffer[length++] = tmp & 0xFF; + buffer[length++] = (tmp >> 8) & 0xFF; + + /* dwMaxAPDUDataSize */ + /* Short APDU only by default */ + tmp = 0; + + /* Reader is TPDU or extended APDU. */ + if ((ccid_descriptor->dwFeatures & CCID_CLASS_EXTENDED_APDU) + || (ccid_descriptor->dwFeatures & CCID_CLASS_TPDU)) + { + tmp = 0x10000; + } + + buffer[length++] = PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize; + buffer[length++] = 4; + buffer[length++] = tmp & 0xFF; + buffer[length++] = (tmp >> 8) & 0xFF; + buffer[length++] = (tmp >> 16) & 0xFF; + buffer[length++] = (tmp >> 24) & 0xFF; + + /* 90 00: Feature executed successfully. */ + if (*RxLength < length + 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + memcpy(RxBuffer, buffer, length); + length += 2; + RxBuffer[length - 2] = 0x90; + RxBuffer[length - 1] = 0x00; + *RxLength = length; + } + break; + + case FEATURE_CCID_ESC_COMMAND: + supported = TRUE; + + /* Check the length and Lc. */ + /* Minimum Length: CLA + INS + P1 + P2 + Lc + data */ + if ((TxLength < 6) || (TxBuffer[4] != TxLength - 5)) + { + /* 67 00: Wrong length; no further indication */ + if (*RxLength < 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x67; + RxBuffer[1] = 0x00; + *RxLength = 2; + } + } + else + { + tmp = *RxLength; + ret = CmdEscape(reader_index, TxBuffer + 5, TxLength - 5, RxBuffer, + &tmp, -1); + if (ret == IFD_SUCCESS) + { + /* 90 00: Feature executed successfully. */ + if (*RxLength < tmp + 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + tmp += 2; + RxBuffer[tmp - 2] = 0x90; + RxBuffer[tmp - 1] = 0x00; + *RxLength = tmp; + } + } + } + break; + + case 0x80: + if ((ccid_descriptor->readerID == ACS_APG8201Z) + || (ccid_descriptor->readerID == ACS_APG8201Z2)) + { + supported = TRUE; + + /* 90 00: Feature executed successfully. */ + if (*RxLength < 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x90; + RxBuffer[1] = 0x00; + *RxLength = 2; + } + } + break; + + default: + break; + } + + if (!supported) + { + /* 6A 86: Incorrect value for P2 (requested feature not present) */ + if (*RxLength < 2) + { + ret = IFD_ERROR_INSUFFICIENT_BUFFER; + } + else + { + RxBuffer[0] = 0x6A; + RxBuffer[1] = 0x86; + *RxLength = 2; + } + } + + return ret; +} /* process_spe_ppdu */ + diff -Nru acsccid-1.1.0/src/Info.plist.src acsccid-1.1.1/src/Info.plist.src --- acsccid-1.1.0/src/Info.plist.src 2014-12-10 08:32:26.000000000 +0000 +++ acsccid-1.1.1/src/Info.plist.src 2015-10-27 09:46:14.000000000 +0000 @@ -54,18 +54,18 @@ 0x0000