Link to system libargon2 instead of using bundled code.

This commit is contained in:
Milan Broz 2017-11-20 17:19:21 +01:00
parent 0e8cd2ac4f
commit bae1dbc35a
2 changed files with 222 additions and 4 deletions

213
build-libargon2-fix.patch Normal file
View File

@ -0,0 +1,213 @@
commit d93ac3c496ac135dd54d848c27796d3cdf5f2418
Author: Guilhem Moulin <guilhem@debian.org>
Date: Wed Nov 1 14:58:01 2017 +0100
Remove libargon2 code from source tree
[mbroz: fix for make distcheck]
diff --git a/Makefile.am b/Makefile.am
index 23d5961..6f8b189 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,9 @@ include python/Makemodule.am
include scripts/Makemodule.am
+if CRYPTO_INTERNAL_ARGON2
include lib/crypto_backend/argon2/Makemodule.am
+endif
include lib/crypto_backend/Makemodule.am
include lib/Makemodule.am
@@ -39,7 +41,8 @@ ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = \
--enable-python \
- --with-tmpfilesdir=$$dc_install_base/usr/lib/tmpfiles.d
+ --with-tmpfilesdir=$$dc_install_base/usr/lib/tmpfiles.d \
+ --enable-internal-argon2
distclean-local:
-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
diff -rupN a/Makefile.in b/Makefile.in
--- cryptsetup-2.0.0-rc1.old/Makefile.in 2017-11-20 12:54:24.182902262 +0100
+++ cryptsetup-2.0.0-rc1/Makefile.in 2017-11-20 12:56:19.702622374 +0100
@@ -99,20 +99,22 @@ sbin_PROGRAMS = $(am__EXEEXT_1) $(am__EX
@INTEGRITYSETUP_TRUE@am__append_3 = man/integritysetup.8
@PYTHON_CRYPTSETUP_TRUE@am__append_4 = python/pycryptsetup-test.py
@CRYPTSETUP_TMPFILE_TRUE@am__append_5 = scripts/cryptsetup.conf
-@CRYPTO_BACKEND_GCRYPT_TRUE@am__append_6 = lib/crypto_backend/crypto_gcrypt.c
-@CRYPTO_BACKEND_OPENSSL_TRUE@am__append_7 = lib/crypto_backend/crypto_openssl.c
-@CRYPTO_BACKEND_NSS_TRUE@am__append_8 = lib/crypto_backend/crypto_nss.c
-@CRYPTO_BACKEND_KERNEL_TRUE@am__append_9 = lib/crypto_backend/crypto_kernel.c
-@CRYPTO_BACKEND_NETTLE_TRUE@am__append_10 = lib/crypto_backend/crypto_nettle.c
-@CRYPTO_INTERNAL_PBKDF2_TRUE@am__append_11 = lib/crypto_backend/pbkdf2_generic.c
-@CRYPTSETUP_TRUE@am__append_12 = cryptsetup
-@CRYPTSETUP_TRUE@@STATIC_TOOLS_TRUE@am__append_13 = cryptsetup.static
-@VERITYSETUP_TRUE@am__append_14 = veritysetup
-@STATIC_TOOLS_TRUE@@VERITYSETUP_TRUE@am__append_15 = veritysetup.static
-@INTEGRITYSETUP_TRUE@am__append_16 = integritysetup
-@INTEGRITYSETUP_TRUE@@STATIC_TOOLS_TRUE@am__append_17 = integritysetup.static
-@REENCRYPT_TRUE@am__append_18 = cryptsetup-reencrypt
-@REENCRYPT_TRUE@@STATIC_TOOLS_TRUE@am__append_19 = cryptsetup-reencrypt.static
+@CRYPTO_INTERNAL_ARGON2_TRUE@am__append_6 = libargon2.la
+@CRYPTO_INTERNAL_ARGON2_TRUE@am__append_7 = lib/crypto_backend/argon2/LICENSE
+@CRYPTO_BACKEND_GCRYPT_TRUE@am__append_8 = lib/crypto_backend/crypto_gcrypt.c
+@CRYPTO_BACKEND_OPENSSL_TRUE@am__append_9 = lib/crypto_backend/crypto_openssl.c
+@CRYPTO_BACKEND_NSS_TRUE@am__append_10 = lib/crypto_backend/crypto_nss.c
+@CRYPTO_BACKEND_KERNEL_TRUE@am__append_11 = lib/crypto_backend/crypto_kernel.c
+@CRYPTO_BACKEND_NETTLE_TRUE@am__append_12 = lib/crypto_backend/crypto_nettle.c
+@CRYPTO_INTERNAL_PBKDF2_TRUE@am__append_13 = lib/crypto_backend/pbkdf2_generic.c
+@CRYPTSETUP_TRUE@am__append_14 = cryptsetup
+@CRYPTSETUP_TRUE@@STATIC_TOOLS_TRUE@am__append_15 = cryptsetup.static
+@VERITYSETUP_TRUE@am__append_16 = veritysetup
+@STATIC_TOOLS_TRUE@@VERITYSETUP_TRUE@am__append_17 = veritysetup.static
+@INTEGRITYSETUP_TRUE@am__append_18 = integritysetup
+@INTEGRITYSETUP_TRUE@@STATIC_TOOLS_TRUE@am__append_19 = integritysetup.static
+@REENCRYPT_TRUE@am__append_20 = cryptsetup-reencrypt
+@REENCRYPT_TRUE@@STATIC_TOOLS_TRUE@am__append_21 = cryptsetup-reencrypt.static
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -167,14 +169,27 @@ am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) \
$(pyexec_LTLIBRARIES)
libargon2_la_LIBADD =
+am__libargon2_la_SOURCES_DIST = \
+ lib/crypto_backend/argon2/blake2/blake2b.c \
+ lib/crypto_backend/argon2/blake2/blake2.h \
+ lib/crypto_backend/argon2/blake2/blake2-impl.h \
+ lib/crypto_backend/argon2/blake2/blamka-round-ref.h \
+ lib/crypto_backend/argon2/argon2.c \
+ lib/crypto_backend/argon2/argon2.h \
+ lib/crypto_backend/argon2/core.c \
+ lib/crypto_backend/argon2/core.h \
+ lib/crypto_backend/argon2/encoding.c \
+ lib/crypto_backend/argon2/encoding.h \
+ lib/crypto_backend/argon2/ref.c \
+ lib/crypto_backend/argon2/thread.c \
+ lib/crypto_backend/argon2/thread.h
am__dirstamp = $(am__leading_dot)dirstamp
-am_libargon2_la_OBJECTS = \
- lib/crypto_backend/argon2/blake2/libargon2_la-blake2b.lo \
- lib/crypto_backend/argon2/libargon2_la-argon2.lo \
- lib/crypto_backend/argon2/libargon2_la-core.lo \
- lib/crypto_backend/argon2/libargon2_la-encoding.lo \
- lib/crypto_backend/argon2/libargon2_la-ref.lo \
- lib/crypto_backend/argon2/libargon2_la-thread.lo
+@CRYPTO_INTERNAL_ARGON2_TRUE@am_libargon2_la_OBJECTS = lib/crypto_backend/argon2/blake2/libargon2_la-blake2b.lo \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/libargon2_la-argon2.lo \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/libargon2_la-core.lo \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/libargon2_la-encoding.lo \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/libargon2_la-ref.lo \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/libargon2_la-thread.lo
libargon2_la_OBJECTS = $(am_libargon2_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -183,6 +198,7 @@ am__v_lt_1 =
libargon2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libargon2_la_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+@CRYPTO_INTERNAL_ARGON2_TRUE@am_libargon2_la_rpath =
am__libcrypto_backend_la_SOURCES_DIST = \
lib/crypto_backend/crypto_backend.h \
lib/crypto_backend/crypto_cipher_kernel.c \
@@ -423,7 +439,7 @@ SOURCES = $(libargon2_la_SOURCES) $(libc
$(cryptsetup_static_SOURCES) $(integritysetup_SOURCES) \
$(integritysetup_static_SOURCES) $(veritysetup_SOURCES) \
$(veritysetup_static_SOURCES)
-DIST_SOURCES = $(libargon2_la_SOURCES) \
+DIST_SOURCES = $(am__libargon2_la_SOURCES_DIST) \
$(am__libcrypto_backend_la_SOURCES_DIST) \
$(libcryptsetup_la_SOURCES) \
$(am__pycryptsetup_la_SOURCES_DIST) \
@@ -741,8 +757,7 @@ top_srcdir = @top_srcdir@
EXTRA_DIST = COPYING.LGPL FAQ docs misc man/cryptsetup.8 \
man/integritysetup.8 man/veritysetup.8 \
man/cryptsetup-reencrypt.8 python/pycryptsetup-test.py \
- lib/crypto_backend/argon2/LICENSE lib/libcryptsetup.pc.in \
- lib/libcryptsetup.sym
+ $(am__append_7) lib/libcryptsetup.pc.in lib/libcryptsetup.sym
SUBDIRS = po tests
TESTS = $(am__append_4)
CLEANFILES = python/*.img
@@ -760,7 +775,7 @@ AM_CPPFLAGS = \
AM_CFLAGS = -Wall
AM_LDFLAGS =
tmpfilesddir = @DEFAULT_TMPFILESDIR@
-noinst_LTLIBRARIES = libargon2.la libcrypto_backend.la
+noinst_LTLIBRARIES = $(am__append_6) libcrypto_backend.la
man8_MANS = man/cryptsetup.8 $(am__append_1) $(am__append_2) \
$(am__append_3)
tmpfilesd_DATA = $(am__append_5)
@@ -769,31 +784,31 @@ tmpfilesd_DATA = $(am__append_5)
@PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_CPPFLAGS = $(AM_CPPFLAGS) $(PYTHON_CPPFLAGS) $(PYTHON_INCLUDES) -fno-strict-aliasing
@PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
@PYTHON_CRYPTSETUP_TRUE@pycryptsetup_la_LIBADD = libcryptsetup.la $(PYTHON_LIBS)
-libargon2_la_CFLAGS = $(AM_CFLAGS) -std=c89 -pthread -O3
-libargon2_la_CPPFLAGS = $(AM_CPPFLAGS) -I lib/crypto_backend/argon2/blake2
-libargon2_la_SOURCES = \
- lib/crypto_backend/argon2/blake2/blake2b.c \
- lib/crypto_backend/argon2/blake2/blake2.h \
- lib/crypto_backend/argon2/blake2/blake2-impl.h \
- lib/crypto_backend/argon2/blake2/blamka-round-ref.h \
- lib/crypto_backend/argon2/argon2.c \
- lib/crypto_backend/argon2/argon2.h \
- lib/crypto_backend/argon2/core.c \
- lib/crypto_backend/argon2/core.h \
- lib/crypto_backend/argon2/encoding.c \
- lib/crypto_backend/argon2/encoding.h \
- lib/crypto_backend/argon2/ref.c \
- lib/crypto_backend/argon2/thread.c \
- lib/crypto_backend/argon2/thread.h
+@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CFLAGS = $(AM_CFLAGS) -std=c89 -pthread -O3
+@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_CPPFLAGS = $(AM_CPPFLAGS) -I lib/crypto_backend/argon2/blake2
+@CRYPTO_INTERNAL_ARGON2_TRUE@libargon2_la_SOURCES = \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/blake2/blake2b.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/blake2/blake2.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/blake2/blake2-impl.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/blake2/blamka-round-ref.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/argon2.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/argon2.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/core.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/core.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/encoding.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/encoding.h \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/ref.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/thread.c \
+@CRYPTO_INTERNAL_ARGON2_TRUE@ lib/crypto_backend/argon2/thread.h
libcrypto_backend_la_CFLAGS = $(AM_CFLAGS) @CRYPTO_CFLAGS@
libcrypto_backend_la_SOURCES = lib/crypto_backend/crypto_backend.h \
lib/crypto_backend/crypto_cipher_kernel.c \
lib/crypto_backend/crypto_storage.c \
lib/crypto_backend/pbkdf_check.c lib/crypto_backend/crc32.c \
- lib/crypto_backend/argon2_generic.c $(am__append_6) \
- $(am__append_7) $(am__append_8) $(am__append_9) \
- $(am__append_10) $(am__append_11)
+ lib/crypto_backend/argon2_generic.c $(am__append_8) \
+ $(am__append_9) $(am__append_10) $(am__append_11) \
+ $(am__append_12) $(am__append_13)
@CRYPTO_INTERNAL_ARGON2_TRUE@libcrypto_backend_la_DEPENDENCIES = libargon2.la
@CRYPTO_INTERNAL_ARGON2_TRUE@libcrypto_backend_la_LIBADD = libargon2.la
pkgconfigdir = $(libdir)/pkgconfig
@@ -976,7 +991,8 @@ libcryptsetup_la_SOURCES = \
ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = \
--enable-python \
- --with-tmpfilesdir=$$dc_install_base/usr/lib/tmpfiles.d
+ --with-tmpfilesdir=$$dc_install_base/usr/lib/tmpfiles.d \
+ --enable-internal-argon2
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -1149,7 +1165,7 @@ lib/crypto_backend/argon2/libargon2_la-t
lib/crypto_backend/argon2/$(DEPDIR)/$(am__dirstamp)
libargon2.la: $(libargon2_la_OBJECTS) $(libargon2_la_DEPENDENCIES) $(EXTRA_libargon2_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libargon2_la_LINK) $(libargon2_la_OBJECTS) $(libargon2_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libargon2_la_LINK) $(am_libargon2_la_rpath) $(libargon2_la_OBJECTS) $(libargon2_la_LIBADD) $(LIBS)
lib/crypto_backend/$(am__dirstamp):
@$(MKDIR_P) lib/crypto_backend
@: > lib/crypto_backend/$(am__dirstamp)

View File

@ -3,14 +3,14 @@
Summary: A utility for setting up encrypted disks Summary: A utility for setting up encrypted disks
Name: cryptsetup Name: cryptsetup
Version: 2.0.0 Version: 2.0.0
Release: 0.4%{?dist} Release: 0.5%{?dist}
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
Group: Applications/System Group: Applications/System
URL: https://gitlab.com/cryptsetup/cryptsetup URL: https://gitlab.com/cryptsetup/cryptsetup
BuildRequires: libgcrypt-devel, popt-devel, device-mapper-devel BuildRequires: libgcrypt-devel, popt-devel, device-mapper-devel
BuildRequires: libgpg-error-devel, libuuid-devel, libsepol-devel BuildRequires: libgpg-error-devel, libuuid-devel, libsepol-devel
BuildRequires: libselinux-devel, python-devel, python3-devel BuildRequires: libselinux-devel, python-devel, python3-devel
BuildRequires: libpwquality-devel, json-c-devel BuildRequires: libpwquality-devel, json-c-devel, libargon2-devel
Provides: cryptsetup-luks = %{version}-%{release} Provides: cryptsetup-luks = %{version}-%{release}
Obsoletes: cryptsetup-luks < 1.4.0 Obsoletes: cryptsetup-luks < 1.4.0
Requires: cryptsetup-libs = %{version}-%{release} Requires: cryptsetup-libs = %{version}-%{release}
@ -18,6 +18,7 @@ Requires: libpwquality >= 1.2.0
%global upstream_version %{version}-rc1 %global upstream_version %{version}-rc1
Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v2.0/cryptsetup-%{upstream_version}.tar.xz Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v2.0/cryptsetup-%{upstream_version}.tar.xz
Patch0: build-libargon2-fix.patch
%description %description
The cryptsetup package contains a utility for setting up The cryptsetup package contains a utility for setting up
@ -101,6 +102,7 @@ for setting up disk encryption using dm-crypt kernel module.
%prep %prep
%setup -q -n cryptsetup-%{upstream_version} %setup -q -n cryptsetup-%{upstream_version}
%patch0 -p1
chmod -x python/pycryptsetup-test.py chmod -x python/pycryptsetup-test.py
chmod -x misc/dracut_90reencrypt/* chmod -x misc/dracut_90reencrypt/*
@ -108,14 +110,14 @@ chmod -x misc/dracut_90reencrypt/*
cp -a . %{py3dir} cp -a . %{py3dir}
%build %build
%configure --enable-python --enable-fips --enable-pwquality %{?configure_pbkdf2} %configure --enable-python --enable-fips --enable-pwquality --enable-libargon2 %{?configure_pbkdf2}
# remove rpath # remove rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags} make %{?_smp_mflags}
pushd %{py3dir} pushd %{py3dir}
%configure --enable-python --with-python_version=3 %configure --enable-python --with-python_version=3 --enable-fips --enable-pwquality --enable-libargon2 %{?configure_pbkdf2}
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
@ -188,6 +190,9 @@ popd
%clean %clean
%changelog %changelog
* Mon Nov 20 2017 Milan Broz <gmazyland@gmail.com> - 2.0.0-0.5
- Link to system libargon2 instead of using bundled code.
* Thu Nov 09 2017 Ondrej Kozina <okozina@redhat.com> - 2.0.0-0.4 * Thu Nov 09 2017 Ondrej Kozina <okozina@redhat.com> - 2.0.0-0.4
- Drop the legacy library. - Drop the legacy library.