packages: opensc/opensc.spec, opensc/opensc-libassuan-2.patch (NEW), opensc...
qboosh
qboosh at pld-linux.org
Mon Aug 9 09:10:37 CEST 2010
Author: qboosh Date: Mon Aug 9 07:10:37 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- time to move to new libassuan - added libassuan-2 patch from upstream trac
- added pcsc patch to build with current pcsc
- package westcos-tool
---- Files affected:
packages/opensc:
opensc.spec (1.68 -> 1.69) , opensc-libassuan-2.patch (NONE -> 1.1) (NEW), opensc-pcsc.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/opensc/opensc.spec
diff -u packages/opensc/opensc.spec:1.68 packages/opensc/opensc.spec:1.69
--- packages/opensc/opensc.spec:1.68 Fri May 14 18:27:47 2010
+++ packages/opensc/opensc.spec Mon Aug 9 09:10:32 2010
@@ -13,22 +13,25 @@
Source2: %{name}-initramfs-local-bottom
Source3: %{name}-initramfs-local-top
Source4: %{name}-initramfs-README
+Patch0: %{name}-libassuan-2.patch
+Patch1: %{name}-pcsc.patch
URL: http://www.opensc-project.org/
BuildRequires: autoconf >= 2.60
BuildRequires: automake >= 1:1.10
-BuildRequires: libassuan1-devel >= 0.6.0
+BuildRequires: libassuan-devel >= 1:2.0.0
BuildRequires: libltdl-devel
BuildRequires: libtool >= 1:1.4.2-9
BuildRequires: libxslt-progs
BuildRequires: openct-devel
BuildRequires: openldap-devel >= 2.4.6
BuildRequires: openssl-devel >= 0.9.7d
-BuildRequires: pcsc-lite-devel
+BuildRequires: pcsc-lite-devel >= 1.6.0
BuildRequires: pkgconfig >= 1:0.9.0
BuildRequires: readline-devel
BuildRequires: rpmbuild(macros) >= 1.364
BuildRequires: xorg-lib-libXt-devel
BuildRequires: zlib-devel
+Requires: pcsc-lite-libs >= 1.6.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
# datadir is used for config files and (editable) profiles
@@ -62,7 +65,7 @@
Requires: libltdl-devel
Requires: openct-devel
Requires: openssl-devel
-Requires: pcsc-lite-devel
+Requires: pcsc-lite-devel >= 1.6.0
%description devel
OpenSC development files.
@@ -118,6 +121,8 @@
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
install %{SOURCE4} README.initramfs
@@ -188,6 +193,7 @@
%attr(755,root,root) %{_bindir}/pkcs11-tool
%attr(755,root,root) %{_bindir}/pkcs15-*
%attr(755,root,root) %{_bindir}/rutoken-tool
+%attr(755,root,root) %{_bindir}/westcos-tool
%attr(755,root,root) %{_libdir}/libopensc.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libopensc.so.2
%attr(755,root,root) %{_libdir}/libpkcs15init.so.*.*.*
@@ -203,7 +209,7 @@
%attr(755,root,root) %{_libdir}/pkcs11/opensc-pkcs11.so
%attr(755,root,root) %{_libdir}/pkcs11/pkcs11-spy.so
%dir %{_datadir}/opensc
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opensc.conf
%config(noreplace) %verify(not md5 mtime size) %{_datadir}/opensc/*.profile
%{_mandir}/man1/cardos-tool.1*
%{_mandir}/man1/cryptoflex-tool.1*
@@ -212,6 +218,7 @@
%{_mandir}/man1/opensc-tool.1*
%{_mandir}/man1/pkcs11-tool.1*
%{_mandir}/man1/pkcs15-*.1*
+%{_mandir}/man1/westcos-tool.1*
%{_mandir}/man5/pkcs15-profile.5*
%files devel
@@ -254,6 +261,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.69 2010/08/09 07:10:32 qboosh
+- time to move to new libassuan - added libassuan-2 patch from upstream trac
+- added pcsc patch to build with current pcsc
+- package westcos-tool
+
Revision 1.68 2010/05/14 16:27:47 sparky
- replaced BR: libassuan-devel >= 1:0.6.0 with BR: libassuan1-devel >= 0.6.0
- BR: libxslt-progs
================================================================
Index: packages/opensc/opensc-libassuan-2.patch
diff -u /dev/null packages/opensc/opensc-libassuan-2.patch:1.1
--- /dev/null Mon Aug 9 09:10:37 2010
+++ packages/opensc/opensc-libassuan-2.patch Mon Aug 9 09:10:32 2010
@@ -0,0 +1,118 @@
+---
+ m4/gpg-error.m4 | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ m4/libassuan.m4 | 2 -
+ src/signer/dialog.c | 35 +++++++++++++++++-----------
+ 3 files changed, 88 insertions(+), 14 deletions(-)
+
+Index: opensc-0.11.13/m4/libassuan.m4
+===================================================================
+--- opensc-0.11.13.orig/m4/libassuan.m4 2009-12-13 10:14:26.000000000 +0100
++++ opensc-0.11.13/m4/libassuan.m4 2010-04-13 12:26:56.000000000 +0200
+@@ -26,7 +26,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ fi
+ AC_PATH_PROG(LIBASSUAN_CONFIG, libassuan-config, no)
+
+- tmp=ifelse([$1], ,1:0.9.2,$1)
++ tmp=ifelse([$1], ,2:2.0.0,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_libassuan_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+ min_libassuan_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+Index: opensc-0.11.13/src/signer/dialog.c
+===================================================================
+--- opensc-0.11.13.orig/src/signer/dialog.c 2010-02-16 10:03:25.000000000 +0100
++++ opensc-0.11.13/src/signer/dialog.c 2010-04-13 16:03:10.000000000 +0200
+@@ -15,31 +15,31 @@ struct entry_parm_s {
+ char *buffer;
+ };
+
+-static AssuanError
++static gpg_error_t
+ getpin_cb (void *opaque, const void *buffer, size_t length)
+ {
+ struct entry_parm_s *parm = (struct entry_parm_s *) opaque;
+
+ /* we expect the pin to fit on one line */
+ if (parm->lines || length >= parm->size)
+- return ASSUAN_Too_Much_Data;
++ return gpg_error(GPG_ERR_ASS_TOO_MUCH_DATA);
+
+ /* fixme: we should make sure that the assuan buffer is allocated in
+ secure memory or read the response byte by byte */
+ memcpy(parm->buffer, buffer, length);
+ parm->buffer[length] = 0;
+ parm->lines++;
+- return (AssuanError) 0;
++ return gpg_error(GPG_ERR_NO_ERROR);
+ }
+
+ int ask_and_verify_pin_code(struct sc_pkcs15_card *p15card,
+ struct sc_pkcs15_object *pin)
+ {
+- int r;
++ gpg_error_t r;
+ size_t len;
+ const char *argv[3];
+ const char *pgmname = PIN_ENTRY;
+- ASSUAN_CONTEXT ctx;
++ assuan_context_t ctx = NULL;
+ char buf[500];
+ char errtext[100];
+ struct entry_parm_s parm;
+@@ -48,16 +48,26 @@ int ask_and_verify_pin_code(struct sc_pk
+ argv[0] = pgmname;
+ argv[1] = NULL;
+
+- r = assuan_pipe_connect(&ctx, pgmname, (char **) argv, NULL);
++ assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
++
++ r = assuan_new(&ctx);
++ if (r) {
++ printf("Can't initialize assuan context: %s\n)",
++ gpg_strerror(r));
++ goto err;
++ }
++
++ r = assuan_pipe_connect(ctx, pgmname, (const char **) argv, \
++ NULL, NULL, NULL, 0);
+ if (r) {
+ printf("Can't connect to the PIN entry module: %s\n",
+- assuan_strerror((AssuanError) r));
++ gpg_strerror(r));
+ goto err;
+ }
+ sprintf(buf, "SETDESC Enter PIN [%s] for digital signing ", pin->label);
+ r = assuan_transact(ctx, buf, NULL, NULL, NULL, NULL, NULL, NULL);
+ if (r) {
+- printf("SETDESC: %s\n", assuan_strerror((AssuanError) r));
++ printf("SETDESC: %s\n", gpg_strerror(r));
+ goto err;
+ }
+ errtext[0] = 0;
+@@ -71,12 +81,12 @@ int ask_and_verify_pin_code(struct sc_pk
+ parm.size = sizeof(buf);
+ parm.buffer = buf;
+ r = assuan_transact(ctx, "GETPIN", getpin_cb, &parm, NULL, NULL, NULL, NULL);
+- if (r == ASSUAN_Canceled) {
+- assuan_disconnect(ctx);
++ if (gpg_err_code(r) == GPG_ERR_ASS_CANCELED) {
++ assuan_release(ctx);
+ return -2;
+ }
+ if (r) {
+- printf("GETPIN: %s\n", assuan_strerror((AssuanError) r));
++ printf("GETPIN: %s\n", gpg_strerror(r));
+ goto err;
+ }
+ len = strlen(buf);
+@@ -104,9 +114,9 @@ int ask_and_verify_pin_code(struct sc_pk
+ break;
+ }
+
+- assuan_disconnect(ctx);
++ assuan_release(ctx);
+ return 0;
+ err:
+- assuan_disconnect(ctx);
++ assuan_release(ctx);
+ return -1;
+ }
================================================================
Index: packages/opensc/opensc-pcsc.patch
diff -u /dev/null packages/opensc/opensc-pcsc.patch:1.1
--- /dev/null Mon Aug 9 09:10:37 2010
+++ packages/opensc/opensc-pcsc.patch Mon Aug 9 09:10:32 2010
@@ -0,0 +1,60 @@
+--- opensc-0.11.13/src/libopensc/reader-pcsc.c.orig 2010-02-16 10:03:28.000000000 +0100
++++ opensc-0.11.13/src/libopensc/reader-pcsc.c 2010-08-09 08:30:20.494823295 +0200
+@@ -80,7 +80,7 @@ struct pcsc_private_data {
+
+ struct pcsc_slot_data {
+ SCARDHANDLE pcsc_card;
+- SCARD_READERSTATE_A reader_state;
++ SCARD_READERSTATE reader_state;
+ DWORD verify_ioctl;
+ DWORD verify_ioctl_start;
+ DWORD verify_ioctl_finish;
+@@ -353,7 +353,7 @@ static int pcsc_wait_for_event(sc_reader
+ sc_context_t *ctx;
+ SCARDCONTEXT pcsc_ctx;
+ LONG ret;
+- SCARD_READERSTATE_A rgReaderStates[SC_MAX_READERS];
++ SCARD_READERSTATE rgReaderStates[SC_MAX_READERS];
+ unsigned long on_bits, off_bits;
+ time_t end_time, now, delta;
+ size_t i;
+@@ -401,7 +401,7 @@ static int pcsc_wait_for_event(sc_reader
+ /* Wait for a status change and return if it's a card insert/removal
+ */
+ for( ; ; ) {
+- SCARD_READERSTATE_A *rsp;
++ SCARD_READERSTATE *rsp;
+
+ /* Scan the current state of all readers to see if they
+ * match any of the events we're polling for */
+--- opensc-0.11.13/src/libopensc/internal-winscard.h.orig 2010-02-16 10:03:28.000000000 +0100
++++ opensc-0.11.13/src/libopensc/internal-winscard.h 2010-08-09 08:32:13.282823295 +0200
+@@ -77,7 +77,7 @@ typedef struct
+ unsigned long cbAtr;
+ unsigned char rgbAtr[MAX_ATR_SIZE];
+ }
+-SCARD_READERSTATE_A;
++SCARD_READERSTATE;
+
+ typedef struct _SCARD_IO_REQUEST
+ {
+@@ -87,8 +87,8 @@ typedef struct _SCARD_IO_REQUEST
+ SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
+
+ typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST;
+-typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A,
+- *LPSCARD_READERSTATE_A;
++typedef SCARD_READERSTATE *PSCARD_READERSTATE,
++ *LPSCARD_READERSTATE;
+
+ #endif /* HAVE_SCARD_H */
+
+@@ -113,7 +113,7 @@ typedef LONG (PCSC_API *SCardEndTransact
+ typedef LONG (PCSC_API *SCardStatus_t)(SCARDHANDLE hCard, LPSTR mszReaderNames, LPDWORD pcchReaderLen,
+ LPDWORD pdwState, LPDWORD pdwProtocol, LPBYTE pbAtr, LPDWORD pcbAtrLen);
+ typedef LONG (PCSC_API *SCardGetStatusChange_t)(SCARDCONTEXT hContext, DWORD dwTimeout,
+- LPSCARD_READERSTATE_A rgReaderStates, DWORD cReaders);
++ SCARD_READERSTATE *rgReaderStates, DWORD cReaders);
+ typedef LONG (PCSC_API *SCardControlOLD_t)(SCARDHANDLE hCard, LPCVOID pbSendBuffer, DWORD cbSendLength,
+ LPVOID pbRecvBuffer, LPDWORD lpBytesReturned);
+ typedef LONG (PCSC_API *SCardControl_t)(SCARDHANDLE hCard, DWORD dwControlCode, LPCVOID pbSendBuffer,
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/opensc/opensc.spec?r1=1.68&r2=1.69&f=u
More information about the pld-cvs-commit
mailing list