Hello community,
here is the log from the commit of package libchipcard for openSUSE:Factory
checked in at Thu Aug 4 10:08:07 CEST 2011.
--------
--- libchipcard/libchipcard.changes 2011-01-07 15:35:38.000000000 +0100
+++ /mounts/work_src_done/STABLE/libchipcard/libchipcard.changes 2011-06-11 23:41:47.000000000 +0200
@@ -1,0 +2,8 @@
+Sat Jun 11 21:36:33 UTC 2011 - Nico.Laus.2001@gmx.de
+
+- Update to version 5.0.2
+ + now works with the newest pcsclite
+ + 'kvkcard read' works again with card readers understanding the
+ "RAW" protocol
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libchipcard-5.0.0.tar.bz2
libchipcard-pcsc-lite-upgrade.patch
New:
----
libchipcard-5.0.2.tar.bz2
libchipcard-rpmlintrc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libchipcard.spec ++++++
--- /var/tmp/diff_new_pack.opYbmt/_old 2011-08-04 10:07:41.000000000 +0200
+++ /var/tmp/diff_new_pack.opYbmt/_new 2011-08-04 10:07:41.000000000 +0200
@@ -18,15 +18,16 @@
Name: libchipcard
-Version: 5.0.0
-Release: 2
+Version: 5.0.2
+Release: 1
License: GPLv2+
Summary: Library That Allows Easy Access to Smart Cards (Chipcards)
Url: http://www.aquamaniac.de/sites/libchipcard/index.php
Group: Hardware/Other
Source: %{name}-%{version}.tar.bz2
+#Source: http://www.aquamaniac.de/sites/download/download.php?package=02&release=26&file=01&dummy=libchipcard-5.0.2.tar.gz
+Source100: libchipcard-rpmlintrc
Patch0: libchipcard-buildsrcdoc.patch
-Patch1: libchipcard-pcsc-lite-upgrade.patch
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: graphviz
@@ -35,6 +36,7 @@
BuildRequires: gwenhywfar-tools
BuildRequires: pcsc-lite-devel
BuildRequires: zlib-devel
+BuildRequires: fdupes
PreReq: %insserv_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -74,9 +76,7 @@
%prep
%setup -q
%patch0 -p1
-# Port to pcsc-lite-1.6:
-%patch1 -p1
-# And update clones of include files to prevent clash:
+# And update clones of include files to prevent clash:
cp -a /usr/include/PCSC/*.h src/PCSC/
%build
@@ -95,6 +95,8 @@
cp -a AUTHORS COPYING ChangeLog NEWS README TODO apidoc %{buildroot}%{_docdir}/%{name}
rm %{buildroot}%{_libdir}/*.la
+%fdupes %{buildroot}%{_docdir}/%{name}/apidoc
+
%clean
rm -rf %{buildroot}
++++++ libchipcard-5.0.0.tar.bz2 -> libchipcard-5.0.2.tar.bz2 ++++++
++++ 2529 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/ChangeLog new/libchipcard-5.0.2/ChangeLog
--- old/libchipcard-5.0.0/ChangeLog 2010-08-30 13:09:57.000000000 +0200
+++ new/libchipcard-5.0.2/ChangeLog 2010-11-13 18:15:19.000000000 +0100
@@ -1,14 +1,90 @@
------------------------------------------------------------------
-2010-08-30 13:05:10 +0200 Martin Preuss
+2010-11-13 16:57:41 +0000 martin
+Added a test which dumps the first record of the bank information file.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@587 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:39 +0000 martin
+Added missing module.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@586 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:37 +0000 martin
+Added first pin description for ZKA card.
+After verification of PIN 0x03 in DF_NOTEPAD the bank information can be
+read.
+
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@585 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:35 +0000 martin
+Fixed some commands for ZKA cards.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@584 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:33 +0000 martin
+Renamed some zkacard xml files.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@583 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:31 +0000 martin
+Added log messages after execution of APDUs.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@582 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:29 +0000 martin
+LC_Card_ReadBinary: Added a check for end of data.
+The special response 82/82 is now recognized (this flags the end of data
+which isn't in every case an error. In cases were we don't now in advance
+the data size to read the read command simply stops now at EOF).
+
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@581 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:27 +0000 martin
+Added new friendly name of those cyberJacks to reader description file.
+Unfortunately Reiner SCT decided to change the friendly names of their readers
+so the current comparison strings don't match anymore. As a result cyberJacks
+aren't recognized as such but as generic CCID readers. However, this isn't
+much of a problem because the commands are mostly the same.
+
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@580 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 16:57:25 +0000 martin
+Fixed a problem with command PerformVerification_Ascii.
+Maybe we will have to work more on that one, but for now verfication of the
+PIN of a SECCOS card is possible.
+
+However, changing the PIN is not yet possible with those cards, but I will
+address that one later.
+
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@579 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 13:33:35 +0000 martin
+Started working on SECCOS support.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@578 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-11-13 13:33:30 +0000 martin
+Added gource script.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@577 bfc04c16-8f10-0410-8200-ddfbc4d55d47
+
+------------------------------------------------------------------
+2010-08-30 15:08:40 +0000 martin
Prepared release 5.0.0.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@576 bfc04c16-8f10-0410-8200-ddfbc4d55d47
------------------------------------------------------------------
-2010-08-30 13:04:59 +0200 Martin Preuss
+2010-08-30 15:08:39 +0000 martin
Added target for clang, fixed a problem found by clang.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@575 bfc04c16-8f10-0410-8200-ddfbc4d55d47
------------------------------------------------------------------
-2010-08-30 13:04:39 +0200 Martin Preuss
+2010-08-30 15:08:37 +0000 martin
Removed old ChangeLogs, restricted size of new ChangeLog.
+git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@574 bfc04c16-8f10-0410-8200-ddfbc4d55d47
------------------------------------------------------------------
2010-08-25 09:58:49 +0000 martin
@@ -475,58 +551,3 @@
2008-10-04 20:13:22 +0000 martin
Added startup message about LibHAL support to chipcardd.
git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@488 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-10-02 15:46:55 +0000 martin
-Switched from Sysfs to HAL for device detection. CAVE: This version now needs libhal instead of libsysfs. Currently libsysfs can still be used as a fallback but that might change later.
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@487 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-09-14 17:11:33 +0000 martin
-Fixed bugs in LC_Crypt_TokenDDV_Plugin_CheckToken and LC_Crypt_TokenStarcos_Plugin_CheckToken.
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@486 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-09-08 21:13:21 +0000 martin
-Fixed a few bugs in EGK code. - fixed a problem with EGK cards which don't contain the necessary documents. - fixed help string for kvkcard
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@485 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-08-19 10:18:20 +0000 martin
-Prepared release 4.2.0. - use ChangeLog created by git-log
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@484 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-08-18 17:59:17 +0000 martin
-CryptToken for STARCOS cards now works again.
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@483 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-08-18 15:00:30 +0000 martin
-Debug script for starting chipcardd4 now uses /tmp for the PID file.
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@482 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-08-18 15:00:26 +0000 martin
-Fixed a typo in starcos card type.
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@481 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-08-18 15:00:16 +0000 martin
-Tool kvkread now also reads new German medical card ("Elektronische Gesundheitskarte"). - added definition for command SelectMF because it differs from the default command) - functions LC_EgkCard_ReadPd() and ReadVD() have been marked as deprecated; both functions now unzip the data returned, thus returning XML data. NOTE: Libchipcard now requires libz! - added types LC_HI_INSURANCE_DATA and LC_HI_PERSONAL_DATA which can now be filled by KVK cards and EGK cards - added function LC_KvkCard_GetCardNumber() - function LC_KvkCard_GetCardData() has now been marked as deprecated - libtest.c: removed test of deprecated functions
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@480 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-07-28 14:31:04 +0000 martin
-- incremented version
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@479 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-07-28 13:41:32 +0000 martin
-- use value for triggeredScan from settings instead of a fixed value
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@478 bfc04c16-8f10-0410-8200-ddfbc4d55d47
-
-------------------------------------------------------------------
-2008-07-28 13:41:21 +0000 martin
-- allow 0 as value for hardwareScanInterval
-git-svn-id: https://devel.aqbanking.de/svn/libchipcard/trunk@477 bfc04c16-8f10-0410-8200-ddfbc4d55d47
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/configure.ac new/libchipcard-5.0.2/configure.ac
--- old/libchipcard-5.0.0/configure.ac 2010-08-30 13:02:45.000000000 +0200
+++ new/libchipcard-5.0.2/configure.ac 2011-06-11 13:32:02.000000000 +0200
@@ -16,7 +16,7 @@
CHIPCARD_VERSION_MAJOR=5
CHIPCARD_VERSION_MINOR=0
-CHIPCARD_VERSION_PATCHLEVEL=0
+CHIPCARD_VERSION_PATCHLEVEL=2
CHIPCARD_VERSION_BUILD=0
CHIPCARD_VERSION_TAG="stable"
@@ -28,7 +28,7 @@
#
LIBCHIPCARD_SO_CURRENT=6
LIBCHIPCARD_SO_AGE=0
-LIBCHIPCARD_SO_REVISION=0
+LIBCHIPCARD_SO_REVISION=2
LIBCHIPCARD_SO_EFFECTIVE="`echo \$(($LIBCHIPCARD_SO_CURRENT-$LIBCHIPCARD_SO_AGE))`"
#
@@ -643,6 +643,7 @@
src/lib/client/cards/kvkcard/Makefile
src/lib/client/cards/processorcard/Makefile
src/lib/client/cards/starcos/Makefile
+ src/lib/client/cards/zkacard/Makefile
src/lib/client/ct/Makefile
src/ct/Makefile
src/ct/ddvcard/Makefile
@@ -718,7 +719,7 @@
#
lc_modules="cards ct"
-lc_client_card_modules="ddvcard egkcard geldkarte kvkcard starcos memorycard processorcard"
+lc_client_card_modules="ddvcard egkcard geldkarte kvkcard starcos zkacard memorycard processorcard"
lprefix="${srcdir}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/data/drivers/posix/cyberjack_pcsc/card.xml new/libchipcard-5.0.2/data/drivers/posix/cyberjack_pcsc/card.xml
--- old/libchipcard-5.0.0/data/drivers/posix/cyberjack_pcsc/card.xml 2010-04-16 00:55:43.000000000 +0200
+++ new/libchipcard-5.0.2/data/drivers/posix/cyberjack_pcsc/card.xml 2010-11-13 17:39:16.000000000 +0100
@@ -47,13 +47,10 @@
82 00 00
08 04 02
00 00 00 00 00 00 00
- 0d 00 00 00
+ 04 00 00 00
00 20 00
</ELEM>
<ELEM name="pid" type="byte" />
- <ELEM type="bytes" storedAs="bytes" >
- 08 20 20 20 20 20 20 20 20
- </ELEM>
</APDU>
</send>
<results>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/data/drivers/posix/cyberjack_pcsc/cyberjack_pcsc.xml new/libchipcard-5.0.2/data/drivers/posix/cyberjack_pcsc/cyberjack_pcsc.xml
--- old/libchipcard-5.0.0/data/drivers/posix/cyberjack_pcsc/cyberjack_pcsc.xml 2010-04-16 01:11:03.000000000 +0200
+++ new/libchipcard-5.0.2/data/drivers/posix/cyberjack_pcsc/cyberjack_pcsc.xml 2010-11-13 17:38:22.000000000 +0100
@@ -50,7 +50,21 @@
<image>cyberjack_ecom_a.jpg</image>
</reader>
+ <!-- Cyberjack 0x400, after change of friendly name -->
+
+ <short>Cyberjack ecom a</short>
+ <flags>
+ <flag>keypad</flag>
+ <flag>display</flag>
+ </flags>
+ <image>cyberjack_ecom_a.jpg</image>
+ </reader>
+
+
</readers>
+
</driver>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/data/drivers/posix/generic_pcsc/card.xml new/libchipcard-5.0.2/data/drivers/posix/generic_pcsc/card.xml
--- old/libchipcard-5.0.0/data/drivers/posix/generic_pcsc/card.xml 2010-04-16 07:44:41.000000000 +0200
+++ new/libchipcard-5.0.2/data/drivers/posix/generic_pcsc/card.xml 2010-11-13 17:34:07.000000000 +0100
@@ -47,13 +47,10 @@
82 00 00
08 04 02
00 00 00 00 00 00 00
- 0d 00 00 00
+ 04 00 00 00
00 20 00
</ELEM>
<ELEM name="pid" type="byte" />
- <ELEM type="bytes" storedAs="bytes" >
- 08 20 20 20 20 20 20 20 20
- </ELEM>
</APDU>
</send>
<results>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/libchipcard.spec new/libchipcard-5.0.2/libchipcard.spec
--- old/libchipcard-5.0.0/libchipcard.spec 2010-08-30 13:05:56.000000000 +0200
+++ new/libchipcard-5.0.2/libchipcard.spec 2011-06-11 13:35:38.000000000 +0200
@@ -1,10 +1,10 @@
%define name libchipcard
-%define version 5.0.0
+%define version 5.0.2
%define rpm_cxxflags \"-O2 -march=i486 -mcpu=i586\"
%define rpm_cflags \"-O2 -march=i486 -mcpu=i586\"
-%define dist Ubuntu
-%define disttag ubuntu
+%define dist
+%define disttag
%define distver
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/base/card.c new/libchipcard-5.0.2/src/lib/client/base/card.c
--- old/libchipcard-5.0.0/src/lib/client/base/card.c 2010-08-25 11:24:19.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/base/card.c 2010-11-13 15:07:31.000000000 +0100
@@ -1414,6 +1414,9 @@
LC_CLIENT_RESULT res;
while(size>0) {
+ int sw1;
+ int sw2;
+
if (size>252)
t=252;
else
@@ -1429,6 +1432,14 @@
size-=t;
offset+=t;
bytesRead+=t;
+
+ /* check for EOF */
+ sw1=LC_Card_GetLastSW1(card);
+ sw2=LC_Card_GetLastSW2(card);
+ if (sw1==0x62 && sw2==0x82) {
+ DBG_DEBUG(LC_LOGDOMAIN, "EOF met after %d bytes (asked for %d bytes more)", bytesRead, size);
+ break;
+ }
} /* while still data to read */
return LC_Client_ResultOk;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/base/client.c new/libchipcard-5.0.2/src/lib/client/base/client.c
--- old/libchipcard-5.0.0/src/lib/client/base/client.c 2010-08-16 21:45:46.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/base/client.c 2011-06-11 13:25:29.000000000 +0200
@@ -478,19 +478,34 @@
assert(cl);
+ DBG_INFO(LC_LOGDOMAIN, "Trying protocol T1");
rv=SCardConnect(cl->scardContext,
rname,
SCARD_SHARE_EXCLUSIVE,
SCARD_PROTOCOL_T1,
&scardHandle,
&dwActiveProtocol);
- if (rv!=SCARD_S_SUCCESS)
+ if (rv!=SCARD_S_SUCCESS) {
+ DBG_INFO(LC_LOGDOMAIN, "Trying protocol T0");
rv=SCardConnect(cl->scardContext,
rname,
- SCARD_SHARE_EXCLUSIVE,
- SCARD_PROTOCOL_T0,
+ SCARD_SHARE_EXCLUSIVE,
+ SCARD_PROTOCOL_T0,
&scardHandle,
&dwActiveProtocol);
+ }
+#ifdef SCARD_PROTOCOL_RAW
+ if (rv!=SCARD_S_SUCCESS) {
+ DBG_INFO(LC_LOGDOMAIN, "Trying protocol RAW");
+ rv=SCardConnect(cl->scardContext,
+ rname,
+ SCARD_SHARE_EXCLUSIVE,
+ SCARD_PROTOCOL_RAW,
+ &scardHandle,
+ &dwActiveProtocol);
+ }
+#endif
+
if (rv!=SCARD_S_SUCCESS) {
DBG_INFO(LC_LOGDOMAIN,
"SCardConnect: %04lx", (long unsigned int) rv);
@@ -649,6 +664,10 @@
"SCardControl: %04lx", (long unsigned int) rv);
return LC_Client_ResultIoError;
}
+ DBG_DEBUG(LC_LOGDOMAIN, "Received response:");
+ GWEN_Text_LogString((const char*)rbuffer, rblen,
+ LC_LOGDOMAIN,
+ GWEN_LoggerLevel_Debug);
if (rblen) {
GWEN_Buffer_AppendBytes(rbuf, (const char*)rbuffer, rblen);
if (rblen>1) {
@@ -658,6 +677,9 @@
rbuffer[rblen-1]);
}
}
+ else {
+ DBG_DEBUG(LC_LOGDOMAIN, "Empty response");
+ }
return LC_Client_ResultOk;
}
}
@@ -865,7 +887,7 @@
DBG_INFO(LC_LOGDOMAIN, "Creating reader \"%s\"", p);
i=cl->readerCount;
/* preset */
- memset((void*) &(cl->readerStates[i]), 0, sizeof(SCARD_READERSTATE_A));
+ memset((void*) &(cl->readerStates[i]), 0, sizeof(SCARD_READERSTATE));
cl->readerStates[i].szReader=p;
cl->readerStates[i].dwCurrentState=SCARD_STATE_UNAWARE;
/* reader added */
@@ -941,7 +963,7 @@
assert(cl);
/* clear reader list and reader status list */
- memset((void*) &cl->readerStates, 0, sizeof(SCARD_READERSTATE_A)*MAX_READERS);
+ memset((void*) &cl->readerStates, 0, sizeof(SCARD_READERSTATE)*MAX_READERS);
cl->readerCount=0;
free(cl->readerList);
cl->readerList=NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/base/client_p.h new/libchipcard-5.0.2/src/lib/client/base/client_p.h
--- old/libchipcard-5.0.0/src/lib/client/base/client_p.h 2010-08-16 21:24:00.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/base/client_p.h 2010-11-23 00:58:26.000000000 +0100
@@ -42,7 +42,7 @@
SCARDCONTEXT scardContext;
int pnpAvailable;
- SCARD_READERSTATE_A readerStates[MAX_READERS];
+ SCARD_READERSTATE readerStates[MAX_READERS];
int readerCount;
int lastUsedReader;
LPSTR readerList;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/Makefile.am new/libchipcard-5.0.2/src/lib/client/cards/Makefile.am
--- old/libchipcard-5.0.0/src/lib/client/cards/Makefile.am 2010-05-04 13:59:59.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/cards/Makefile.am 2010-11-13 14:39:41.000000000 +0100
@@ -1,4 +1,4 @@
-SUBDIRS=memorycard processorcard ddvcard geldkarte kvkcard egkcard starcos
+SUBDIRS=memorycard processorcard ddvcard geldkarte kvkcard egkcard starcos zkacard
DEFS += \
-DBUILDING_CHIPCARD
@@ -35,6 +35,7 @@
geldkarte/libcards-geldkarte.la \
kvkcard/libcards-kvk.la \
starcos/libcards-starcos.la \
+ zkacard/libcards-zkacard.la \
memorycard/libcards-memorycard.la \
processorcard/libcards-processorcard.la
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/card.xml new/libchipcard-5.0.2/src/lib/client/cards/card.xml
--- old/libchipcard-5.0.0/src/lib/client/cards/card.xml 2008-04-09 09:39:21.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/cards/card.xml 2010-11-13 15:16:10.000000000 +0100
@@ -14,6 +14,9 @@
<result sw1="0x61" type="success" >
Command executed, correct size in SW2
</result>
+ <result sw1="0x62" sw2="0x82" type="success" >
+ Command executed, EOF met.
+ </result>
<result sw1="0x69" sw2="0x86" type="error" >
No EF selected (internal error)
</result>
@@ -809,6 +812,9 @@
<result sw1="0x67" sw2="0x81" type="error" >
Response too long (internal error)
</result>
+ <result sw1="0x69" sw2="0x82" type="error" >
+ Security status not satisfied (please verify E/G PIN before).
+ </result>
<result sw1="0x69" sw2="0x86" type="error" >
Command not allowed (internal error)
</result>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/Makefile.am new/libchipcard-5.0.2/src/lib/client/cards/zkacard/Makefile.am
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/Makefile.am 2010-11-13 15:10:43.000000000 +0100
@@ -0,0 +1,44 @@
+
+DEFS += \
+ -DBUILDING_CHIPCARD
+
+AM_CFLAGS=$(visibility_cflags)
+
+EXTRA_DIST=app.xml card.xml
+
+INCLUDES=-I$(libchipcard_symlinkdir) $(gwenhywfar_includes) -I../
+
+typefiles=types.xml
+
+
+noinst_LTLIBRARIES=libcards-zkacard.la
+noinst_HEADERS=\
+ zkacard_p.h
+
+
+iheaderdir=@libchipcard_headerdir_am@/cards
+iheader_HEADERS=\
+ zkacard.h
+
+libcards_zkacard_la_SOURCES=\
+ zkacard.c
+
+
+types: $(typefiles)
+ typemaker -d CHIPCARD_API $(typefiles)
+
+
+
+appdatadir=@lc_client_xml_dir@/apps
+carddatadir=@lc_client_xml_dir@/cards
+
+install-app-data:
+ $(INSTALL) -d $(DESTDIR)$(appdatadir)
+ cp app.xml $(DESTDIR)$(appdatadir)/zkacard.xml
+
+install-card-data:
+ $(INSTALL) -d $(DESTDIR)$(carddatadir)
+ cp card.xml $(DESTDIR)$(carddatadir)/zkacard.xml
+
+install-data-local: install-app-data install-card-data
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/app.xml new/libchipcard-5.0.2/src/lib/client/cards/zkacard/app.xml
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/app.xml 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/app.xml 2010-11-13 17:34:27.000000000 +0100
@@ -0,0 +1,140 @@
+<apps>
+ <app name="zkacard">
+
+ <formats>
+
+ <format name="EF_GD0">
+ <ELEM name="ICCSN" type="tlv" minnum="1" maxnum="1" >
+ <tlv id="0x5a">
+ <ELEM name="branchKey" type="byte" bcd="1" />
+ <ELEM name="shortBankCode" type="bcd" size="3">
+ <DESCR>
+ First byte (BCD) shows the group:
+ 21: oeffentlich-rechtliche und private banken
+ 22: Privat- und Geschaeftsbanken
+ 25: Sparkassen
+ 26, 29: Genossenschaftsbanken
+ </DESCR>
+ </ELEM>
+ <ELEM name="cardNumber" type="bcd" size="5" />
+ <ELEM name="checksum" type="byte" bcd="1" />
+ </tlv>
+ </ELEM>
+ </format>
+
+ </formats>
+
+
+ <pins>
+
+<!--
+ <pin name="eg_pin" encoding="ascii" id="0x91"
+ minlen="4" maxlen="8" allowChange="1" filler="32" />
+-->
+ </pins>
+
+
+ <files>
+
+ <record>
+ <ELEM name="branchKey" type="byte" bcd="1" />
+ <ELEM name="shortBankCode" type="bcd" size="3">
+ <DESCR>
+ First byte (BCD) shows the group:
+ 21: oeffentlich-rechtliche und private banken
+ 22: Privat- und Geschaeftsbanken
+ 25: Sparkassen
+ 26, 29: Genossenschaftsbanken
+ </DESCR>
+ </ELEM>
+ <ELEM name="cardNumber" type="bcd" size="5" />
+ <ELEM name="checksum" type="byte" bcd="1" />
+ <ELEM name="validUntil" type="bytes" size="2">
+ <DESCR> YYMM (BSD)</DESCR>
+ </ELEM>
+ <ELEM name="validSince" type="bytes" size="3" >
+ <DESCR> YYMMDD (BCD)</DESCR>
+ </ELEM>
+ <ELEM name="country" type="word" bcd="1" />
+
+ <ELEM name="factor" type="byte" >
+ <DESCR>
+ Binary coded:
+ 01: 10^-2
+ 02: 10^-1
+ 04: 10^0
+ 08: 10^1
+ 10: 10^2
+ 20: 10^3
+ </DESCR>
+ </ELEM>
+ <ELEM name="chipversion" type="byte" minnum="0" />
+ <ELEM name="filler" type="byte" minnum="0" />
+ <ELEM name="osversion" type="byte" minnum="0" />
+ </record>
+ </ef>
+
+
+ <DESCR>
+ This file contains the ICCSN according to ISO-7812-1
+ </DESCR>
+ <FORMAT type="EF_GD0" />
+ </ef>
+
+
+ <descr>
+ This file contains information about a PIN.
+ </descr>
+ </ef>
+
+
+ <df name="DF_SIG" lid="d27600006601" >
+
+ <files>
+
+ <descr>
+ This file contains information about the Signature PIN.
+ </descr>
+ </ef>
+
+
+ <DESCR>
+ This file contains the ICCSN according to ISO-7812-1
+ </DESCR>
+ </ef>
+
+ </files>
+ </df>
+
+
+ <df name="DF_NOTEPAD" lid="d2760000254e500100" >
+ <!-- verify ASCII pin 0x03 before accessing EF_NOTEPAD -->
+ <files>
+
+ <descr>
+ This file contains user setup records.
+ </descr>
+ </ef>
+
+ </files>
+ </df>
+
+ </files>
+ </app>
+</apps>
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/card.xml new/libchipcard-5.0.2/src/lib/client/cards/zkacard/card.xml
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/card.xml 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/card.xml 2010-11-13 14:53:25.000000000 +0100
@@ -0,0 +1,138 @@
+
+<!--
+ These are the known algos for ManageSE
+ Template ! Algo ! Hash ! Padding
+ =====================================================
+ 0xb6 ! 0x11 ! SHA-1 ! ISO 9796/2 with random
+ ! ! ! (->SigG v1.0)
+ ! 0x12 ! SHA-1 ! PKCS#1 Block Type 01
+ ! 0x21 ! RIPEMD-160 ! ISO 9796/2 with random
+ ! ! ! (->SigG v1.0)
+ ! 0x22 ! RIPEMD-160 ! PKCS#1 Block Type 01
+ ! 0x25 ! RIPEMD-160 ! ISO9796/1 incl. app A4 (->HBCI)
+ ! 0x26 ! RIPEMD-160 ! '00 ... 00 | Hash'
+ ! 0x32 ! MD-5 ! PKCS#1 Block Type 01
+ ! - ! - ! ISO9796/1 without app A4
+ 0xb8 ! 0x02 ! - ! PKCS#1 Block Type 02
+ ! 0x03 ! - ! '00 ... 00 | Plaintext'
+ ! - ! - ! '00 ... 00 | Plaintext'
+-->
+
+
+
+<cards>
+ <card name="ZkaCard" extends="ProcessorCard" type="processor" >
+ <cardinfo>
+ <name>ZkaCard</name>
+ <descr>
+ ZKA card based on SECCOS
+ </descr>
+ <atrs>
+ <atr>
+ 3B B7 94 00 81 31 fe 65 53 50 4b 32 33 90 00 d1
+ </atr>
+ </atrs>
+ </cardinfo>
+
+ <commands>
+ <!-- Select DF by 16-bit-id -->
+ <command name="SelectDFS" >
+ <send>
+ <APDU lr="0" >
+ <ELEM type="dword">0x00a4000c</ELEM>
+ </APDU>
+ <DATA>
+ <ELEM name="fileId" type="word" />
+ </DATA>
+ </send>
+ <results>
+ <result sw1="0x6a" sw2="0x82" type="error">File not found</result>
+ </results>
+ </command>
+
+ <!-- Select DF by application-id -->
+ <command name="SelectDFL" >
+ <send>
+ <APDU lr="-1" >
+ <ELEM type="dword">0x00a4040c</ELEM>
+ </APDU>
+ <DATA>
+ <ELEM name="fileId" type="bytes" />
+ </DATA>
+ </send>
+ <results>
+ <result sw1="0x6a" sw2="0x82" type="error">File not found</result>
+ </results>
+ </command>
+
+ <!-- Select EF by id -->
+ <command name="SelectEFS" >
+ <send>
+ <APDU lr="-1" >
+ <ELEM type="dword">0x00a4020c</ELEM>
+ </APDU>
+ <DATA>
+ <ELEM name="fileId" type="word" />
+ </DATA>
+ </send>
+ <results>
+ <result sw1="0x6a" sw2="0x82" type="error">File not found</result>
+ </results>
+ </command>
+
+ <!-- Select Master File -->
+ <command name="SelectMF" >
+ <send>
+ <APDU lr="-1" >
+ <ELEM type="dword">0x00a4000c</ELEM>
+ </APDU>
+ <DATA>
+ <ELEM type="word">0x3f00</ELEM>
+ </DATA>
+ </send>
+ <results>
+ <result sw1="0x6a" sw2="0x82" type="error">File not found</result>
+ </results>
+ </command>
+
+
+ </commands>
+
+
+ <!-- generic command responses -->
+ <results>
+ <result sw1="0x69" sw2="0x82" type="error" >
+ Security status not satisfied.
+ </result>
+ <result sw1="0x69" sw2="0x85" type="error" >
+ Condition of use not satisfied.
+ </result>
+ <result sw1="0x6a" sw2="0x80" type="error" >
+ Wrong parameter in data field.
+ </result>
+ <result sw1="0x6a" sw2="0x81" type="error" >
+ Function not supported (wrong parameters P1/P2).
+ </result>
+ <result sw1="0x6a" sw2="0x88" type="error" >
+ Referenced data not found.
+ </result>
+ <result sw1="0x6f" sw2="0x01" type="error" >
+ Public key not complete.
+ </result>
+ <result sw1="0x6f" sw2="0x03" type="error" >
+ Invalid command sequence.
+ </result>
+ <result sw1="0x6f" sw2="0x05" type="error" >
+ No security environment.
+ </result>
+ <result sw1="0x6f" sw2="0x08" type="error" >
+ Signature could not be verified with public key.
+ </result>
+ <result sw1="0x6f" sw2="0x0a" type="error" >
+ Key format list does not match key length.
+ </result>
+ </results>
+
+ </card>
+</cards>
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard.c new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard.c
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard.c 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard.c 2010-11-13 14:31:00.000000000 +0100
@@ -0,0 +1,265 @@
+/***************************************************************************
+ begin : Sat Nov 13 2010
+ copyright : (C) 2010 by Martin Preuss
+ email : martin@libchipcard.de
+
+ ***************************************************************************
+ * Please see toplevel file COPYING for license details *
+ ***************************************************************************/
+
+
+#ifdef HAVE_CONFIG_H
+# include
+#endif
+
+#include "zkacard_p.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+GWEN_INHERIT(LC_CARD, LC_ZKACARD)
+
+
+
+int LC_ZkaCard_ExtendCard(LC_CARD *card) {
+ LC_ZKACARD *xc;
+ int rv;
+
+ rv=LC_ProcessorCard_ExtendCard(card);
+ if (rv) {
+ DBG_INFO(LC_LOGDOMAIN, "here (%d)", rv);
+ return rv;
+ }
+
+ GWEN_NEW_OBJECT(LC_ZKACARD, xc);
+ GWEN_INHERIT_SETDATA(LC_CARD, LC_ZKACARD, card, xc,
+ LC_ZkaCard_freeData);
+
+ LC_Card_SetLastResult(card, 0, 0, 0, 0);
+ xc->openFn=LC_Card_GetOpenFn(card);
+ xc->closeFn=LC_Card_GetCloseFn(card);
+ LC_Card_SetOpenFn(card, LC_ZkaCard_Open);
+ LC_Card_SetCloseFn(card, LC_ZkaCard_Close);
+
+ return 0;
+}
+
+
+
+int LC_ZkaCard_UnextendCard(LC_CARD *card) {
+ LC_ZKACARD *xc;
+ int rv;
+
+ xc=GWEN_INHERIT_GETDATA(LC_CARD, LC_ZKACARD, card);
+ assert(xc);
+ LC_Card_SetOpenFn(card, xc->openFn);
+ LC_Card_SetCloseFn(card, xc->closeFn);
+ GWEN_INHERIT_UNLINK(LC_CARD, LC_ZKACARD, card);
+
+ rv=LC_ProcessorCard_UnextendCard(card);
+ if (rv) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ }
+ return rv;
+}
+
+
+
+void GWENHYWFAR_CB LC_ZkaCard_freeData(void *bp, void *p){
+ LC_ZKACARD *xc;
+
+ assert(bp);
+ assert(p);
+ xc=(LC_ZKACARD*)p;
+
+ GWEN_Buffer_free(xc->bin_ef_gd_0);
+ GWEN_Buffer_free(xc->bin_ef_id);
+ GWEN_Buffer_free(xc->bin_ef_ssd);
+
+ GWEN_FREE_OBJECT(xc);
+}
+
+
+
+LC_CLIENT_RESULT LC_ZkaCard_Reopen(LC_CARD *card) {
+ LC_CLIENT_RESULT res;
+ LC_ZKACARD *xc;
+ GWEN_BUFFER *mbuf;
+
+ DBG_INFO(LC_LOGDOMAIN, "Opening ZkaCard card");
+
+ assert(card);
+ xc=GWEN_INHERIT_GETDATA(LC_CARD, LC_ZKACARD, card);
+ assert(xc);
+
+ LC_Card_SetLastResult(card, 0, 0, 0, 0);
+ GWEN_Buffer_free(xc->bin_ef_gd_0);
+ xc->bin_ef_gd_0=NULL;
+
+ GWEN_Buffer_free(xc->bin_ef_id);
+ xc->bin_ef_id=NULL;
+
+ GWEN_Buffer_free(xc->bin_ef_ssd);
+ xc->bin_ef_ssd=NULL;
+
+ res=LC_Card_SelectCard(card, "zkacard");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ /* first select generic app for all ZKACARD HBCI cards */
+ res=LC_Card_SelectApp(card, "zkacard");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ DBG_INFO(LC_LOGDOMAIN, "Selecting MF...");
+ res=LC_Card_SelectMf(card);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ /* read EF_ID */
+ DBG_INFO(LC_LOGDOMAIN, "Selecting EF_ID...");
+ res=LC_Card_SelectEf(card, "EF_ID");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ DBG_INFO(LC_LOGDOMAIN, "Reading record...");
+ mbuf=GWEN_Buffer_new(0, 32, 0, 1);
+ res=LC_Card_IsoReadRecord(card, LC_CARD_ISO_FLAGS_RECSEL_GIVEN, 1, mbuf);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ GWEN_Buffer_free(mbuf);
+ return res;
+ }
+ xc->bin_ef_id=mbuf;
+
+
+ /* read EG_GD0 */
+ DBG_INFO(LC_LOGDOMAIN, "Selecting EF_GD0...");
+ res=LC_Card_SelectEf(card, "EF_GD0");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ DBG_INFO(LC_LOGDOMAIN, "Reading data...");
+ mbuf=GWEN_Buffer_new(0, 16, 0, 1);
+ res=LC_Card_IsoReadBinary(card, 0, 0, 12, mbuf);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ GWEN_Buffer_free(mbuf);
+ return res;
+ }
+ if (GWEN_Buffer_GetUsedBytes(mbuf)<12) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ GWEN_Buffer_free(mbuf);
+ return LC_Client_ResultDataError;
+ }
+ xc->bin_ef_gd_0=mbuf;
+
+
+ /* select DF_SIG */
+ DBG_INFO(LC_LOGDOMAIN, "Selecting DF_SIG...");
+ res=LC_Card_SelectDf(card, "DF_SIG");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ /* read EG_SSD */
+ DBG_INFO(LC_LOGDOMAIN, "Selecting EF_SSD...");
+ res=LC_Card_SelectEf(card, "EF_SSD");
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ DBG_INFO(LC_LOGDOMAIN, "Reading data...");
+ mbuf=GWEN_Buffer_new(0, 16, 0, 1);
+ res=LC_Card_ReadBinary(card, 0, 65535, mbuf);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here (%d)", res);
+ GWEN_Buffer_free(mbuf);
+ return res;
+ }
+ xc->bin_ef_ssd=mbuf;
+
+
+
+ return LC_Client_ResultOk;
+}
+
+
+
+LC_CLIENT_RESULT CHIPCARD_CB LC_ZkaCard_Open(LC_CARD *card){
+ LC_CLIENT_RESULT res;
+ LC_ZKACARD *xc;
+
+ DBG_INFO(LC_LOGDOMAIN, "Opening card as ZkaCard card");
+
+ assert(card);
+ xc=GWEN_INHERIT_GETDATA(LC_CARD, LC_ZKACARD, card);
+ assert(xc);
+
+ LC_Card_SetLastResult(card, 0, 0, 0, 0);
+ GWEN_Buffer_free(xc->bin_ef_gd_0);
+ xc->bin_ef_gd_0=NULL;
+
+ GWEN_Buffer_free(xc->bin_ef_id);
+ xc->bin_ef_id=NULL;
+
+ GWEN_Buffer_free(xc->bin_ef_ssd);
+ xc->bin_ef_ssd=NULL;
+
+ res=xc->openFn(card);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ res=LC_ZkaCard_Reopen(card);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ xc->closeFn(card);
+ return res;
+ }
+
+ return LC_Client_ResultOk;
+}
+
+
+
+LC_CLIENT_RESULT CHIPCARD_CB LC_ZkaCard_Close(LC_CARD *card){
+ LC_CLIENT_RESULT res;
+ LC_ZKACARD *xc;
+
+ assert(card);
+ xc=GWEN_INHERIT_GETDATA(LC_CARD, LC_ZKACARD, card);
+ assert(xc);
+
+ LC_Card_SetLastResult(card, 0, 0, 0, 0);
+ res=xc->closeFn(card);
+ if (res!=LC_Client_ResultOk) {
+ DBG_INFO(LC_LOGDOMAIN, "here");
+ return res;
+ }
+
+ return res;
+}
+
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard.h new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard.h
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard.h 2010-11-13 14:31:05.000000000 +0100
@@ -0,0 +1,26 @@
+/***************************************************************************
+ begin : Sat Nov 13 2010
+ copyright : (C) 2010 by Martin Preuss
+ email : martin@libchipcard.de
+
+ ***************************************************************************
+ * Please see toplevel file COPYING for license details *
+ ***************************************************************************/
+
+
+#ifndef CHIPCARD_CARD_ZKACARD_H
+#define CHIPCARD_CARD_ZKACARD_H
+
+#include
+
+
+CHIPCARD_API
+int LC_ZkaCard_ExtendCard(LC_CARD *card);
+CHIPCARD_API
+int LC_ZkaCard_UnextendCard(LC_CARD *card);
+CHIPCARD_API
+LC_CLIENT_RESULT LC_ZkaCard_Reopen(LC_CARD *card);
+
+
+#endif
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard_p.h new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard_p.h
--- old/libchipcard-5.0.0/src/lib/client/cards/zkacard/zkacard_p.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libchipcard-5.0.2/src/lib/client/cards/zkacard/zkacard_p.h 2010-11-13 14:31:10.000000000 +0100
@@ -0,0 +1,44 @@
+/***************************************************************************
+ begin : Sat Nov 13 2010
+ copyright : (C) 2010 by Martin Preuss
+ email : martin@libchipcard.de
+
+ ***************************************************************************
+ * Please see toplevel file COPYING for license details *
+ ***************************************************************************/
+
+
+#ifndef CHIPCARD_CARD_ZKACARD_P_H
+#define CHIPCARD_CARD_ZKACARD_P_H
+
+#include "zkacard.h"
+
+#include
+
+
+typedef struct LC_ZKACARD LC_ZKACARD;
+struct LC_ZKACARD {
+ LC_CARD_OPEN_FN openFn;
+ LC_CARD_CLOSE_FN closeFn;
+
+ GWEN_BUFFER *bin_ef_gd_0;
+ GWEN_BUFFER *bin_ef_id;
+ GWEN_BUFFER *bin_ef_ssd;
+
+ int len_modus_sk_ch_ds;
+ int len_modus_sk_ch_aut;
+ int len_modus_sk_ch_ke;
+ int min_len_csa_password;
+
+};
+
+
+void GWENHYWFAR_CB LC_ZkaCard_freeData(void *bp, void *p);
+LC_CLIENT_RESULT CHIPCARD_CB LC_ZkaCard_Open(LC_CARD *card);
+LC_CLIENT_RESULT CHIPCARD_CB LC_ZkaCard_Close(LC_CARD *card);
+
+
+
+
+#endif
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/client/libtest.c new/libchipcard-5.0.2/src/lib/client/libtest.c
--- old/libchipcard-5.0.0/src/lib/client/libtest.c 2010-08-25 11:26:44.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/client/libtest.c 2011-02-26 19:59:17.000000000 +0100
@@ -6,6 +6,7 @@
#include
#include
+#include
#include
#include
@@ -639,6 +640,177 @@
return 0;
}
+
+
+int testPcsc9(int argc, char **argv) {
+ LC_CLIENT *cl;
+ LC_CLIENT_RESULT res;
+ LC_CARD *card;
+ GWEN_BUFFER *mbuf;
+ LC_PININFO *pi;
+ int triesLeft=-1;
+
+ fprintf(stderr, "\n");
+ fprintf(stderr, "====================================================\n");
+ fprintf(stderr, "I This test will verify the PIN of the card and I\n");
+ fprintf(stderr, "I dump the first bank information I\n");
+ fprintf(stderr, "====================================================\n");
+ fprintf(stderr, "\n");
+
+ cl=LC_Client_new("test", "0.1");
+ if (!cl) {
+ fprintf(stderr, "ERROR: Could not create client.\n");
+ return 1;
+ }
+
+ res=LC_Client_Init(cl);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Could not init client (%d).\n",
+ res);
+ return 2;
+ }
+
+ res=LC_Client_Start(cl);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Could not start using cards (%d).\n",
+ res);
+ return 2;
+ }
+
+ res=LC_Client_GetNextCard(cl, &card, 20);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: No card found (%d).\n",
+ res);
+ return 2;
+ }
+
+ fprintf(stderr, "Got this card:\n");
+ LC_Card_Dump(card, 2);
+
+
+ if (LC_ZkaCard_ExtendCard(card)) {
+ fprintf(stderr, "ERROR: Could not extend card as ZKA card\n");
+ return 2;
+ }
+
+ fprintf(stderr, "INFO: Opening card\n");
+ res=LC_Card_Open(card);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Unable to open card (%d).\n", res);
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+
+ fprintf(stderr, "Selecting MF...\n");
+ res=LC_Card_SelectMf(card);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Wait timed out.\n");
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+
+ fprintf(stderr, "Selecting DF_NOTEPAD...\n");
+ res=LC_Card_SelectDf(card, "DF_NOTEPAD");
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Wait timed out.\n");
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+
+ pi=LC_Card_GetPinInfoByName(card, "ch_pin");
+ if (pi==NULL) {
+ fprintf(stderr, "ERROR: Pin Info not found.\n");
+ return 2;
+ }
+
+#if 0
+ if (pi) {
+ GWEN_DB_NODE *dbDEBUG;
+
+ dbDEBUG=GWEN_DB_Group_new("PinInfo");
+ LC_PinInfo_toDb(pi, dbDEBUG);
+ GWEN_DB_Dump(dbDEBUG, 2);
+ GWEN_DB_Group_free(dbDEBUG);
+ }
+#endif
+
+
+ fprintf(stderr, "Verifying pin...\n");
+ res=LC_Card_IsoPerformVerification(card, 0, pi, &triesLeft);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Wait timed out.\n");
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+
+ fprintf(stderr, "Selecting EF_NOTEPAD...\n");
+ res=LC_Card_SelectEf(card, "EF_NOTEPAD");
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Wait timed out.\n");
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+
+ fprintf(stderr, "Reading record...\n");
+ mbuf=GWEN_Buffer_new(0, 256, 0, 1);
+ res=LC_Card_IsoReadRecord(card, LC_CARD_ISO_FLAGS_RECSEL_GIVEN,
+ 1, mbuf);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Wait timed out.\n");
+ return 2;
+ }
+ fprintf(stderr, "Response was %d\n", res);
+ GWEN_Text_DumpString(GWEN_Buffer_GetStart(mbuf),
+ GWEN_Buffer_GetUsedBytes(mbuf), 2);
+ GWEN_Buffer_Rewind(mbuf);
+
+#if 0
+ dbRecord=GWEN_DB_Group_new("record");
+ if (LC_Card_ParseRecord(card, 1, mbuf, dbRecord)) {
+ fprintf(stderr, "Error parsing record.\n");
+ }
+ else {
+ fprintf(stderr, "Parsed record is:\n");
+ GWEN_DB_Dump(dbRecord, 2);
+ }
+
+ GWEN_Buffer_Reset(mbuf);
+ if (LC_Card_CreateRecord(card, 1, mbuf, dbRecord)) {
+ fprintf(stderr, "Error creating record.\n");
+ }
+ else {
+ fprintf(stderr, "Created record is:\n");
+ GWEN_Buffer_Dump(mbuf, 2);
+ }
+#endif
+
+ res=LC_Client_ReleaseCard(cl, card);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Unable to release card (%d).\n",
+ res);
+ return 2;
+ }
+ LC_Card_free(card);
+
+
+ res=LC_Client_Stop(cl);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Could not stop using cards (%d).\n",
+ res);
+ return 2;
+ }
+
+ res=LC_Client_Fini(cl);
+ if (res!=LC_Client_ResultOk) {
+ fprintf(stderr, "ERROR: Could not fini client (%d).\n",
+ res);
+ return 2;
+ }
+
+ return 0;
+}
+
+
#endif
@@ -650,7 +822,7 @@
rv=0;
- return testPcsc8(argc, argv);
+ return testPcsc9(argc, argv);
#ifdef LC_CLIENT_WITH_PCSC
tcount++;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libchipcard-5.0.0/src/lib/version.h new/libchipcard-5.0.2/src/lib/version.h
--- old/libchipcard-5.0.0/src/lib/version.h 2010-08-30 13:05:57.000000000 +0200
+++ new/libchipcard-5.0.2/src/lib/version.h 2011-06-11 13:35:38.000000000 +0200
@@ -31,11 +31,11 @@
#define CHIPCARD_VERSION_MAJOR 5
#define CHIPCARD_VERSION_MINOR 0
-#define CHIPCARD_VERSION_PATCHLEVEL 0
+#define CHIPCARD_VERSION_PATCHLEVEL 2
#define CHIPCARD_VERSION_BUILD 0
#define CHIPCARD_VERSION_TAG "stable"
-#define CHIPCARD_VERSION_FULL_STRING "5.0.0.0stable"
-#define CHIPCARD_VERSION_STRING "5.0.0"
+#define CHIPCARD_VERSION_FULL_STRING "5.0.2.0stable"
+#define CHIPCARD_VERSION_STRING "5.0.2"
#endif /* CHIPCARD2_VERSION_H */
++++++ libchipcard-rpmlintrc ++++++
addFilter("files-duplicate /etc/chipcard/chipcardc.conf.example /etc/chipcard/chipcardc.conf.default")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org