From: Marcin Banasiak Date: Thu, 2 Nov 2017 21:08:20 +0000 (+0100) Subject: Initial release (with upstream patches) X-Git-Tag: auto/th/volume_key-0.3.9-1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fvolume_key.git;a=commitdiff_plain;h=81e6955 Initial release (with upstream patches) --- 81e6955cfaab4dab07d760eac3079bbb79ce5a4c diff --git a/volume_key-config.h.patch b/volume_key-config.h.patch new file mode 100644 index 0000000..98a70f9 --- /dev/null +++ b/volume_key-config.h.patch @@ -0,0 +1,25 @@ +The library's header file distributed in the devel package cannot include +the config.h file that is only available during build otherwise it's not +possible to use the library outside of the volume_key build process. + +Signed-off-by: Vratislav Podzimek +--- + lib/libvolume_key.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/lib/libvolume_key.h b/lib/libvolume_key.h +index 657b626..513f923 100644 +--- a/lib/libvolume_key.h ++++ b/lib/libvolume_key.h +@@ -18,8 +18,6 @@ Author: Miloslav Trmač */ + #ifndef LIBVOLUME_KEY_H__ + #define LIBVOLUME_KEY_H__ + +-#include +- + #include + #include + +-- +2.1.0 + diff --git a/volume_key-fips-crash.patch b/volume_key-fips-crash.patch new file mode 100644 index 0000000..0f79d4e --- /dev/null +++ b/volume_key-fips-crash.patch @@ -0,0 +1,33 @@ +This case can be triggered by encrypting in FIPS mode, where the default +algorithm is unsupported and gpg crashes in response. + +diff --git a/lib/crypto.c b/lib/crypto.c +index 06eb482..905d583 100644 +--- a/lib/crypto.c ++++ b/lib/crypto.c +@@ -709,6 +709,12 @@ encrypt_with_passphrase (size_t *res_size, const void *data, size_t size, + } + gpgme_data_release (src_data); + gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size); ++ if (gpgme_res == NULL) ++ { ++ g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO, ++ _("Unknown error getting encryption result")); ++ goto err_ctx; ++ } + res = g_memdup (gpgme_res, *res_size); + gpgme_free (gpgme_res); + +@@ -759,6 +765,12 @@ decrypt_with_passphrase (size_t *res_size, const void *data, size_t size, + } + gpgme_data_release (src_data); + gpgme_res = gpgme_data_release_and_get_mem (dest_data, res_size); ++ if (gpgme_res == NULL) ++ { ++ g_set_error (error, LIBVK_ERROR, LIBVK_ERROR_CRYPTO, ++ _("Unknown error getting decryption result")); ++ goto err_ctx; ++ } + res = g_memdup (gpgme_res, *res_size); + gpgme_free (gpgme_res); + diff --git a/volume_key.spec b/volume_key.spec new file mode 100644 index 0000000..f3018c8 --- /dev/null +++ b/volume_key.spec @@ -0,0 +1,120 @@ +Summary: An utility for manipulating storage encryption keys and passphrases +Name: volume_key +Version: 0.3.9 +Release: 1 +License: GPL v2 +Group: Applications/System +Source0: https://releases.pagure.org/volume_key/%{name}-%{version}.tar.xz +# Source0-md5: a2d14931177c660e1f3ebbcf5f47d8e2 +Patch0: %{name}-config.h.patch +Patch1: %{name}-fips-crash.patch +URL: https://pagure.io/volume_key/ +BuildRequires: autoconf >= 2.64 +BuildRequires: automake +BuildRequires: cryptsetup-devel +BuildRequires: gettext-tools >= 0.17 +BuildRequires: glib2-devel +BuildRequires: gnupg +BuildRequires: libblkid-devel +BuildRequires: libtool +BuildRequires: nss-devel +BuildRequires: pkgconfig +BuildRequires: xz +Requires: %{name}-libs = %{version}-%{release} +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +This package provides a command-line tool for manipulating storage +volume encryption keys and storing them separately from volumes. + +The main goal of the software is to allow restoring access to an +encrypted hard drive if the primary user forgets the passphrase. The +encryption key back up can also be useful for extracting data after a +hardware or software failure that corrupts the header of the encrypted +volume, or to access the company data after an employee leaves +abruptly. + +%package libs +Summary: A library for manipulating storage encryption keys and passphrases +Group: Libraries + +%description libs +This package provides libvolume_key, a library for manipulating +storage volume encryption keys and storing them separately from +volumes. + +%package devel +Summary: Header files for volume_key library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki volume_key +Group: Development/Libraries +Requires: %{name}-libs = %{version}-%{release} + +%description devel +Header files for volume_key library. + +%description devel -l pl.UTF-8 +Pliki nagłówkowe biblioteki volume_key. + +%package -n python-%{name} +Summary: Python bindings for volume_key library +Group: Libraries +Requires: %{name}-libs = %{version}-%{release} + +%description -n python-%{name} +This package provides Python bindings for libvolume_key, a library for +manipulating storage volume encryption keys and storing them +separately from volumes. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 + +%build +%{__libtoolize} +%{__aclocal} -I m4 +%{__autoconf} +%{__autoheader} +%{__automake} +%configure +%{__make} + +%install +rm -rf $RPM_BUILD_ROOT + +%{__make} install \ + DESTDIR=$RPM_BUILD_ROOT + +%{__rm} -f $RPM_BUILD_ROOT%{py_sitedir}/*.la + +%py_postclean + +%find_lang %{name} + +%clean +rm -rf $RPM_BUILD_ROOT + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%files -f %{name}.lang +%defattr(644,root,root,755) +%doc AUTHORS ChangeLog NEWS README +%attr(755,root,root) %{_bindir}/volume_key +%{_mandir}/man8/volume_key.8* + +%files libs +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libvolume_key.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libvolume_key.so.1 + +%files devel +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libvolume_key.so +%{_libdir}/libvolume_key.la +%{_includedir}/volume_key + +%files -n python-%{name} +%defattr(644,root,root,755) +%attr(755,root,root) %{py_sitedir}/_volume_key.so +%{py_sitedir}/*.py[co]