diff --git a/src/blockstore/implementations/compressing/CompressedBlock.h b/src/blockstore/implementations/compressing/CompressedBlock.h index 32209dba..56f0f4dc 100644 --- a/src/blockstore/implementations/compressing/CompressedBlock.h +++ b/src/blockstore/implementations/compressing/CompressedBlock.h @@ -2,8 +2,6 @@ #ifndef MESSMER_BLOCKSTORE_IMPLEMENTATIONS_COMPRESSING_COMPRESSEDBLOCK_H_ #define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_COMPRESSING_COMPRESSEDBLOCK_H_ -#include "cpp-utils/crypto/cryptopp_byte.h" - #include "../../interface/Block.h" #include "../../interface/BlockStore.h" #include diff --git a/src/blockstore/implementations/compressing/compressors/Gzip.cpp b/src/blockstore/implementations/compressing/compressors/Gzip.cpp index 67b7f49a..5420ebf5 100644 --- a/src/blockstore/implementations/compressing/compressors/Gzip.cpp +++ b/src/blockstore/implementations/compressing/compressors/Gzip.cpp @@ -1,4 +1,3 @@ -#include "cpp-utils/crypto/cryptopp_byte.h" #include "Gzip.h" #include diff --git a/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h b/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h index 26e25cad..95194fb2 100644 --- a/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h +++ b/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h @@ -3,7 +3,6 @@ #define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_ENCRYPTED_ENCRYPTEDBLOCKSTORE2_H_ #include "../../interface/BlockStore2.h" -#include "cpp-utils/crypto/cryptopp_byte.h" #include #include #include diff --git a/src/cpp-utils/crypto/cryptopp_byte.h b/src/cpp-utils/crypto/cryptopp_byte.h deleted file mode 100644 index e00cf7cf..00000000 --- a/src/cpp-utils/crypto/cryptopp_byte.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#ifndef _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H -#define _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H - -#include - -// If we're running an older CryptoPP version, CryptoPP::byte isn't defined yet. -// Define it. Refer to "byte" type in the global namespace (placed by CryptoPP). -// Could also use CRYPTOPP_NO_GLOBAL_BYTE - but don't want to track when it was -// introduced. This way seems more reliable, as it is compatible with more of -// the Crypto++ versions. -#if CRYPTOPP_VERSION < 600 -namespace CryptoPP { - using byte = ::byte; -} -#endif /* CRYPTOPP_VERSION < 600 */ - -#endif /* _CPPUTILS_CRYPTO_CRYPTOPP_BYTE_H */ diff --git a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h index 4f91b893..80ff2568 100644 --- a/src/cpp-utils/crypto/symmetric/CFB_Cipher.h +++ b/src/cpp-utils/crypto/symmetric/CFB_Cipher.h @@ -2,7 +2,6 @@ #ifndef MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CFBCIPHER_H_ #define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_CFBCIPHER_H_ -#include "cpp-utils/crypto/cryptopp_byte.h" #include "../../data/FixedSizeData.h" #include "../../data/Data.h" #include "../../random/Random.h" diff --git a/src/cpp-utils/crypto/symmetric/EncryptionKey.h b/src/cpp-utils/crypto/symmetric/EncryptionKey.h index 7a9960e0..899a4b40 100644 --- a/src/cpp-utils/crypto/symmetric/EncryptionKey.h +++ b/src/cpp-utils/crypto/symmetric/EncryptionKey.h @@ -5,7 +5,6 @@ #include #include #include -#include "../cryptopp_byte.h" #include namespace cpputils { diff --git a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h index 21d55fb6..13300bb8 100644 --- a/src/cpp-utils/crypto/symmetric/GCM_Cipher.h +++ b/src/cpp-utils/crypto/symmetric/GCM_Cipher.h @@ -2,7 +2,6 @@ #ifndef MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_GCMCIPHER_H_ #define MESSMER_CPPUTILS_CRYPTO_SYMMETRIC_GCMCIPHER_H_ -#include "cpp-utils/crypto/cryptopp_byte.h" #include "../../data/FixedSizeData.h" #include "../../data/Data.h" #include "../../random/Random.h" diff --git a/src/cpp-utils/crypto/symmetric/ciphers.cpp b/src/cpp-utils/crypto/symmetric/ciphers.cpp index fa5dcaa9..f0f5017f 100644 --- a/src/cpp-utils/crypto/symmetric/ciphers.cpp +++ b/src/cpp-utils/crypto/symmetric/ciphers.cpp @@ -23,12 +23,8 @@ namespace cpputils { DEFINE_CIPHER(Cast256_GCM); DEFINE_CIPHER(Cast256_CFB); -#if CRYPTOPP_VERSION != 564 DEFINE_CIPHER(Mars448_GCM); DEFINE_CIPHER(Mars448_CFB); -#else -# warning "You're using Crypto++ 5.6.4. In this version, the MARS-448 cipher is not available. Your CryFS executable will not be able to load file systems using this cipher. Please use Crypto++ 5.6.3 or 5.6.5+ instead." -#endif DEFINE_CIPHER(Mars256_GCM); DEFINE_CIPHER(Mars256_CFB); DEFINE_CIPHER(Mars128_GCM); diff --git a/src/cpp-utils/crypto/symmetric/ciphers.h b/src/cpp-utils/crypto/symmetric/ciphers.h index 7a8f8d45..a2059e13 100644 --- a/src/cpp-utils/crypto/symmetric/ciphers.h +++ b/src/cpp-utils/crypto/symmetric/ciphers.h @@ -41,11 +41,9 @@ static_assert(32 == CryptoPP::CAST256::MAX_KEYLENGTH, "If Cast offered larger ke DECLARE_CIPHER(Cast256_GCM, "cast-256-gcm", GCM_Cipher, CryptoPP::CAST256, 32); DECLARE_CIPHER(Cast256_CFB, "cast-256-cfb", CFB_Cipher, CryptoPP::CAST256, 32); -#if CRYPTOPP_VERSION != 564 static_assert(56 == CryptoPP::MARS::MAX_KEYLENGTH, "If Mars offered larger keys, we should offer a variant with it"); DECLARE_CIPHER(Mars448_GCM, "mars-448-gcm", GCM_Cipher, CryptoPP::MARS, 56); DECLARE_CIPHER(Mars448_CFB, "mars-448-cfb", CFB_Cipher, CryptoPP::MARS, 56); -#endif DECLARE_CIPHER(Mars256_GCM, "mars-256-gcm", GCM_Cipher, CryptoPP::MARS, 32); DECLARE_CIPHER(Mars256_CFB, "mars-256-cfb", CFB_Cipher, CryptoPP::MARS, 32); DECLARE_CIPHER(Mars128_GCM, "mars-128-gcm", GCM_Cipher, CryptoPP::MARS, 16); diff --git a/src/cpp-utils/crypto/symmetric/testutils/FakeAuthenticatedCipher.h b/src/cpp-utils/crypto/symmetric/testutils/FakeAuthenticatedCipher.h index 4305ef02..a37cffd8 100644 --- a/src/cpp-utils/crypto/symmetric/testutils/FakeAuthenticatedCipher.h +++ b/src/cpp-utils/crypto/symmetric/testutils/FakeAuthenticatedCipher.h @@ -2,7 +2,6 @@ #ifndef MESSMER_CPPUTILS_TEST_CRYPTO_SYMMETRIC_TESTUTILS_FAKEAUTHENTICATEDCIPHER_H_ #define MESSMER_CPPUTILS_TEST_CRYPTO_SYMMETRIC_TESTUTILS_FAKEAUTHENTICATEDCIPHER_H_ -#include "cpp-utils/crypto/cryptopp_byte.h" #include "cpp-utils/crypto/symmetric/Cipher.h" #include "cpp-utils/data/FixedSizeData.h" #include "cpp-utils/data/Data.h" diff --git a/src/cpp-utils/data/Data.cpp b/src/cpp-utils/data/Data.cpp index c8a3a25b..be94cdbe 100644 --- a/src/cpp-utils/data/Data.cpp +++ b/src/cpp-utils/data/Data.cpp @@ -1,7 +1,6 @@ #include "Data.h" #include #include -#include using std::istream; using std::ofstream; diff --git a/src/cpp-utils/random/OSRandomGenerator.h b/src/cpp-utils/random/OSRandomGenerator.h index 18a8002d..f522c617 100644 --- a/src/cpp-utils/random/OSRandomGenerator.h +++ b/src/cpp-utils/random/OSRandomGenerator.h @@ -2,7 +2,6 @@ #ifndef MESSMER_CPPUTILS_RANDOM_OSRANDOMGENERATOR_H #define MESSMER_CPPUTILS_RANDOM_OSRANDOMGENERATOR_H -#include "cpp-utils/crypto/cryptopp_byte.h" #include "RandomGenerator.h" #include diff --git a/src/cpp-utils/random/RandomGeneratorThread.cpp b/src/cpp-utils/random/RandomGeneratorThread.cpp index 418f7124..33c8a86f 100644 --- a/src/cpp-utils/random/RandomGeneratorThread.cpp +++ b/src/cpp-utils/random/RandomGeneratorThread.cpp @@ -1,4 +1,3 @@ -#include "cpp-utils/crypto/cryptopp_byte.h" #include "RandomGeneratorThread.h" namespace cpputils { diff --git a/src/cryfs/config/CryCipher.cpp b/src/cryfs/config/CryCipher.cpp index 81f233c5..52749847 100644 --- a/src/cryfs/config/CryCipher.cpp +++ b/src/cryfs/config/CryCipher.cpp @@ -73,10 +73,8 @@ const vector> CryCiphers::SUPPORTED_CIPHERS = { make_shared>(INTEGRITY_WARNING), make_shared>(), make_shared>(INTEGRITY_WARNING), -#if CRYPTOPP_VERSION != 564 make_shared>(), make_shared>(INTEGRITY_WARNING), -#endif make_shared>(), make_shared>(INTEGRITY_WARNING), make_shared>(), diff --git a/test/blockstore/implementations/encrypted/EncryptedBlockStoreTest_Specific.cpp b/test/blockstore/implementations/encrypted/EncryptedBlockStoreTest_Specific.cpp index 82099074..840532f7 100644 --- a/test/blockstore/implementations/encrypted/EncryptedBlockStoreTest_Specific.cpp +++ b/test/blockstore/implementations/encrypted/EncryptedBlockStoreTest_Specific.cpp @@ -1,4 +1,3 @@ -#include "cpp-utils/crypto/cryptopp_byte.h" #include #include "cpp-utils/crypto/symmetric/testutils/FakeAuthenticatedCipher.h" #include "blockstore/implementations/encrypted/EncryptedBlockStore2.h" diff --git a/test/cpp-utils/crypto/symmetric/CipherTest.cpp b/test/cpp-utils/crypto/symmetric/CipherTest.cpp index ea09ee81..ee8d73c3 100644 --- a/test/cpp-utils/crypto/symmetric/CipherTest.cpp +++ b/test/cpp-utils/crypto/symmetric/CipherTest.cpp @@ -1,4 +1,3 @@ -#include "cpp-utils/crypto/cryptopp_byte.h" #include #include "cpp-utils/crypto/symmetric/Cipher.h" #include "cpp-utils/crypto/symmetric/ciphers.h" @@ -253,11 +252,9 @@ INSTANTIATE_TYPED_TEST_CASE_P(Cast256_CFB, CipherTest, Cast256_CFB); //CFB mode INSTANTIATE_TYPED_TEST_CASE_P(Cast256_GCM, CipherTest, Cast256_GCM); INSTANTIATE_TYPED_TEST_CASE_P(Cast256_GCM, AuthenticatedCipherTest, Cast256_GCM); -#if CRYPTOPP_VERSION != 564 INSTANTIATE_TYPED_TEST_CASE_P(Mars448_CFB, CipherTest, Mars448_CFB); //CFB mode is not authenticated INSTANTIATE_TYPED_TEST_CASE_P(Mars448_GCM, CipherTest, Mars448_GCM); INSTANTIATE_TYPED_TEST_CASE_P(Mars448_GCM, AuthenticatedCipherTest, Mars448_GCM); -#endif INSTANTIATE_TYPED_TEST_CASE_P(Mars256_CFB, CipherTest, Mars256_CFB); //CFB mode is not authenticated INSTANTIATE_TYPED_TEST_CASE_P(Mars256_GCM, CipherTest, Mars256_GCM); INSTANTIATE_TYPED_TEST_CASE_P(Mars256_GCM, AuthenticatedCipherTest, Mars256_GCM); @@ -286,10 +283,9 @@ TEST(CipherNameTest, TestCipherNames) { EXPECT_EQ("cast-256-gcm", string(Cast256_GCM::NAME)); EXPECT_EQ("cast-256-cfb", string(Cast256_CFB::NAME)); -#if CRYPTOPP_VERSION != 564 + EXPECT_EQ("mars-448-gcm", string(Mars448_GCM::NAME)); EXPECT_EQ("mars-448-cfb", string(Mars448_CFB::NAME)); -#endif EXPECT_EQ("mars-256-gcm", string(Mars256_GCM::NAME)); EXPECT_EQ("mars-256-cfb", string(Mars256_CFB::NAME)); EXPECT_EQ("mars-128-gcm", string(Mars128_GCM::NAME)); diff --git a/test/cryfs/config/CompatibilityTest.cpp b/test/cryfs/config/CompatibilityTest.cpp index 36c1871c..b1e9f1c5 100644 --- a/test/cryfs/config/CompatibilityTest.cpp +++ b/test/cryfs/config/CompatibilityTest.cpp @@ -1,4 +1,3 @@ -#include "cpp-utils/crypto/cryptopp_byte.h" #include #include #include diff --git a/test/cryfs/config/CryCipherTest.cpp b/test/cryfs/config/CryCipherTest.cpp index 2dbd5a76..1fd17a43 100644 --- a/test/cryfs/config/CryCipherTest.cpp +++ b/test/cryfs/config/CryCipherTest.cpp @@ -77,10 +77,7 @@ TEST_F(CryCipherTest, FindsCorrectCipher) { "aes-256-gcm", "aes-256-cfb", "aes-256-gcm", "aes-256-cfb", "twofish-256-gcm", "twofish-256-cfb", "twofish-256-gcm", "twofish-256-cfb", "serpent-256-gcm", "serpent-256-cfb", "serpent-256-gcm", "serpent-256-cfb", - "cast-256-gcm", "cast-256-cfb", -#if CRYPTOPP_VERSION != 564 - "mars-448-gcm", "mars-448-cfb", -#endif + "cast-256-gcm", "cast-256-cfb", "mars-448-gcm", "mars-448-cfb", "mars-256-gcm", "mars-256-cfb", "mars-256-gcm", "mars-256-cfb" }); } @@ -100,10 +97,8 @@ TEST_F(CryCipherTest, CreatesCorrectEncryptedBlockStore) { EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("serpent-128-cfb"); EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("cast-256-gcm"); EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("cast-256-cfb"); -#if CRYPTOPP_VERSION != 564 EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("mars-448-gcm"); EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("mars-448-cfb"); -#endif EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("mars-256-gcm"); EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("mars-256-cfb"); EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE("mars-128-gcm"); @@ -123,11 +118,9 @@ TEST_F(CryCipherTest, ThereIsACipherWithIntegrityWarning) { EXPECT_THAT(CryCiphers::find("aes-256-cfb").warning().value(), MatchesRegex(".*integrity.*")); } -#if CRYPTOPP_VERSION != 564 TEST_F(CryCipherTest, EncryptionKeyHasCorrectSize_448) { EXPECT_EQ(Mars448_GCM::STRING_KEYSIZE, CryCiphers::find("mars-448-gcm").createKey(Random::PseudoRandom()).size()); } -#endif TEST_F(CryCipherTest, EncryptionKeyHasCorrectSize_256) { EXPECT_EQ(AES256_GCM::STRING_KEYSIZE, CryCiphers::find("aes-256-gcm").createKey(Random::PseudoRandom()).size()); diff --git a/test/cryfs/config/CryConfigCreatorTest.cpp b/test/cryfs/config/CryConfigCreatorTest.cpp index 9adfe3d1..3bd0ffb6 100644 --- a/test/cryfs/config/CryConfigCreatorTest.cpp +++ b/test/cryfs/config/CryConfigCreatorTest.cpp @@ -155,7 +155,6 @@ TEST_F(CryConfigCreatorTest, ChoosesEmptyRootBlobId) { EXPECT_EQ("", config.RootBlob()); // This tells CryFS to create a new root blob } -#if CRYPTOPP_VERSION != 564 TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_448) { AnswerNoToDefaultSettings(); IGNORE_ASK_FOR_MISSINGBLOCKISINTEGRITYVIOLATION(); @@ -163,7 +162,6 @@ TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_448) { CryConfig config = creator.create(none, none, none, false).config; cpputils::Mars448_GCM::EncryptionKey::FromString(config.EncryptionKey()); // This crashes if invalid } -#endif TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_256) { AnswerNoToDefaultSettings();