Adapt to new blockstore

This commit is contained in:
Sebastian Messmer 2015-04-16 14:11:07 +02:00
parent 54e0bbc7d3
commit 7b40e22279

View File

@ -1,3 +1,4 @@
#include <messmer/blockstore/implementations/caching/CachingBlockStore.h>
#include "impl/DirBlob.h" #include "impl/DirBlob.h"
#include "CryDevice.h" #include "CryDevice.h"
@ -8,7 +9,6 @@
#include "messmer/blobstore/implementations/onblocks/BlobStoreOnBlocks.h" #include "messmer/blobstore/implementations/onblocks/BlobStoreOnBlocks.h"
#include "messmer/blobstore/implementations/onblocks/BlobOnBlocks.h" #include "messmer/blobstore/implementations/onblocks/BlobOnBlocks.h"
#include "messmer/blockstore/implementations/encrypted/EncryptedBlockStore.h" #include "messmer/blockstore/implementations/encrypted/EncryptedBlockStore.h"
#include "messmer/blockstore/implementations/caching2/Caching2BlockStore.h"
using std::unique_ptr; using std::unique_ptr;
using std::make_unique; using std::make_unique;
@ -23,14 +23,14 @@ using blockstore::Key;
using blockstore::encrypted::EncryptedBlockStore; using blockstore::encrypted::EncryptedBlockStore;
using blobstore::onblocks::BlobStoreOnBlocks; using blobstore::onblocks::BlobStoreOnBlocks;
using blobstore::onblocks::BlobOnBlocks; using blobstore::onblocks::BlobOnBlocks;
using blockstore::caching2::Caching2BlockStore; using blockstore::caching::CachingBlockStore;
namespace cryfs { namespace cryfs {
constexpr uint32_t CryDevice::BLOCKSIZE_BYTES; constexpr uint32_t CryDevice::BLOCKSIZE_BYTES;
CryDevice::CryDevice(unique_ptr<CryConfig> config, unique_ptr<BlockStore> blockStore) CryDevice::CryDevice(unique_ptr<CryConfig> config, unique_ptr<BlockStore> blockStore)
: _blobStore(make_unique<BlobStoreOnBlocks>(make_unique<Caching2BlockStore>(make_unique<EncryptedBlockStore>(std::move(blockStore), config->EncryptionKey())), BLOCKSIZE_BYTES)), _rootKey(GetOrCreateRootKey(config.get())) { : _blobStore(make_unique<BlobStoreOnBlocks>(make_unique<CachingBlockStore>(make_unique<EncryptedBlockStore>(std::move(blockStore), config->EncryptionKey())), BLOCKSIZE_BYTES)), _rootKey(GetOrCreateRootKey(config.get())) {
} }
Key CryDevice::GetOrCreateRootKey(CryConfig *config) { Key CryDevice::GetOrCreateRootKey(CryConfig *config) {