From 46c3c53b0ac3b95804811893e8962510b21f7d1e Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 30 Jul 2024 14:34:54 +0000 Subject: automatic import of cryptsetup --- .gitignore | 1 + 0001-cryptsetup-add-system-library-paths.patch | 35 +++++ 0002-fix-compat-test.patch | 69 ++++++++++ cryptsetup.spec | 176 +++++++++++++++++++++++++ sources | 1 + 5 files changed, 282 insertions(+) create mode 100644 0001-cryptsetup-add-system-library-paths.patch create mode 100644 0002-fix-compat-test.patch create mode 100644 cryptsetup.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..7614475 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/cryptsetup-2.7.4.tar.xz diff --git a/0001-cryptsetup-add-system-library-paths.patch b/0001-cryptsetup-add-system-library-paths.patch new file mode 100644 index 0000000..b09218e --- /dev/null +++ b/0001-cryptsetup-add-system-library-paths.patch @@ -0,0 +1,35 @@ +From b4d26d1500682dc375759c0ed16677197a433c64 Mon Sep 17 00:00:00 2001 +From: geruijun +Date: Sat, 18 Jul 2020 10:29:43 +0800 +Subject: [PATCH 1/2] cryptsetup add system library paths + +--- + configure | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 145be42..7643af8 100755 +--- a/configure ++++ b/configure +@@ -12294,6 +12294,9 @@ fi + # before this can be enabled. + hardcode_into_libs=yes + ++ # Add ABI-specific directories to the system library path. ++ sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" ++ + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command +@@ -12302,7 +12305,7 @@ fi + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +-- +1.8.3.1 + diff --git a/0002-fix-compat-test.patch b/0002-fix-compat-test.patch new file mode 100644 index 0000000..172aa35 --- /dev/null +++ b/0002-fix-compat-test.patch @@ -0,0 +1,69 @@ +From f73c9760f43897fce0d6aa32042f751a2e7d0de0 Mon Sep 17 00:00:00 2001 +From: hanzhijun +Date: Sat, 18 Jul 2020 10:30:03 +0800 +Subject: [PATCH 2/2] fix compat test + +--- + tests/compat-test | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/tests/compat-test b/tests/compat-test +index a71b247..9e395b1 100755 +--- a/tests/compat-test ++++ b/tests/compat-test +@@ -23,6 +23,7 @@ PWD0="compatkey" + PWD1="93R4P4pIqAH8" + PWD2="mymJeD8ivEhE" + PWD3="ocMakf3fAcQO" ++PWD4="hkj123HJGS12" + PWDW="rUkL4RUryBom" + VK_FILE="compattest_vkfile" + +@@ -239,17 +240,17 @@ echo $PWD1 | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT 2>/dev/null && fail + echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT || fail + echo -e "$PWD0\n$PWD1" | $CRYPTSETUP luksAddKey $IMG $FAST_PBKDF_OPT 2>/dev/null && fail + echo "[4] change key" +-echo -e "$PWD1\n$PWD0\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG || fail ++echo -e "$PWD1\n$PWD4\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG || fail + echo -e "$PWD1\n$PWD2\n" | $CRYPTSETUP luksChangeKey $FAST_PBKDF_OPT $IMG 2>/dev/null && fail + [ $? -ne 2 ] && fail "luksChangeKey should return EPERM exit code" + echo "[5] remove key" +-# delete active keys PWD0, PWD2 ++# delete active keys PWD2, PWD4 + echo $PWD1 | $CRYPTSETUP luksRemoveKey $IMG 2>/dev/null && fail + [ $? -ne 2 ] && fail "luksRemove should return EPERM exit code" +-echo $PWD0 | $CRYPTSETUP luksRemoveKey $IMG || fail + echo $PWD2 | $CRYPTSETUP luksRemoveKey $IMG || fail ++echo $PWD4 | $CRYPTSETUP luksRemoveKey $IMG || fail + # check if keys were deleted +-echo $PWD0 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail ++echo $PWD4 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail + [ $? -ne 1 ] && fail "luksOpen should return ENOENT exit code" + echo $PWD2 | $CRYPTSETUP luksOpen $IMG --test-passphrase 2>/dev/null && fail + [ $? -ne 1 ] && fail "luksOpen should return ENOENT exit code" +@@ -866,11 +867,11 @@ set timeout $EXPECT_TIMEOUT + eval spawn $CRYPTSETUP_RAW luksOpen -v -T 2 $LOOPDEV $DEV_NAME + expect timeout abort "Enter passphrase for $EXPECT_DEV:" + sleep 0.1 +-send "$PWD0 x\n" ++send "$PWD4 x\n" + expect timeout abort "No key available with this passphrase." + expect timeout abort "Enter passphrase for $EXPECT_DEV:" + sleep 0.1 +-send "$PWD0 y\n" ++send "$PWD4 y\n" + expect timeout abort "No key available with this passphrase." + expect timeout abort eof + exit +@@ -886,7 +887,7 @@ expect timeout abort "Are you sure? (Type 'yes' in capital letters):" + send "YES\n" + expect timeout abort "Enter any remaining passphrase:" + sleep 0.1 +-send "$PWD0\n" ++send "$PWD4\n" + expect timeout abort "Command successful." + expect timeout abort eof + eval spawn $CRYPTSETUP_RAW luksKillSlot -v $LOOPDEV 0 +-- +2.30.0 + diff --git a/cryptsetup.spec b/cryptsetup.spec new file mode 100644 index 0000000..e0ae9b0 --- /dev/null +++ b/cryptsetup.spec @@ -0,0 +1,176 @@ +Name: cryptsetup +Version: 2.7.4 +Release: 1 +Summary: Utility used to conveniently set up disk encryption +License: GPL-2.0-or-later WITH cryptsetup-OpenSSL-exception AND LGPL-2.1-or-later WITH cryptsetup-OpenSSL-exception +URL: https://gitlab.com/cryptsetup/cryptsetup +Source0: https://www.kernel.org/pub/linux/utils/cryptsetup/v2.7/cryptsetup-%{version}.tar.xz + +Patch1: 0001-cryptsetup-add-system-library-paths.patch +Patch2: 0002-fix-compat-test.patch + +BuildRequires: pkgconfig(blkid) +BuildRequires: pkgconfig(devmapper) >= 1.02.03 +BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(libargon2) +BuildRequires: pkgconfig(libcrypto) >= 0.9.8 +BuildRequires: pkgconfig(libssh) +BuildRequires: pkgconfig(pwquality) >= 1.0.0 +BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(uuid) +BuildRequires: popt-devel +BuildRequires: asciidoctor +Requires: libpwquality >= 1.0.0 + +Provides: %{name}-luks = %{version}-%{release} +Obsoletes: %{name}-luks < 1.4.0 +Provides: %{name}-libs = %{version}-%{release} +Obsoletes: %{name}-libs < %{version}-%{release} +Obsoletes: python2-%{name} < 2.1.0 +Obsoletes: %{name}-python3 < 2.1.0 + +%description +cryptsetup is a utility used to conveniently set up disk encryption based +on the DMCrypt kernel module. + +%package devel +Summary: Including header files and library for the developing of cryptsetup +Requires: %{name} = %{version}-%{release} +Provides: cryptsetup-luks-devel = %{version}-%{release} +Obsoletes: cryptsetup-luks-devel < 1.4.0 + +%description devel +This contains dynamic libraries and header files for the developing of cryptsetup. + +%package -n veritysetup +Summary: Utility for setting up disk verification +Requires: %{name} = %{version}-%{release} + +%description -n veritysetup +It contains a utility for setting up disk verification. + +%package -n integritysetup +Summary: Utility for setting up dm-integrity volumes +Requires: %{name} = %{version}-%{release} + +%description -n integritysetup +It contains a utility for setting up dm-integrity volumes. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +%configure --enable-fips --enable-pwquality --enable-libargon2 --with-crypto_backend=openssl +%make_build + +%check +%make_build check + +%install +%make_install +%find_lang cryptsetup + +%files -f cryptsetup.lang +%license COPYING COPYING.LGPL AUTHORS +%doc docs/* +%{_sbindir}/cryptsetup +%{_sbindir}/cryptsetup-ssh +%{_libdir}/libcryptsetup.so.* +%{_libdir}/cryptsetup/*.so +%{_tmpfilesdir}/cryptsetup.conf +%ghost %dir /run/cryptsetup +%exclude %{_libdir}/*.la +%exclude %{_libdir}/cryptsetup/*.la + +%files devel +%doc docs/examples/* +%{_libdir}/libcryptsetup.so +%{_includedir}/libcryptsetup.h +%{_libdir}/pkgconfig/libcryptsetup.pc + +%files -n veritysetup +%{_sbindir}/veritysetup + +%files -n integritysetup +%{_sbindir}/integritysetup + +%files help +%{_mandir}/man8/* + +%changelog +* Tue Jul 30 2024 Funda Wang - 2.7.4-1 +- update to 2.7.4 + +* Tue Feb 6 2024 wangzhiqiang - 2.6.1-1 +- upgrade version to 2.6.1 + +* Wed Mar 22 2023 wangzhiqiang - 2.6.0-2 +- fix potential null pointer dereference + +* Thu Feb 2 2023 wangzhiqiang - 2.6.0-1 +- upgrade version to 2.6.0 + +* Sat Oct 15 2022 wuguanghao - 2.4.3-2 +- correct license: add CC0-1.0 + +* Thu Oct 13 2022 wuguanghao - 2.4.3-1 +- upgrade version to 2.4.3 + +* Wed Nov 17 2021 Wenchao Hao - 2.4.1-1 +- Update to 2.4.1 version + +* Fri Jul 30 2021 chenyanpanHW - 2.3.3-5 +- DESC: delete -S git from %autosetup, and delete BuildRequires git + +* Tue Jun 29 2021 yanglongkang - 2.3.3-4 +- add buildrequire gcc + +* Wed Nov 4 2020 lixiaokeng - 2.3.3-3 +- add make check + +* Fri Oct 30 2020 Zhiqiang Liu - 2.3.3-2 +- backport upstream patches to solve several problems -epoch2 + +* Sat Jul 18 2020 Ruijun Ge - 2.3.3-1 +- update to 2.3.3 version + +* Tue Jun 30 2020 Zhiqiang Liu - 2.0.4-3 +- renumber patches. + +* Wed Aug 28 2019 zhanghaibo - 2.0.4-2 +- Type:enhancemnet +- ID:NA +- SUG:NA +- DESC:openEuler Debranding + +* Wed Aug 21 2019 renxudong - 2.0.4-1.h3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix blockwise-compat and compat-test + +* Mon May 6 2019 hanzhijun - 2.0.4-1.h2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix blockwise-compat and compat-test + +* Thu Apr 18 2019 wangxiao - 2.0.4-1.h1 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:Emit error message for converting inactive keyslot. + Move blkid scan after device context initialization. + Add blkid scan when attemting to open plain device. + Wiping empty device should not fail. + Do not copy buffer if read fails. + Do not fail if device is smaller than requested wipe size. + Do not print error for used device twice. + Fix issues found by Coverity scan. + Properly propagate error from AF diffuse function. + Check for device size and sector size misalignment. + Fix a possible NULL pointer in opt_type. + Upstream fixes to bundled Argon2 code. +- Package init diff --git a/sources b/sources new file mode 100644 index 0000000..423dd3c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +26ffe48f65d144af91b2a9639425d08c cryptsetup-2.7.4.tar.xz -- cgit v1.2.3