void-packages/srcpkgs/cryfs/patches/0002-de-vendor-crypto-for-v...

192 lines
6.8 KiB
Diff

From e5caea5fbb2fd1367439eb4b0391c64c0238a40a Mon Sep 17 00:00:00 2001
From: Andy Weidenbaum <atweiden@ioiojo.com>
Date: Sat, 22 Jul 2023 03:18:53 +0000
Subject: [PATCH 2/2] de-vendor crypto++ for void
---
.../implementations/compressing/compressors/Gzip.cpp | 2 +-
src/cpp-utils/crypto/hash/Hash.cpp | 2 +-
src/cpp-utils/crypto/kdf/Scrypt.cpp | 2 +-
src/cpp-utils/crypto/symmetric/CFB_Cipher.h | 2 +-
src/cpp-utils/crypto/symmetric/GCM_Cipher.h | 2 +-
src/cpp-utils/crypto/symmetric/ciphers.h | 12 ++++++------
src/cpp-utils/data/Data.cpp | 2 +-
src/cpp-utils/data/FixedSizeData.h | 2 +-
src/cpp-utils/random/OSRandomGenerator.h | 2 +-
src/cpp-utils/random/RandomGeneratorThread.h | 2 +-
src/cryfs/impl/localstate/BasedirMetadata.cpp | 2 +-
test/cryfs/impl/config/CompatibilityTest.cpp | 2 +-
vendor/CMakeLists.txt | 1 -
13 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/blockstore/implementations/compressing/compressors/Gzip.cpp b/src/blockstore/implementations/compressing/compressors/Gzip.cpp
index 5420ebf5..5f169cf6 100644
--- a/src/blockstore/implementations/compressing/compressors/Gzip.cpp
+++ b/src/blockstore/implementations/compressing/compressors/Gzip.cpp
@@ -1,5 +1,5 @@
#include "Gzip.h"
-#include <vendor_cryptopp/gzip.h>
+#include <cryptopp/gzip.h>
using cpputils::Data;
diff --git a/src/cpp-utils/crypto/hash/Hash.cpp b/src/cpp-utils/crypto/hash/Hash.cpp
index 696cdeaf..e07d28da 100644
--- a/src/cpp-utils/crypto/hash/Hash.cpp
+++ b/src/cpp-utils/crypto/hash/Hash.cpp
@@ -1,6 +1,6 @@
#include "Hash.h"
#include <cpp-utils/random/Random.h>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
using cpputils::Random;
using CryptoPP::SHA512;
diff --git a/src/cpp-utils/crypto/kdf/Scrypt.cpp b/src/cpp-utils/crypto/kdf/Scrypt.cpp
index 1fec96ce..a12b6369 100644
--- a/src/cpp-utils/crypto/kdf/Scrypt.cpp
+++ b/src/cpp-utils/crypto/kdf/Scrypt.cpp
@@ -1,5 +1,5 @@
#include "Scrypt.h"
-#include <vendor_cryptopp/scrypt.h>
+#include <cryptopp/scrypt.h>
using std::string;
diff --git a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
index c1a8aa1c..c0e3d8c5 100644
--- a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
+++ b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h
@@ -6,7 +6,7 @@
#include "../../data/Data.h"
#include "../../random/Random.h"
#include <boost/optional.hpp>
-#include <vendor_cryptopp/modes.h>
+#include <cryptopp/modes.h>
#include "Cipher.h"
#include "EncryptionKey.h"
diff --git a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
index 9cf6d53f..86b2b8e3 100644
--- a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
+++ b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h
@@ -3,7 +3,7 @@
#define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_GCMCIPHER_H_
#include "AEAD_Cipher.h"
-#include <vendor_cryptopp/gcm.h>
+#include <cryptopp/gcm.h>
namespace cpputils {
diff --git a/src/cpp-utils/crypto/symmetric/ciphers.h b/src/cpp-utils/crypto/symmetric/ciphers.h
index 0bae6866..eee3111e 100644
--- a/src/cpp-utils/crypto/symmetric/ciphers.h
+++ b/src/cpp-utils/crypto/symmetric/ciphers.h
@@ -2,12 +2,12 @@
#ifndef MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
#define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CIPHERS_H_
-#include <vendor_cryptopp/aes.h>
-#include <vendor_cryptopp/twofish.h>
-#include <vendor_cryptopp/serpent.h>
-#include <vendor_cryptopp/cast.h>
-#include <vendor_cryptopp/mars.h>
-#include <vendor_cryptopp/chachapoly.h>
+#include <cryptopp/aes.h>
+#include <cryptopp/twofish.h>
+#include <cryptopp/serpent.h>
+#include <cryptopp/cast.h>
+#include <cryptopp/mars.h>
+#include <cryptopp/chachapoly.h>
#include "GCM_Cipher.h"
#include "CFB_Cipher.h"
diff --git a/src/cpp-utils/data/Data.cpp b/src/cpp-utils/data/Data.cpp
index be94cdbe..e283f0eb 100644
--- a/src/cpp-utils/data/Data.cpp
+++ b/src/cpp-utils/data/Data.cpp
@@ -1,6 +1,6 @@
#include "Data.h"
#include <stdexcept>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
using std::istream;
using std::ofstream;
diff --git a/src/cpp-utils/data/FixedSizeData.h b/src/cpp-utils/data/FixedSizeData.h
index 58833996..17891c95 100644
--- a/src/cpp-utils/data/FixedSizeData.h
+++ b/src/cpp-utils/data/FixedSizeData.h
@@ -2,7 +2,7 @@
#ifndef MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
#define MESSMER_CPPUTILS_DATA_FIXEDSIZEDATA_H_
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <string>
#include <array>
#include <cstring>
diff --git a/src/cpp-utils/random/OSRandomGenerator.h b/src/cpp-utils/random/OSRandomGenerator.h
index f522c617..d99f977d 100644
--- a/src/cpp-utils/random/OSRandomGenerator.h
+++ b/src/cpp-utils/random/OSRandomGenerator.h
@@ -3,7 +3,7 @@
#define MESSMER_CPPUTILS_RANDOM_OSRANDOMGENERATOR_H
#include "RandomGenerator.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
class OSRandomGenerator final : public RandomGenerator {
diff --git a/src/cpp-utils/random/RandomGeneratorThread.h b/src/cpp-utils/random/RandomGeneratorThread.h
index 593750ed..103c00d7 100644
--- a/src/cpp-utils/random/RandomGeneratorThread.h
+++ b/src/cpp-utils/random/RandomGeneratorThread.h
@@ -4,7 +4,7 @@
#include "../thread/LoopThread.h"
#include "ThreadsafeRandomDataBuffer.h"
-#include <vendor_cryptopp/osrng.h>
+#include <cryptopp/osrng.h>
namespace cpputils {
//TODO Test
diff --git a/src/cryfs/impl/localstate/BasedirMetadata.cpp b/src/cryfs/impl/localstate/BasedirMetadata.cpp
index d32ced93..3de2d3ad 100644
--- a/src/cryfs/impl/localstate/BasedirMetadata.cpp
+++ b/src/cryfs/impl/localstate/BasedirMetadata.cpp
@@ -1,7 +1,7 @@
#include "BasedirMetadata.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
-#include <vendor_cryptopp/sha.h>
+#include <cryptopp/sha.h>
#include <boost/filesystem/operations.hpp>
#include "LocalStateDir.h"
#include <cpp-utils/logging/logging.h>
diff --git a/test/cryfs/impl/config/CompatibilityTest.cpp b/test/cryfs/impl/config/CompatibilityTest.cpp
index 07b931b3..a045900f 100644
--- a/test/cryfs/impl/config/CompatibilityTest.cpp
+++ b/test/cryfs/impl/config/CompatibilityTest.cpp
@@ -2,7 +2,7 @@
#include <vector>
#include <boost/filesystem.hpp>
#include <cpp-utils/data/Data.h>
-#include <vendor_cryptopp/hex.h>
+#include <cryptopp/hex.h>
#include <cpp-utils/crypto/symmetric/ciphers.h>
#include <cpp-utils/tempfile/TempFile.h>
#include <cryfs/impl/config/CryConfigFile.h>
diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt
index a4951eec..73deebc3 100644
--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -1,2 +1 @@
add_subdirectory(googletest)
-add_subdirectory(cryptopp)
--
2.41.0