diff --git a/README.SUSE b/README.SUSE index b791ba0..c8a1b1d 100644 --- a/README.SUSE +++ b/README.SUSE @@ -28,9 +28,9 @@ on SUSE Linux Enterprise Server 9 for S/390 and zSeries: 2) Loading the z90crypt driver: - rcz90crypt start to load z90crypt + systemctl start z90crypt to load z90crypt - rcz90crypt stop to unload z90crypt + systemctl stop z90crypt to unload z90crypt this command will be available only after installation of the crypto driver packages. @@ -38,7 +38,7 @@ on SUSE Linux Enterprise Server 9 for S/390 and zSeries: To load the driver automatically at every system boot, integrate it with the other boot scripts issuing - insserv z90crypt + systemctl enable z90crypt 3) Checking if the z90crypt hardware driver can be accessed diff --git a/libica-3.4.0.tar.gz b/libica-3.4.0.tar.gz deleted file mode 100644 index af004f0..0000000 --- a/libica-3.4.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:160893c75655a9c36b0dff78783ba530944f3f683796676dfd2ea28f001f7112 -size 499429 diff --git a/libica-3.5.0.tar.gz b/libica-3.5.0.tar.gz new file mode 100644 index 0000000..d45bbf6 --- /dev/null +++ b/libica-3.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0ef01bb2e75d21d76cd88de770b9cf5bc5ffc6d728608d360b9774a2d97bc3b +size 516730 diff --git a/libica-SuSE.tar.bz2 b/libica-SuSE.tar.bz2 deleted file mode 100644 index eab7a22..0000000 --- a/libica-SuSE.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf0689e700d8c1d000e49843239f37ae75708e46707c8e5447da9946df37368c -size 2216 diff --git a/libica.changes b/libica.changes index 4b2651d..4df49a0 100644 --- a/libica.changes +++ b/libica.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Fri Aug 30 21:46:50 UTC 2019 - Mark Post + +- Upgraded to version 3.5.0 (Fate#327840) + - [FEATURE] Add MSA9 CPACF support for ECDSA sign/verify +- Reworked how libica-tools loads and unloads kernel modules to + avoid spurious error messages (bsc#1134004): + * Converted the boot.z90crypt sysV init script to a systemd unit + file. + * Removed any references to insserv in the spec file. + * Updated the z90crypt script itself to properly load and unload + the kernel modules as they exist today. + * Eliminated the obsolete libica-SuSE.tar.bz2 archive. +- Updated the README.SUSE file to reflect the change from sysV init + style script to systemd. +- Made numerous changes to the spec file, based on the output from + the spec-cleaner command. + ------------------------------------------------------------------- Wed Jul 24 10:09:46 UTC 2019 - Martin Pluskal diff --git a/libica.spec b/libica.spec index 09f6281..1570ca3 100644 --- a/libica.spec +++ b/libica.spec @@ -1,7 +1,7 @@ # # spec file for package libica # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018, 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,19 +20,21 @@ %if ! %{defined _fillupdir} %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif + Name: libica -Version: 3.4.0 +Version: 3.5.0 Release: 0 Summary: Library interface for the IBM Cryptographic Accelerator device driver License: CPL-1.0 Group: Hardware/Other URL: https://github.com/opencryptoki/libica -Source: libica-%{version}.tar.gz -Source1: libica-SuSE.tar.bz2 +Source: https://github.com/opencryptoki/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # The icaioctl.h file came from https://sourceforge.net/p/opencryptoki/icadd/ci/master/tree/ -Source3: icaioctl.h -Source4: README.SUSE -Source5: sysconfig.z90crypt +Source1: icaioctl.h +Source2: README.SUSE +Source3: sysconfig.z90crypt +Source4: z90crypt +Source5: z90crypt.service Source6: baselibs.conf Source7: %{name}-rpmlintrc BuildRequires: autoconf @@ -41,7 +43,6 @@ BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: openssl-devel PreReq: %fillup_prereq -PreReq: %insserv_prereq ExclusiveArch: s390 s390x %description @@ -104,25 +105,29 @@ This RPM contains all the tools necessary to compile and link using the libica library. %prep -%setup -q -a 1 +%autosetup -p 1 %build mkdir -p include/linux/ -cp %{SOURCE3} include/linux/ +cp %{SOURCE1} include/linux/ autoreconf --force --install %configure CPPFLAGS="-Iinclude -fPIC" CFLAGS="%{optflags} -fPIC" \ --enable-fips -make clean +make %{?_smp_mflags} clean make %{?_smp_mflags} %install -mkdir -p %{buildroot}%{_includedir} %make_install +mkdir -p %{buildroot}%{_includedir} cp -p include/ica_api.h %{buildroot}%{_includedir} -cp -a SuSE/* %{buildroot} -install -D %{SOURCE5} %{buildroot}%{_fillupdir}/sysconfig.z90crypt -cp -a %{_sourcedir}/README.SUSE . +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcz90crypt +install -D %{SOURCE3} %{buildroot}%{_fillupdir}/sysconfig.z90crypt +install -D %{SOURCE4} %{buildroot}%{_prefix}/lib/systemd/scripts/z90crypt +install -D -m 644 %{SOURCE5} %{buildroot}%{_prefix}/lib/systemd/system/z90crypt.service + +cp -a %{SOURCE2} . rm -f %{buildroot}%{_libdir}/libica.la rm -f %{buildroot}%{_datadir}/doc/libica/* rmdir %{buildroot}%{_datadir}/doc/libica @@ -130,15 +135,18 @@ rmdir %{buildroot}%{_datadir}/doc/libica %check make check +%pre tools +%service_add_pre z90crypt.service + %post tools -%{fillup_and_insserv -n boot.z90crypt} +%service_add_post z90crypt.service +%{fillup_only -n z90crypt} %preun tools -%stop_on_removal boot.z90crypt +%service_del_preun z90crypt.service %postun tools -%restart_on_update boot.z90crypt -%insserv_cleanup +%service_del_postun z90crypt.service %post -n libica3 -p /sbin/ldconfig %postun -n libica3 -p /sbin/ldconfig @@ -148,25 +156,24 @@ make check %{_libdir}/libica.so.3* %files tools -%defattr(-, root, root) %license LICENSE %doc README.SUSE -%{_initddir}/boot.z90crypt %{_sbindir}/rcz90crypt %attr(0644,root,root) %{_fillupdir}/sysconfig.z90crypt %{_bindir}/icainfo %{_bindir}/icastats %{_mandir}/man1/icainfo.1%{?ext_man} %{_mandir}/man1/icastats.1%{?ext_man} +%dir %{_prefix}/lib/systemd/scripts +%{_prefix}/lib/systemd/scripts/z90crypt +%{_prefix}/lib/systemd/system/z90crypt.service # Must be in here, otherwise openssl-ibmca does not find it via DSO_load() bsc#952871 %{_libdir}/libica.so %files devel -%defattr(-, root, root) %attr(0644,root,root) %{_includedir}/ica_api.h %files devel-static -%defattr(-, root, root) -%{_libdir}/libica.a +%attr(0644,root,root) %{_libdir}/libica.a %changelog diff --git a/z90crypt b/z90crypt new file mode 100644 index 0000000..6810c9f --- /dev/null +++ b/z90crypt @@ -0,0 +1,21 @@ +#!/bin/sh +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +MODULE_LIST="pkey zcrypt_pcixcc zcrypt_cex2a zcrypt_cex4 zcrypt rng_core" +case "${1}" in + start) for module in ${MODULE_LIST} + do if ! grep -q ^{$module} /proc/modules ; then + modprobe ${module} + fi + done + ;; + stop) for module in ${MODULE_LIST} + do if grep -q ^${module} /proc/modules ; then + rmmod ${module} + fi + done + ;; +esac diff --git a/z90crypt.service b/z90crypt.service new file mode 100644 index 0000000..73da4f1 --- /dev/null +++ b/z90crypt.service @@ -0,0 +1,13 @@ +[Unit] +Description=Activate any cryptographic hardware +After=systemd-modules-load.service + +[Service] +Type=oneshot +RemainAfterExit=yes + +ExecStart=/usr/lib/systemd/scripts/z90crypt start +ExecStop=/usr/lib/systemd/scripts/z90crypt stop + +[Install] +WantedBy=default.target