From e30656797ba77bbdcd56a006754ea4ab30fa5866 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 24 Sep 2016 09:39:37 +0200 Subject: [PATCH] Add compatibility with Crypto++ 5.6.4 --- ChangeLog.txt | 1 + src/cpp-utils/crypto/symmetric/ciphers.cpp | 4 ++++ src/cpp-utils/crypto/symmetric/ciphers.h | 2 ++ src/cryfs/config/CryCipher.cpp | 2 ++ 4 files changed, 9 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 1c5562df..a6e439f0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,7 @@ Version 0.9.6 (unreleased) --------------- Compatibility: * Compatible with libcurl version >= 7.50.0, and <= 7.21.6 (tested down to 7.19.0) +* Compatible with Crypto++ 5.6.4 Version 0.9.5 --------------- diff --git a/src/cpp-utils/crypto/symmetric/ciphers.cpp b/src/cpp-utils/crypto/symmetric/ciphers.cpp index f0f5017f..fa5dcaa9 100644 --- a/src/cpp-utils/crypto/symmetric/ciphers.cpp +++ b/src/cpp-utils/crypto/symmetric/ciphers.cpp @@ -23,8 +23,12 @@ 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 284aff0d..61a6a25a 100644 --- a/src/cpp-utils/crypto/symmetric/ciphers.h +++ b/src/cpp-utils/crypto/symmetric/ciphers.h @@ -41,9 +41,11 @@ 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/cryfs/config/CryCipher.cpp b/src/cryfs/config/CryCipher.cpp index 573ea8dc..9304c068 100644 --- a/src/cryfs/config/CryCipher.cpp +++ b/src/cryfs/config/CryCipher.cpp @@ -73,8 +73,10 @@ 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>(),