示例#1
0
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());
}
示例#2
0
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());
}
示例#3
0
TEST_F(CryConfigFileTest, RootBlob_SaveAndLoad) {
    CryConfigFile created = CreateAndLoadEmpty();
    created.config()->SetRootBlob("rootblobid");
    created.save();
    CryConfigFile loaded = Load().value();
    EXPECT_EQ("rootblobid", loaded.config()->RootBlob());
}
示例#4
0
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());
}
示例#5
0
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());
}
示例#6
0
TEST_F(CryConfigFileTest, EncryptionKey_SaveAndLoad) {
    CryConfigFile created = CreateAndLoadEmpty();
    created.config()->SetEncryptionKey("encryptionkey");
    created.save();
    CryConfigFile loaded = Load().value();
    EXPECT_EQ("encryptionkey", loaded.config()->EncryptionKey());
}
示例#7
0
文件: CryDevice.cpp 项目: cryfs/cryfs
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() {
}
示例#8
0
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());
}
示例#9
0
TEST_F(CryConfigFileTest, EncryptionKey_Init) {
    CryConfigFile created = CreateAndLoadEmpty();
    EXPECT_EQ("", created.config()->EncryptionKey());
}
示例#10
0
TEST_F(CryConfigFileTest, RootBlob_Init) {
    CryConfigFile created = CreateAndLoadEmpty();
    EXPECT_EQ("", created.config()->RootBlob());
}
示例#11
0
TEST_F(CryConfigFileTest, Cipher_Init) {
    CryConfigFile created = CreateAndLoadEmpty();
    EXPECT_EQ("aes-256-gcm", created.config()->Cipher());
}