File opensc.spec of Package opensc.18766

# spec file for package opensc
# Copyright (c) 2021 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           opensc
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  libtool
BuildRequires:  libxslt
BuildRequires:  openssl-devel
BuildRequires:  pcsc-lite-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel
Version:        0.13.0
Release:        0
Summary:        Smart Card Utilities
License:        LGPL-2.1-or-later
Group:          Productivity/Security   
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}-ADVISORIES
Source2:        %{name}-rpmlintrc
# PATCH-FIX_UPSTREAM opensc-fixed-out-of-bounds-reads.patch -- Security issues identified by fuzzing.
Patch1:         opensc-fixed-out-of-bounds-reads.patch
# PATCH-FIX_UPSTREAM opensc-fixed-out-of-bounds-writes.patch -- Fixed out-of-bounds writes in several files.
Patch2:         opensc-fixed-out-of-bounds-writes.patch
# PATCH-FIX_UPSTREAM opensc-iasecc-fixed-unbound-recursion.patch -- iasecc: fixed unbound recursion.
Patch3:         opensc-iasecc-fixed-unbound-recursion.patch
# PATCH-FIX_UPSTREAM opensc-added-bounds-checking.patch -- Added bounds checking to sc_simpletlv_read_tag().
Patch4:         opensc-added-bounds-checking.patch
# PATCH-FIX_UPSTREAM opensc-CVE-2019-6502.patch -- Small memory leak fix.
Patch5:         opensc-CVE-2019-6502.patch
# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2020-26570.patch -- buffer overflow in sc_oberthur_read_file
Patch6:         opensc-0_13_0-CVE-2020-26570.patch
# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2020-26572.patch -- prevent out of bounds write
Patch7:         opensc-0_13_0-CVE-2020-26572.patch

# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2020-26571.patch - fix stack-based overflow
Patch8:         opensc-0_13_0-CVE-2020-26571.patch
# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2019-15946.patch - out of bounds access
Patch9:         opensc-0_13_0-CVE-2019-15946.patch
# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2019-15945.patch - out of bounds access
Patch10:        opensc-0_13_0-CVE-2019-15945.patch
# PATCH-FIX_UPSTREAM opensc-0_13_0-CVE-2019-19479.patch - fixed UNKNOWN READ
Patch11:        opensc-0_13_0-CVE-2019-19479.patch
Requires:       pcsc-lite
# There is no more devel package.
Obsoletes:      opensc-devel < %{version}
# This package is not supported any more. Last appeared in openSUSE 11.3, never appeared in SLE:
Obsoletes:      opensc-java <= 0.2.2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

OpenSC provides a set of utilities to access smart cards. It mainly
focuses on cards that support cryptographic operations. It facilitates
their use in security applications such as mail encryption,
authentication, and digital signature. OpenSC implements the PKCS#11
API. Applications supporting this API, such as Mozilla Firefox and
Thunderbird, can use it. OpenSC implements the PKCS#15 standard and aims
to be compatible with every software that does so, too.

Before purchasing any cards, please read carefully documentation on the
web pageonly some cards are supported. Not only card type matters, but
also card version, card OS version and preloaded applet. Only subset of
possible operations may be supported for your card. Card initialization
may require third party proprietary software.

    Juha Yrjölä <>
    Antti Tapaninen <>
    Timo Teräs <>
    Olaf Kirch <>

%setup -q
cp -a %{S:1} ADVISORIES
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1

%if %suse_version > 1100
autoreconf -f -i
make %{?jobs:-j%jobs}

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkcs11
# Private library.
rm $RPM_BUILD_ROOT%{_libdir}/


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%doc %dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/ADVISORIES
%doc %{_docdir}/%{name}/ChangeLog
%doc %{_docdir}/%{name}/COPYING
%doc %{_docdir}/%{name}/NEWS
%doc %{_docdir}/%{name}/README
%doc %{_docdir}/%{name}/tools.html
# Note: .la and .so must be in the main package, required by ltdl:
%dir %{_libdir}/pkcs11
%doc %{_mandir}/man?/*.*
%config %{_sysconfdir}/opensc.conf
# This is a private library. There is no reason to split it to libopensc* package.

openSUSE Build Service is sponsored by