From 977a3817408dd9468af0ed0bc80cfc2e09261f48 Mon Sep 17 00:00:00 2001 From: Mouse Date: Tue, 5 Sep 2017 16:51:24 -0400 Subject: [PATCH] Fix compatibility with Crypto++ 6.0 (#169) * Fix compatibility with Crypto++ 6.0 in a newly-introduced file EncryptedBlockStore2.h * Convert fix to how it was done in "develop" branch --- .../implementations/encrypted/EncryptedBlockStore2.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h b/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h index 1a306bdc..4960b5c3 100644 --- a/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h +++ b/src/blockstore/implementations/encrypted/EncryptedBlockStore2.h @@ -3,6 +3,7 @@ #define MESSMER_BLOCKSTORE_IMPLEMENTATIONS_ENCRYPTED_ENCRYPTEDBLOCKSTORE2_H_ #include "../../interface/BlockStore2.h" +#include "cpp-utils/crypto/cryptopp_byte.h" #include #include @@ -116,14 +117,14 @@ inline void EncryptedBlockStore2::forEachBlock(std::function inline cpputils::Data EncryptedBlockStore2::_encrypt(const Key &key, const cpputils::Data &data) const { cpputils::Data plaintextWithHeader = _prependKeyHeaderToData(key, data); - cpputils::Data encrypted = Cipher::encrypt((byte*)plaintextWithHeader.data(), plaintextWithHeader.size(), _encKey); + cpputils::Data encrypted = Cipher::encrypt((CryptoPP::byte*)plaintextWithHeader.data(), plaintextWithHeader.size(), _encKey); return _prependFormatHeaderToData(encrypted); } template inline boost::optional EncryptedBlockStore2::_tryDecrypt(const Key &key, const cpputils::Data &data) const { auto ciphertext = _checkAndRemoveFormatHeader(data); - boost::optional decrypted = Cipher::decrypt((byte*)ciphertext.data(), ciphertext.size(), _encKey); + boost::optional decrypted = Cipher::decrypt((CryptoPP::byte*)ciphertext.data(), ciphertext.size(), _encKey); if (boost::none == decrypted) { // TODO Warning return boost::none;