TEST_F(CryConfigFileTest, RootBlob_CreateAndLoad) { CryConfig cfg = Config(); cfg.SetRootBlob("rootblobid"); Create(std::move(cfg)); CryConfigFile loaded = Load().value(); EXPECT_EQ("rootblobid", loaded.config()->RootBlob()); }
TEST_F(CryConfigFileTest, EncryptionKey_CreateAndLoad) { CryConfig cfg = Config(); cfg.SetEncryptionKey("encryptionkey"); Create(std::move(cfg)); CryConfigFile loaded = Load().value(); EXPECT_EQ("encryptionkey", loaded.config()->EncryptionKey()); }
TEST_F(CryConfigFileTest, RootBlob_SaveAndLoad) { CryConfigFile created = CreateAndLoadEmpty(); created.config()->SetRootBlob("rootblobid"); created.save(); CryConfigFile loaded = Load().value(); EXPECT_EQ("rootblobid", loaded.config()->RootBlob()); }
TEST_F(CryConfigFileTest, Cipher_SaveAndLoad) { CryConfigFile created = CreateAndLoadEmpty(); created.config()->SetCipher("twofish-128-cfb"); created.save(); CryConfigFile loaded = Load().value(); EXPECT_EQ("twofish-128-cfb", loaded.config()->Cipher()); }
TEST_F(CryConfigFileTest, Cipher_CreateAndLoad) { CryConfig cfg = Config(); cfg.SetCipher("twofish-128-cfb"); Create(std::move(cfg)); CryConfigFile loaded = Load().value(); EXPECT_EQ("twofish-128-cfb", loaded.config()->Cipher()); }
TEST_F(CryConfigFileTest, EncryptionKey_SaveAndLoad) { CryConfigFile created = CreateAndLoadEmpty(); created.config()->SetEncryptionKey("encryptionkey"); created.save(); CryConfigFile loaded = Load().value(); EXPECT_EQ("encryptionkey", loaded.config()->EncryptionKey()); }
CryDevice::CryDevice(CryConfigFile configFile, unique_ref<BlockStore> blockStore) : _fsBlobStore( make_unique_ref<ParallelAccessFsBlobStore>( make_unique_ref<CachingFsBlobStore>( make_unique_ref<FsBlobStore>( make_unique_ref<BlobStoreOnBlocks>( make_unique_ref<CachingBlockStore>( CreateEncryptedBlockStore(*configFile.config(), std::move(blockStore)) ), configFile.config()->BlocksizeBytes()))) ) ), _rootKey(GetOrCreateRootKey(&configFile)), _onFsAction() { }
TEST_F(CryConfigFileTest, CanSaveAndLoadModififedCipher) { CreateWithCipher("aes-256-gcm"); CryConfigFile created = Load().value(); EXPECT_EQ("aes-256-gcm", created.config()->Cipher()); created.config()->SetCipher("twofish-128-cfb"); created.save(); CryConfigFile loaded = Load().value(); EXPECT_EQ("twofish-128-cfb", loaded.config()->Cipher()); }
TEST_F(CryConfigFileTest, EncryptionKey_Init) { CryConfigFile created = CreateAndLoadEmpty(); EXPECT_EQ("", created.config()->EncryptionKey()); }
TEST_F(CryConfigFileTest, RootBlob_Init) { CryConfigFile created = CreateAndLoadEmpty(); EXPECT_EQ("", created.config()->RootBlob()); }
TEST_F(CryConfigFileTest, Cipher_Init) { CryConfigFile created = CreateAndLoadEmpty(); EXPECT_EQ("aes-256-gcm", created.config()->Cipher()); }