OBS User unknown 2009-04-18 12:02:39 +00:00 committed by Git OBS Bridge
parent 3063db90c0
commit e2662ab937
3 changed files with 59 additions and 4 deletions

View File

@ -0,0 +1,41 @@
Index: src/pkcs15init/pkcs15-lib.c
===================================================================
--- src/pkcs15init/pkcs15-lib.c (revision 3605)
+++ src/pkcs15init/pkcs15-lib.c (revision 3661)
@@ -3708,6 +3708,11 @@
/*
* Parse OpenSC Info file. We rudely clobber any information
* given on the command line.
+ *
+ * passed is a pointer (p) to (len) bytes. Those bytes contain
+ * one or several tag-length-value constructs, where tag and
+ * length are both single bytes. a final 0x00 or 0xff byte
+ * (with or without len byte) is ok.
*/
static int
sc_pkcs15init_parse_info(sc_card_t *card,
@@ -3719,11 +3724,21 @@
unsigned int nopts = 0;
size_t n;
- end = p + len;
- while (p < end && (tag = *p++) != 0 && tag != 0xFF) {
+ if ((p == NULL) || (len == 0))
+ return 0;
+
+ end = p + (len - 1);
+ while (p < end) { /* more bytes to look at */
int r = 0;
- if (p >= end || p + (n = *p++) > end)
+ tag = *p; p++;
+ if ((tag == 0) || (tag == 0xff) || (p >= end))
+ break;
+
+ n = *p;
+ p++;
+
+ if (p >= end || p + n > end) /* invalid length byte n */
goto error;
switch (tag) {

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Apr 9 11:32:23 CEST 2009 - sbrabec@suse.cz
- Fixed undefined code (bnc#440853).
- Don't call autoreconf on older products.
-------------------------------------------------------------------
Tue Mar 17 18:01:29 CET 2009 - sbrabec@suse.cz

View File

@ -20,12 +20,12 @@
Name: opensc
BuildRequires: libusb-devel openssl-devel pcsc-lite-devel pkg-config readline-devel xorg-x11-devel
%if %suse_version > 1020
%if %suse_version > 1020 || 0%{?opensuse_bs}
BuildRequires: libassuan-devel
%else
BuildRequires: libassuan
%endif
%if %suse_version > 1010
%if %suse_version > 1010 || 0%{?opensuse_bs}
BuildRequires: openct-devel
%endif
# bug437293
@ -35,7 +35,7 @@ Obsoletes: opensc-64bit
#
Url: http://www.opensc-project.org/opensc/
Version: 0.11.7
Release: 1
Release: 2
Group: Productivity/Security
Summary: OpenSC Smart Card Library
License: LGPL v2.1 or later
@ -47,6 +47,8 @@ Source2: %{name}-rpmlintrc
# and also skip-check-libtool-deps (and add these dependencies to the devel package)
# PATCH-FIX-UPSTREAM opensc-gpk-profile.patch sbrabec@suse.cz -- Fix privdata file-id clask for GPK cards.
Patch: opensc-gpk-profile.patch
# PATCH-FIX-UPSTREAM opensc-pkcs15init-undefined.patch bnc440853 sbrabec@suse.cz -- Fix undefined code.
Patch1: opensc-pkcs15init-undefined.patch
%description
OpenSC provides a set of libraries and utilities to access smart cards.
@ -127,9 +129,12 @@ Authors:
%prep
%setup -q
%patch
%patch1
%build
%if %suse_version > 1100
autoreconf -f -i
%endif
%configure\
--docdir=%{_docdir}/%{name}\
--disable-static\
@ -184,6 +189,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/*.pc
%changelog
* Thu Apr 09 2009 sbrabec@suse.cz
- Fixed undefined code (bnc#440853).
- Don't call autoreconf on older products.
* Tue Mar 17 2009 sbrabec@suse.cz
- Updated to version 0.11.7:
* hide_empty_slots now on by default? small logic change?
@ -301,7 +309,7 @@ rm -rf $RPM_BUILD_ROOT
- Updated to most recent upstream snapshot
* Thu Jun 12 2003 kukuk@suse.de
- Fix filelist and permissions
* Tue Jun 03 2003 ro@suse.de
* Wed Jun 04 2003 ro@suse.de
- added rest of static libs to devel filelist
- remove unpackaged files from buildroot
* Wed Jan 15 2003 ro@suse.de