From e23a08d0c97a0cc415aaa165da840b056f93c997 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 8 Oct 2021 23:06:07 +0100 Subject: gentoo resync : 08.10.2021 --- sys-fs/cryptsetup/Manifest | 5 +- sys-fs/cryptsetup/cryptsetup-2.4.0-r1.ebuild | 133 ------------ sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild | 6 +- sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc | 0 ...yptsetup-2.4.1-fix-static-pwquality-build.patch | 225 +++++++++++++++++++++ 5 files changed, 232 insertions(+), 137 deletions(-) delete mode 100644 sys-fs/cryptsetup/cryptsetup-2.4.0-r1.ebuild mode change 100644 => 100755 sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc create mode 100644 sys-fs/cryptsetup/files/cryptsetup-2.4.1-fix-static-pwquality-build.patch (limited to 'sys-fs/cryptsetup') diff --git a/sys-fs/cryptsetup/Manifest b/sys-fs/cryptsetup/Manifest index 055afb88e642..b85c1ce6d01d 100644 --- a/sys-fs/cryptsetup/Manifest +++ b/sys-fs/cryptsetup/Manifest @@ -4,10 +4,9 @@ AUX 2.4.0-dmcrypt.confd 4009 BLAKE2B efaf826fc78b60068aeddb6d5fbd9665bcf85e66c5f AUX 2.4.0-dmcrypt.rc 9059 BLAKE2B 622320bd69a9e2d2779bd0eb97034635335125d2def73f66ba4be5df1a0d29da7c1dadd0e2379a5f4ef35a9b17d4cb11fe2419cce6cad2df63546370b6a1975b SHA512 7f32bd09e22405deb4a7cd8233da0262764233562421a8fb49bd625be591f1dc27154c2204462df480668ab2f1a81aab5a992f426603a8a4fd86cd15a27a6a97 AUX cryptsetup-2.0.4-fix-static-pwquality-build.patch 427 BLAKE2B dfdc56c6627084732973254cd52c48f0869aa7b4c58e466840a87f77c1d4fb09ae37295fb54e980abccfdfe51dc63161e188a0be9bb4bf3c69d7731120f84bac SHA512 23b5f9b21ec86c92787bfc8744682ce0777dfa87e1de97afbb8db33c4587f1e2c8e5f8c9d0fa56ca801d7795739f9a66f14633d8a3904ea68ddd58ddc3863adf AUX cryptsetup-2.4.1-external-tokens.patch 1015 BLAKE2B ca7b5940caf000cc97742dfcbf8ee38e9fec049a4a3788737b283851dc3fd340664d332aff507f8d9d5962bca66b56a232419902114ac08ace5df76825cccd1a SHA512 23dff40a535ac1d4ccae41cc7a24e0ca53b412e0f6c0fc3e4a8ef7b7255ed28d8010a5684aa5029ec1d5d534196c4fbb83bc2a1ab5794cc6197b19f1a0696bab +AUX cryptsetup-2.4.1-fix-static-pwquality-build.patch 5226 BLAKE2B 1dfd8b001e8284d5efd5afe0d67a401d334e9588baf6d0f18f533694dd4a22a782066ee43f22fe5bfaea51fc09beac127e91c77b07fc9a63778b55b25e0d2ebf SHA512 71a3f63b86de72ccfa49c9294db433da7f1fd6366e328f7311051edfd980f630ca3435ef8c5e92c55083eb3b25a3b2bbafa75282de1bf65be6820655b7556f2f DIST cryptsetup-2.3.6.tar.xz 11154148 BLAKE2B 23a7d6fdeed2b8fb0492e800266a263b12dcf2b8c4304bda82e46d2de90b6c05a97a40f0f6f9c337b3dc428d51689d76953de5cc4daed210967cf0ea0ff503d2 SHA512 5b25cc806140d24181a0e4f0e7b0bd3caa8263aa502e8633b41c980f06ecba2e6acbf9c2d9cc4a785d38ce90d86dd8d22c52b28b9ca4a15824c2e8bdb3656665 -DIST cryptsetup-2.4.0.tar.xz 11162168 BLAKE2B a2074d1607ff3c136818b14ea3939fde3a528430b50ebd4d483d1e164ede6a62432c27e0d7d8b29b89ad6bce69dae30fc6bdf5ce458b3c6faa5178f6218519e6 SHA512 9c868b1dee7145f91092160cf977d3ada57a14634b5312d54477e111250975b6f077a92c417373bb7de07244b01ab19553bcce5030ee456ca2c38030e3067186 DIST cryptsetup-2.4.1.tar.xz 11171180 BLAKE2B 6b999a19df54276d295eb2f1729be2eefb5fb09cd29aae5f7c0b93c539b4b552f92327f2474e0f4793a3c7f8a264a4ef927178dabfc9ba56012bdf9949ef9ada SHA512 17fc73c180e41acbd4ebeddebaf54f8baeef09fce7f154aa9c55936a58bda7adcc7b1bb257336c22295d7b5af426fc8dfd0e4e644e4a52098bcb8a2adb562ca7 EBUILD cryptsetup-2.3.6-r2.ebuild 3908 BLAKE2B f2b709398da106f2d2b89365d67eee7298703035b1c94960fc0819b00dc48231692a6df2bf13322778e3704003bc0637a14d8198343053010b74fd21b1f52050 SHA512 6a9ee5bdd788a51944af30311ec84698d0fcaf19fe5845be4e0758dc89367ba9786c47b861595dfa691e3b9a82e11a239e54b1166fddd4848ec3bf37d5ceb195 -EBUILD cryptsetup-2.4.0-r1.ebuild 4118 BLAKE2B 87d307168f52ba2476fa3acfbe4a9203a6a720ea957bc5be45acec3264311e2648270878cfbf4ba82b8935cbd8fa49dc32843617bc5f70b54c0c222b6b693d83 SHA512 eb71c347d866fd91f9ed940ce32daa117204259f55eed0e65e99f12c2756e5dcd857ff954171c861aa8eacead09fb714e2133169544766300c22dcec68273920 -EBUILD cryptsetup-2.4.1-r1.ebuild 4134 BLAKE2B 057b3f0f264a35155971feb860c83ac7fba48f963973aa626543f7aa0172f2284f1f0d6ea4469e144a0f12dc202b5f0278d4221865fc5ed942ca822d2e221865 SHA512 512df86889fdbd000b2c17f36c1cee96976be1a92c1c3421ed4f320bf822ff2026159d708b0cdd50c69b72ab682312aad0bdbd569849a68a9f6f7930f4ab315d +EBUILD cryptsetup-2.4.1-r1.ebuild 4283 BLAKE2B 599590bf68883aad5e64b6a5affc0a464df4339abd11fe9088ea980fc400ba5bc6e7a5fbbd4792a73f735351ea348d1ade9ed42fb9480c991be5e48753799f3c SHA512 bf6ed2dd41144874931c56c4fb697ae4c3df696fefa11373352921729e9e4b9db4f8cd0f4094ba170ebe7a5e8a61c76673b0bc554857090b61f9e0b6ad61f51e MISC metadata.xml 1076 BLAKE2B 132b07201bfa3a7d8889d0b2558c15f35829bfa021b31cd5a9cf2cb21de822ceb89fae177b014590f46411cd609b4e44b20165b07c7676483a547987fffcbb9d SHA512 b06b884e0e369022cea4b3634d9df3c7d62d854754969d0c7848a3baf3a3ea69cce2131527539600424c72c539e502378b0627ba7c4fdcbc74e6f7a58b5800a8 diff --git a/sys-fs/cryptsetup/cryptsetup-2.4.0-r1.ebuild b/sys-fs/cryptsetup/cryptsetup-2.4.0-r1.ebuild deleted file mode 100644 index 09141d7320f9..000000000000 --- a/sys-fs/cryptsetup/cryptsetup-2.4.0-r1.ebuild +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit autotools linux-info tmpfiles - -DESCRIPTION="Tool to setup encrypted devices with dm-crypt" -HOMEPAGE="https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md" -SRC_URI="https://www.kernel.org/pub/linux/utils/${PN}/v$(ver_cut 1-2)/${P/_/-}.tar.xz" - -LICENSE="GPL-2+" -SLOT="0/12" # libcryptsetup.so version -[[ ${PV} != *_rc* ]] && \ -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -CRYPTO_BACKENDS="gcrypt kernel nettle +openssl" -# we don't support nss since it doesn't allow cryptsetup to be built statically -# and it's missing ripemd160 support so it can't provide full backward compatibility -IUSE="${CRYPTO_BACKENDS} +argon2 nls pwquality reencrypt ssh static static-libs +udev urandom" -REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} ) - static? ( !gcrypt !udev )" #496612 - -LIB_DEPEND=" - dev-libs/json-c:=[static-libs(+)] - dev-libs/libgpg-error[static-libs(+)] - dev-libs/popt[static-libs(+)] - >=sys-apps/util-linux-2.31-r1[static-libs(+)] - argon2? ( app-crypt/argon2:=[static-libs(+)] ) - gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] ) - nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] ) - openssl? ( dev-libs/openssl:0=[static-libs(+)] ) - pwquality? ( dev-libs/libpwquality[static-libs(+)] ) - ssh? ( net-libs/libssh[static-libs(+)] ) - sys-fs/lvm2[static-libs(+)]" -# We have to always depend on ${LIB_DEPEND} rather than put behind -# !static? () because we provide a shared library which links against -# these other packages. #414665 -RDEPEND="static-libs? ( ${LIB_DEPEND} ) - ${LIB_DEPEND//\[static-libs\([+-]\)\]} - udev? ( virtual/libudev:= )" -DEPEND="${RDEPEND} - static? ( ${LIB_DEPEND} )" -BDEPEND=" - virtual/pkgconfig -" - -S="${WORKDIR}/${P/_/-}" - -PATCHES=( "${FILESDIR}"/${PN}-2.0.4-fix-static-pwquality-build.patch ) - -pkg_setup() { - local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC ~CRYPTO_SHA256" - local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n" - local WARNING_CRYPTO_SHA256="CONFIG_CRYPTO_SHA256:\tis not set (required for cryptsetup)\n" - local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n" - local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n" - check_extra_config -} - -src_prepare() { - sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die - default - eautoreconf -} - -src_configure() { - if use kernel ; then - ewarn "Note that kernel backend is very slow for this type of operation" - ewarn "and is provided mainly for embedded systems wanting to avoid" - ewarn "userspace crypto libraries." - fi - - local myeconfargs=( - --disable-internal-argon2 - --enable-shared - --sbindir=/sbin - # for later use - --with-default-luks-format=LUKS2 - --with-tmpfilesdir="${EPREFIX}/usr/lib/tmpfiles.d" - --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/} ; do usev ${x} ; done) - $(use_enable argon2 libargon2) - $(use_enable nls) - $(use_enable pwquality) - $(use_enable reencrypt cryptsetup-reencrypt) - $(use_enable static static-cryptsetup) - $(use_enable static-libs static) - $(use_enable udev) - $(use_enable !urandom dev-random) - $(use_enable ssh ssh-token) - $(usex argon2 '' '--with-luks2-pbkdf=pbkdf2') - ) - econf "${myeconfargs[@]}" -} - -src_test() { - if [[ ! -e /dev/mapper/control ]] ; then - ewarn "No /dev/mapper/control found -- skipping tests" - return 0 - fi - - local p - for p in /dev/mapper /dev/loop* ; do - addwrite ${p} - done - - default -} - -src_install() { - default - - if use static ; then - mv "${ED}"/sbin/cryptsetup{.static,} || die - mv "${ED}"/sbin/veritysetup{.static,} || die - mv "${ED}"/sbin/integritysetup{.static,} || die - if use ssh ; then - mv "${ED}"/sbin/cryptsetup-ssh{.static,} || die - fi - if use reencrypt ; then - mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die - fi - fi - find "${ED}" -type f -name "*.la" -delete || die - - dodoc docs/v*ReleaseNotes - - newconfd "${FILESDIR}"/2.4.0-dmcrypt.confd dmcrypt - newinitd "${FILESDIR}"/2.4.0-dmcrypt.rc dmcrypt -} - -pkg_postinst() { - tmpfiles_process cryptsetup.conf -} diff --git a/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild b/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild index cd60372120e6..928f589b9606 100644 --- a/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild +++ b/sys-fs/cryptsetup/cryptsetup-2.4.1-r1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -inherit linux-info tmpfiles +inherit autotools linux-info tmpfiles DESCRIPTION="Tool to setup encrypted devices with dm-crypt" HOMEPAGE="https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md" @@ -50,6 +50,9 @@ S="${WORKDIR}/${P/_/-}" PATCHES=( "${FILESDIR}"/cryptsetup-2.4.1-external-tokens.patch + + # Remove autotools/eautoreconf when this patch is dropped. + "${FILESDIR}"/cryptsetup-2.4.1-fix-static-pwquality-build.patch ) pkg_setup() { @@ -64,6 +67,7 @@ pkg_setup() { src_prepare() { sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die default + eautoreconf } src_configure() { diff --git a/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc b/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc old mode 100644 new mode 100755 diff --git a/sys-fs/cryptsetup/files/cryptsetup-2.4.1-fix-static-pwquality-build.patch b/sys-fs/cryptsetup/files/cryptsetup-2.4.1-fix-static-pwquality-build.patch new file mode 100644 index 000000000000..f39e88507ffd --- /dev/null +++ b/sys-fs/cryptsetup/files/cryptsetup-2.4.1-fix-static-pwquality-build.patch @@ -0,0 +1,225 @@ +From 26cc1644b489578c76ec6f576614ca885c00a35d Mon Sep 17 00:00:00 2001 +From: Milan Broz +Date: Wed, 6 Oct 2021 12:27:25 +0200 +Subject: [PATCH 1/2] Do not link integritysetup and veritysetup with + pwquality. + +These tools do not read passphrases, no need to link to these libraries. + +Just move the helper code that introduced this dependence as a side-effect. + +Fixes: #677 +--- + src/Makemodule.am | 6 ----- + src/utils_password.c | 56 -------------------------------------------- + src/utils_tools.c | 56 ++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 56 insertions(+), 62 deletions(-) + +diff --git a/src/Makemodule.am b/src/Makemodule.am +index a6dc50cf..f2b896bf 100644 +--- a/src/Makemodule.am ++++ b/src/Makemodule.am +@@ -52,7 +52,6 @@ veritysetup_SOURCES = \ + src/utils_arg_names.h \ + src/utils_arg_macros.h \ + src/utils_tools.c \ +- src/utils_password.c \ + src/veritysetup.c \ + src/veritysetup_args.h \ + src/veritysetup_arg_list.h \ +@@ -61,8 +60,6 @@ veritysetup_SOURCES = \ + veritysetup_LDADD = $(LDADD) \ + libcryptsetup.la \ + @POPT_LIBS@ \ +- @PWQUALITY_LIBS@ \ +- @PASSWDQC_LIBS@ \ + @BLKID_LIBS@ + + sbin_PROGRAMS += veritysetup +@@ -91,7 +88,6 @@ integritysetup_SOURCES = \ + src/utils_arg_names.h \ + src/utils_arg_macros.h \ + src/utils_tools.c \ +- src/utils_password.c \ + src/utils_blockdev.c \ + src/integritysetup.c \ + src/integritysetup_args.h \ +@@ -101,8 +97,6 @@ integritysetup_SOURCES = \ + integritysetup_LDADD = $(LDADD) \ + libcryptsetup.la \ + @POPT_LIBS@ \ +- @PWQUALITY_LIBS@ \ +- @PASSWDQC_LIBS@ \ + @UUID_LIBS@ \ + @BLKID_LIBS@ + +diff --git a/src/utils_password.c b/src/utils_password.c +index 58f3a7b3..65618b9c 100644 +--- a/src/utils_password.c ++++ b/src/utils_password.c +@@ -318,59 +318,3 @@ void tools_passphrase_msg(int r) + else if (r == -ENOENT) + log_err(_("No usable keyslot is available.")); + } +- +-int tools_read_mk(const char *file, char **key, int keysize) +-{ +- int fd = -1, r = -EINVAL; +- +- if (keysize <= 0 || !key) +- return -EINVAL; +- +- *key = crypt_safe_alloc(keysize); +- if (!*key) +- return -ENOMEM; +- +- fd = open(file, O_RDONLY); +- if (fd == -1) { +- log_err(_("Cannot read keyfile %s."), file); +- goto out; +- } +- +- if (read_buffer(fd, *key, keysize) != keysize) { +- log_err(_("Cannot read %d bytes from keyfile %s."), keysize, file); +- goto out; +- } +- r = 0; +-out: +- if (fd != -1) +- close(fd); +- +- if (r) { +- crypt_safe_free(*key); +- *key = NULL; +- } +- +- return r; +-} +- +-int tools_write_mk(const char *file, const char *key, int keysize) +-{ +- int fd, r = -EINVAL; +- +- if (keysize <= 0 || !key) +- return -EINVAL; +- +- fd = open(file, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR); +- if (fd < 0) { +- log_err(_("Cannot open keyfile %s for write."), file); +- return r; +- } +- +- if (write_buffer(fd, key, keysize) == keysize) +- r = 0; +- else +- log_err(_("Cannot write to keyfile %s."), file); +- +- close(fd); +- return r; +-} +diff --git a/src/utils_tools.c b/src/utils_tools.c +index dbd83695..cf66e4c4 100644 +--- a/src/utils_tools.c ++++ b/src/utils_tools.c +@@ -493,3 +493,59 @@ int tools_reencrypt_progress(uint64_t size, uint64_t offset, void *usrptr) + + return r; + } ++ ++int tools_read_mk(const char *file, char **key, int keysize) ++{ ++ int fd = -1, r = -EINVAL; ++ ++ if (keysize <= 0 || !key) ++ return -EINVAL; ++ ++ *key = crypt_safe_alloc(keysize); ++ if (!*key) ++ return -ENOMEM; ++ ++ fd = open(file, O_RDONLY); ++ if (fd == -1) { ++ log_err(_("Cannot read keyfile %s."), file); ++ goto out; ++ } ++ ++ if (read_buffer(fd, *key, keysize) != keysize) { ++ log_err(_("Cannot read %d bytes from keyfile %s."), keysize, file); ++ goto out; ++ } ++ r = 0; ++out: ++ if (fd != -1) ++ close(fd); ++ ++ if (r) { ++ crypt_safe_free(*key); ++ *key = NULL; ++ } ++ ++ return r; ++} ++ ++int tools_write_mk(const char *file, const char *key, int keysize) ++{ ++ int fd, r = -EINVAL; ++ ++ if (keysize <= 0 || !key) ++ return -EINVAL; ++ ++ fd = open(file, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR); ++ if (fd < 0) { ++ log_err(_("Cannot open keyfile %s for write."), file); ++ return r; ++ } ++ ++ if (write_buffer(fd, key, keysize) == keysize) ++ r = 0; ++ else ++ log_err(_("Cannot write to keyfile %s."), file); ++ ++ close(fd); ++ return r; ++} +-- +GitLab + + +From d20beacba060f34e3ab0d71d191f59434031e98f Mon Sep 17 00:00:00 2001 +From: Milan Broz +Date: Wed, 6 Oct 2021 12:45:20 +0200 +Subject: [PATCH 2/2] Remove redundant link to uuid lib for static build. + +Veritysetup does not need to link this library at all, for others +we have link already in flags. +--- + src/Makemodule.am | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/Makemodule.am b/src/Makemodule.am +index f2b896bf..49e0c5aa 100644 +--- a/src/Makemodule.am ++++ b/src/Makemodule.am +@@ -71,8 +71,7 @@ veritysetup_static_LDFLAGS = $(AM_LDFLAGS) -all-static + veritysetup_static_LDADD = \ + $(veritysetup_LDADD) \ + @CRYPTO_STATIC_LIBS@ \ +- @DEVMAPPER_STATIC_LIBS@ \ +- @UUID_LIBS@ ++ @DEVMAPPER_STATIC_LIBS@ + endif + endif + +@@ -109,8 +108,7 @@ integritysetup_static_LDFLAGS = $(AM_LDFLAGS) -all-static + integritysetup_static_LDADD = \ + $(integritysetup_LDADD) \ + @CRYPTO_STATIC_LIBS@ \ +- @DEVMAPPER_STATIC_LIBS@ \ +- @UUID_LIBS@ ++ @DEVMAPPER_STATIC_LIBS@ + endif + endif + +-- +GitLab + -- cgit v1.2.3