diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-05-11 19:55:43 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-05-11 19:55:43 +0100 |
commit | 185fa19bbf68a4d4dca534d2b46729207a177f16 (patch) | |
tree | a8a537b82fda83a0799c2ca9887f212558363aa7 /sys-fs/cryfs | |
parent | c8fd0d84af0bfd1949542adc2cbb735b1d28f9ed (diff) |
gentoo resync : 11.05.2021
Diffstat (limited to 'sys-fs/cryfs')
-rw-r--r-- | sys-fs/cryfs/Manifest | 3 | ||||
-rw-r--r-- | sys-fs/cryfs/cryfs-0.10.3.ebuild | 102 | ||||
-rw-r--r-- | sys-fs/cryfs/files/cryfs-0.10.3-gcc11.patch | 271 |
3 files changed, 376 insertions, 0 deletions
diff --git a/sys-fs/cryfs/Manifest b/sys-fs/cryfs/Manifest index cc58932200cc..37f0b0760e94 100644 --- a/sys-fs/cryfs/Manifest +++ b/sys-fs/cryfs/Manifest @@ -1,5 +1,8 @@ AUX cryfs-0.10.2-install-targets.patch 1296 BLAKE2B d43ada858124c67242fdf537ae3dd7e6b7bf3566ee564dae47aaa0b0ee3ae20c2beada683d8cda12518f89bda2919ec296c26d004c48a5bbc953aa6c23bc9dc8 SHA512 c097dcc9893dbe7f6098ab80d9937810856de16e6c34ede558dc30edf76571a2e1ef2fdd91fd8d14b2e40d5e32246d08d198cd3ba28f33d19442cd8c2332b4e7 AUX cryfs-0.10.2-unbundle-libs.patch 15634 BLAKE2B dc484cc722cf80e605f52f3b193b1ae5747ad01b796a6b7d8fd81b03be9bcde456591f94d2839c3be3a39dc2a9975ba503d8ad369bf838232157cf1385ef43d6 SHA512 815956b160f5f117a5c4f89babe088e6f485d89a58feb12d514ff0fd3d39752db6695f7a9a2e279d88eb3ef490394dd03ee8b0ca2d04f66793096fac742ae45c +AUX cryfs-0.10.3-gcc11.patch 14590 BLAKE2B c6541d1e211c9ae503ee83be18dd2283f2ac5785f5a975fcd155b02759f6180eb96b8673d98c71e20c101ac4afa4ceaab4c6ece14c6605e32f5c020f260568bc SHA512 4fa2817c9f10df4e371deb7fb4acc423dd8260277216cf959ace47d64bebe394db71c79cd72098c6b11ac27b88d98eab8b5cde5af5095a63d57dc88d7dea7085 DIST cryfs-0.10.2.tar.xz 7902252 BLAKE2B 704d124ed32a8a958f400188af99498cedb706ccfc004131b677a113b6ab2733942becb1ab64fd06d0b9d5b39f7abe832b3b0669caaf2b6feb7c6577c8c7fbfd SHA512 e49dd6d1e402d968cc4df0e8ca0460a01a27e4e73482041dca0fa9cde905a91d12e2bda18d257a044335e32e316b9363cecf374eb2ca621924b394dd2fabcb8f +DIST cryfs-0.10.3.tar.xz 7908228 BLAKE2B e1c816bd2ceb125573f5385c6ddb316a600275f0b907d89d3ab32f2050f1a0874ebbfd3db7b452b41d20dcbdd01bf59210a0a96c5bfee079ce222307d4c55596 SHA512 a1325c79cb253219bb092fd68399d6ec68aaf3d78bc95608582ab0c239dfaa0361416531cd1051661e4699b1e79867547710ea55d23e5697ebd4421c937d5b87 EBUILD cryfs-0.10.2.ebuild 2235 BLAKE2B 5a227f6b4f868c54714c9e92bbce5ed70fe5969b99369ffb899128c0396274d0df14372ce69edfabe1e62c823995d587e16c63fdd317230180f03f042ef29a32 SHA512 51bef48b570490b16949cfef42a4b1f8e164fd33666155401149e32c5aceaa9ba9198131923222ee479af436095892013349e14f0df8ceb0ef983abf47839c04 +EBUILD cryfs-0.10.3.ebuild 2312 BLAKE2B cbc726434fa65f78c3d8de05d4a84aaa9d8b631ae1211e720eab0bcb3e40b0ef48171abff626de4425316c465b0661b5aa097280bb34470aedc07106a4e51ae4 SHA512 c7983f54b60a9cbc9f59e5f0a9f6869d9f402aa2f70a1ea4865c50fd147243c2e6ce6258ea02187c40632975f444d9e20c18433f653c3fe313d47e72872ff8a0 MISC metadata.xml 521 BLAKE2B 970f5ce1a602a65ecc2d123edc08386312fcafce936b679d4de8963e3336f9fdbf314ac3d166635270efe9b226ec801fca202dadb887d155edaf9daa64da60d9 SHA512 0aeb067ca8dd47ec21a9e9f786443e4e75c384b0a648b94ed9d7b29b1ae8850af78933198e1f20dafc700416e8a9c954fb9c4544db7399823bb38376805d6775 diff --git a/sys-fs/cryfs/cryfs-0.10.3.ebuild b/sys-fs/cryfs/cryfs-0.10.3.ebuild new file mode 100644 index 000000000000..05cf0d45dc4f --- /dev/null +++ b/sys-fs/cryfs/cryfs-0.10.3.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +inherit cmake flag-o-matic linux-info python-any-r1 + +if [[ ${PV} == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/cryfs/cryfs" +else + SRC_URI="https://github.com/cryfs/cryfs/releases/download/${PV}/${P}.tar.xz" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" + S="${WORKDIR}" +fi + +DESCRIPTION="Encrypted FUSE filesystem that conceals metadata" +HOMEPAGE="https://www.cryfs.org/" + +LICENSE="LGPL-3 MIT" +SLOT="0" +IUSE="custom-optimization debug test" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-libs/boost-1.65.1:= + >=dev-libs/crypto++-8.2.0:= + net-misc/curl:= + >=sys-fs/fuse-2.8.6:0 + dev-libs/openssl:0= +" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + test? ( dev-cpp/gtest ) +" + +PATCHES=( + # TODO upstream: + "${FILESDIR}/${PN}-0.10.2-unbundle-libs.patch" + "${FILESDIR}/${PN}-0.10.2-install-targets.patch" + # From upstream + "${FILESDIR}/${PN}-0.10.3-gcc11.patch" +) + +pkg_setup() { + local CONFIG_CHECK="~FUSE_FS" + local WARNING_FUSE_FS="CONFIG_FUSE_FS is required for cryfs support." + + check_extra_config +} + +src_prepare() { + cmake_src_prepare + + # don't install compressed manpage + cmake_comment_add_subdirectory doc + + # remove tests that require internet access to comply with Gentoo policy + sed -e "/CurlHttpClientTest.cpp/d" -e "/FakeHttpClientTest.cpp/d" \ + -i test/cpp-utils/CMakeLists.txt || die + + # /dev/fuse access denied + sed -e "/CliTest_IntegrityCheck/d" \ + -i test/cryfs-cli/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + -DBoost_USE_STATIC_LIBS=OFF + -DCRYFS_UPDATE_CHECKS=OFF + -DBUILD_SHARED_LIBS=OFF + -DUSE_SYSTEM_LIBS=ON + -DBUILD_TESTING=$(usex test) + ) + + use custom-optimization || append-flags -O3 + use debug || append-flags -DNDEBUG + + cmake_src_configure +} + +src_test() { + local TMPDIR="${T}" + local tests_failed=() + + # fspp fuse tests hang, bug # 699044 + for i in gitversion cpp-utils parallelaccessstore blockstore blobstore cryfs cryfs-cli ; do + "${BUILD_DIR}"/test/${i}/${i}-test || tests_failed+=( "${i}" ) + done + + if [[ -n ${tests_failed[@]} ]] ; then + eerror "The following tests failed:" + eerror "${tests_failed[@]}" + die "At least one test failed" + fi +} + +src_install() { + cmake_src_install + doman doc/man/cryfs.1 +} diff --git a/sys-fs/cryfs/files/cryfs-0.10.3-gcc11.patch b/sys-fs/cryfs/files/cryfs-0.10.3-gcc11.patch new file mode 100644 index 000000000000..9a7252ba506b --- /dev/null +++ b/sys-fs/cryfs/files/cryfs-0.10.3-gcc11.patch @@ -0,0 +1,271 @@ +https://github.com/cryfs/cryfs/commit/27587ea1acec5f939a31217f1c43953378f18821.patch +https://bugs.gentoo.org/786459 + +From 27587ea1acec5f939a31217f1c43953378f18821 Mon Sep 17 00:00:00 2001 +From: Sebastian Messmer <messmer@cryfs.org> +Date: Sat, 8 May 2021 14:44:27 -0700 +Subject: [PATCH] Fixed an issue when compiling with GCC 11, see + https://github.com/cryfs/cryfs/issues/389 + +--- +--- a/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h ++++ b/src/blobstore/implementations/onblocks/datanodestore/DataNodeView.h +@@ -67,7 +67,7 @@ class DataNodeView final { + + static DataNodeView create(blockstore::BlockStore *blockStore, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) { + ASSERT(data.size() <= layout.datasizeBytes(), "Data is too large for node"); +- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data)); ++ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data)); + ASSERT(serialized.size() == layout.blocksizeBytes(), "Wrong block size"); + auto block = blockStore->create(serialized); + return DataNodeView(std::move(block)); +@@ -75,7 +75,7 @@ class DataNodeView final { + + static DataNodeView initialize(cpputils::unique_ref<blockstore::Block> block, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) { + ASSERT(data.size() <= DataNodeLayout(block->size()).datasizeBytes(), "Data is too large for node"); +- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data)); ++ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data)); + ASSERT(serialized.size() == block->size(), "Block has wrong size"); + block->write(serialized.data(), 0, serialized.size()); + return DataNodeView(std::move(block)); +@@ -83,7 +83,7 @@ class DataNodeView final { + + static DataNodeView overwrite(blockstore::BlockStore *blockStore, const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, const blockstore::BlockId &blockId, cpputils::Data data) { + ASSERT(data.size() <= layout.datasizeBytes(), "Data is too large for node"); +- cpputils::Data serialized = _serialize(layout, formatVersion, depth, size, std::move(data)); ++ cpputils::Data serialized = serialize_(layout, formatVersion, depth, size, std::move(data)); + auto block = blockStore->overwrite(blockId, std::move(serialized)); + return DataNodeView(std::move(block)); + } +@@ -143,7 +143,7 @@ class DataNodeView final { + } + + private: +- static cpputils::Data _serialize(const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) { ++ static cpputils::Data serialize_(const DataNodeLayout &layout, uint16_t formatVersion, uint8_t depth, uint32_t size, cpputils::Data data) { + cpputils::Data result(layout.blocksizeBytes()); + cpputils::serialize<uint16_t>(result.dataOffset(layout.FORMAT_VERSION_OFFSET_BYTES), formatVersion); + cpputils::serialize<uint8_t>(result.dataOffset(layout.DEPTH_OFFSET_BYTES), depth); +--- a/src/cryfs/filesystem/fsblobstore/utils/DirEntry.cpp ++++ b/src/cryfs/filesystem/fsblobstore/utils/DirEntry.cpp +@@ -11,55 +11,55 @@ namespace cryfs { + + namespace { + template<typename DataType> +- size_t _serialize(void* dst, const DataType& obj) { ++ size_t serialize_(void* dst, const DataType& obj) { + cpputils::serialize<DataType>(dst, obj); + return sizeof(DataType); + } + + template<typename DataType> +- DataType _deserialize(const char** src) { ++ DataType deserialize_(const char** src) { + DataType result = cpputils::deserialize<DataType>(*src); + *src += sizeof(DataType); + return result; + } + +- constexpr size_t _serializedTimeValueSize() { ++ constexpr size_t serializedTimeValueSize_() { + return sizeof(uint64_t) + sizeof(uint32_t); + } + +- unsigned int _serializeTimeValue(uint8_t *dest, timespec value) { ++ unsigned int serializeTimeValue_(uint8_t *dest, timespec value) { + unsigned int offset = 0; +- offset += _serialize<uint64_t>(dest + offset, value.tv_sec); +- offset += _serialize<uint32_t>(dest + offset, value.tv_nsec); +- ASSERT(offset == _serializedTimeValueSize(), "serialized to wrong size"); ++ offset += serialize_<uint64_t>(dest + offset, value.tv_sec); ++ offset += serialize_<uint32_t>(dest + offset, value.tv_nsec); ++ ASSERT(offset == serializedTimeValueSize_(), "serialized to wrong size"); + return offset; + } + +- timespec _deserializeTimeValue(const char **pos) { ++ timespec deserializeTimeValue_(const char **pos) { + timespec value{}; +- value.tv_sec = _deserialize<uint64_t>(pos); +- value.tv_nsec = _deserialize<uint32_t>(pos); ++ value.tv_sec = deserialize_<uint64_t>(pos); ++ value.tv_nsec = deserialize_<uint32_t>(pos); + return value; + } + +- unsigned int _serializeString(uint8_t *dest, const string &value) { ++ unsigned int serializeString_(uint8_t *dest, const string &value) { + std::memcpy(dest, value.c_str(), value.size()+1); + return value.size() + 1; + } + +- string _deserializeString(const char **pos) { ++ string deserializeString_(const char **pos) { + size_t length = strlen(*pos); + string value(*pos, length); + *pos += length + 1; + return value; + } + +- unsigned int _serializeBlockId(uint8_t *dest, const BlockId &blockId) { ++ unsigned int serializeBlockId_(uint8_t *dest, const BlockId &blockId) { + blockId.ToBinary(dest); + return blockId.BINARY_LENGTH; + } + +- BlockId _deserializeBlockId(const char **pos) { ++ BlockId deserializeBlockId_(const char **pos) { + BlockId blockId = BlockId::FromBinary(*pos); + *pos += BlockId::BINARY_LENGTH; + return blockId; +@@ -75,35 +75,35 @@ namespace cryfs { + _mode.hasDirFlag()) + ", " + std::to_string(_mode.hasSymlinkFlag()) + ", " + std::to_string(static_cast<uint8_t>(_type)) + ); + unsigned int offset = 0; +- offset += _serialize<uint8_t>(dest + offset, static_cast<uint8_t>(_type)); +- offset += _serialize<uint32_t>(dest + offset, _mode.value()); +- offset += _serialize<uint32_t>(dest + offset, _uid.value()); +- offset += _serialize<uint32_t>(dest + offset, _gid.value()); +- offset += _serializeTimeValue(dest + offset, _lastAccessTime); +- offset += _serializeTimeValue(dest + offset, _lastModificationTime); +- offset += _serializeTimeValue(dest + offset, _lastMetadataChangeTime); +- offset += _serializeString(dest + offset, _name); +- offset += _serializeBlockId(dest + offset, _blockId); ++ offset += serialize_<uint8_t>(dest + offset, static_cast<uint8_t>(_type)); ++ offset += serialize_<uint32_t>(dest + offset, _mode.value()); ++ offset += serialize_<uint32_t>(dest + offset, _uid.value()); ++ offset += serialize_<uint32_t>(dest + offset, _gid.value()); ++ offset += serializeTimeValue_(dest + offset, _lastAccessTime); ++ offset += serializeTimeValue_(dest + offset, _lastModificationTime); ++ offset += serializeTimeValue_(dest + offset, _lastMetadataChangeTime); ++ offset += serializeString_(dest + offset, _name); ++ offset += serializeBlockId_(dest + offset, _blockId); + ASSERT(offset == serializedSize(), "Didn't write correct number of elements"); + } + + const char *DirEntry::deserializeAndAddToVector(const char *pos, vector<DirEntry> *result) { +- fspp::Dir::EntryType type = static_cast<fspp::Dir::EntryType>(_deserialize<uint8_t>(&pos)); +- fspp::mode_t mode = fspp::mode_t(_deserialize<uint32_t>(&pos)); +- fspp::uid_t uid = fspp::uid_t(_deserialize<uint32_t>(&pos)); +- fspp::gid_t gid = fspp::gid_t(_deserialize<uint32_t>(&pos)); +- timespec lastAccessTime = _deserializeTimeValue(&pos); +- timespec lastModificationTime = _deserializeTimeValue(&pos); +- timespec lastMetadataChangeTime = _deserializeTimeValue(&pos); +- string name = _deserializeString(&pos); +- BlockId blockId = _deserializeBlockId(&pos); ++ fspp::Dir::EntryType type = static_cast<fspp::Dir::EntryType>(deserialize_<uint8_t>(&pos)); ++ fspp::mode_t mode = fspp::mode_t(deserialize_<uint32_t>(&pos)); ++ fspp::uid_t uid = fspp::uid_t(deserialize_<uint32_t>(&pos)); ++ fspp::gid_t gid = fspp::gid_t(deserialize_<uint32_t>(&pos)); ++ timespec lastAccessTime = deserializeTimeValue_(&pos); ++ timespec lastModificationTime = deserializeTimeValue_(&pos); ++ timespec lastMetadataChangeTime = deserializeTimeValue_(&pos); ++ string name = deserializeString_(&pos); ++ BlockId blockId = deserializeBlockId_(&pos); + + result->emplace_back(type, name, blockId, mode, uid, gid, lastAccessTime, lastModificationTime, lastMetadataChangeTime); + return pos; + } + + size_t DirEntry::serializedSize() const { +- return 1 + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + 3*_serializedTimeValueSize() + ( ++ return 1 + sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint32_t) + 3*serializedTimeValueSize_() + ( + _name.size() + 1) + _blockId.BINARY_LENGTH; + } + } +--- a/src/cryfs/localstate/LocalStateMetadata.cpp ++++ b/src/cryfs/localstate/LocalStateMetadata.cpp +@@ -30,10 +30,10 @@ LocalStateMetadata::LocalStateMetadata(uint32_t myClientId, Hash encryptionKeyHa + + LocalStateMetadata LocalStateMetadata::loadOrGenerate(const bf::path &statePath, const Data& encryptionKey, bool allowReplacedFilesystem) { + auto metadataFile = statePath / "metadata"; +- auto loaded = _load(metadataFile); ++ auto loaded = load_(metadataFile); + if (loaded == none) { + // If it couldn't be loaded, generate a new client id. +- return _generate(metadataFile, encryptionKey); ++ return generate_(metadataFile, encryptionKey); + } + + if (!allowReplacedFilesystem && loaded->_encryptionKeyHash.digest != cpputils::hash::hash(encryptionKey, loaded->_encryptionKeyHash.salt).digest) { +@@ -42,22 +42,22 @@ LocalStateMetadata LocalStateMetadata::loadOrGenerate(const bf::path &statePath, + return *loaded; + } + +-optional<LocalStateMetadata> LocalStateMetadata::_load(const bf::path &metadataFilePath) { ++optional<LocalStateMetadata> LocalStateMetadata::load_(const bf::path &metadataFilePath) { + ifstream file(metadataFilePath.string()); + if (!file.good()) { + // State file doesn't exist + return none; + } +- return _deserialize(file); ++ return deserialize_(file); + } + +-void LocalStateMetadata::_save(const bf::path &metadataFilePath) const { ++void LocalStateMetadata::save_(const bf::path &metadataFilePath) const { + ofstream file(metadataFilePath.string(), std::ios::trunc); +- _serialize(file); ++ serialize_(file); + } + + namespace { +-uint32_t _generateClientId() { ++uint32_t generateClientId_() { + uint32_t result; + do { + result = cpputils::deserialize<uint32_t>(Random::PseudoRandom().getFixedSize<sizeof(uint32_t)>().data()); +@@ -82,8 +82,8 @@ optional<uint32_t> _tryLoadClientIdFromLegacyFile(const bf::path &metadataFilePa + #endif + } + +-LocalStateMetadata LocalStateMetadata::_generate(const bf::path &metadataFilePath, const Data& encryptionKey) { +- uint32_t myClientId = _generateClientId(); ++LocalStateMetadata LocalStateMetadata::generate_(const bf::path &metadataFilePath, const Data& encryptionKey) { ++ uint32_t myClientId = generateClientId_(); + #ifndef CRYFS_NO_COMPATIBILITY + // In the old format, this was stored in a "myClientId" file. If that file exists, load it from there. + optional<uint32_t> legacy = _tryLoadClientIdFromLegacyFile(metadataFilePath); +@@ -93,11 +93,11 @@ LocalStateMetadata LocalStateMetadata::_generate(const bf::path &metadataFilePat + #endif + + LocalStateMetadata result(myClientId, cpputils::hash::hash(encryptionKey, cpputils::hash::generateSalt())); +- result._save(metadataFilePath); ++ result.save_(metadataFilePath); + return result; + } + +-void LocalStateMetadata::_serialize(ostream& stream) const { ++void LocalStateMetadata::serialize_(ostream& stream) const { + ptree pt; + pt.put<uint32_t>("myClientId", myClientId()); + pt.put<string>("encryptionKey.salt", _encryptionKeyHash.salt.ToString()); +@@ -106,7 +106,7 @@ void LocalStateMetadata::_serialize(ostream& stream) const { + write_json(stream, pt); + } + +-LocalStateMetadata LocalStateMetadata::_deserialize(istream& stream) { ++LocalStateMetadata LocalStateMetadata::deserialize_(istream& stream) { + try { + ptree pt; + read_json(stream, pt); +--- a/src/cryfs/localstate/LocalStateMetadata.h ++++ b/src/cryfs/localstate/LocalStateMetadata.h +@@ -20,11 +20,11 @@ class LocalStateMetadata final { + const uint32_t _myClientId; + const cpputils::hash::Hash _encryptionKeyHash; + +- static boost::optional<LocalStateMetadata> _load(const boost::filesystem::path &metadataFilePath); +- static LocalStateMetadata _deserialize(std::istream& stream); +- static LocalStateMetadata _generate(const boost::filesystem::path &metadataFilePath, const cpputils::Data& encryptionKey); +- void _save(const boost::filesystem::path &metadataFilePath) const; +- void _serialize(std::ostream& stream) const; ++ static boost::optional<LocalStateMetadata> load_(const boost::filesystem::path &metadataFilePath); ++ static LocalStateMetadata deserialize_(std::istream& stream); ++ static LocalStateMetadata generate_(const boost::filesystem::path &metadataFilePath, const cpputils::Data& encryptionKey); ++ void save_(const boost::filesystem::path &metadataFilePath) const; ++ void serialize_(std::ostream& stream) const; + + LocalStateMetadata(uint32_t myClientId, cpputils::hash::Hash encryptionKey); + }; |