diff --git a/src/cryfs-cli/Cli.cpp b/src/cryfs-cli/Cli.cpp index 32998881..1a1adf4d 100644 --- a/src/cryfs-cli/Cli.cpp +++ b/src/cryfs-cli/Cli.cpp @@ -193,7 +193,7 @@ namespace cryfs { CryConfigFile Cli::_loadOrCreateConfig(const ProgramOptions &options) { try { auto configFile = _determineConfigFile(options); - auto config = _loadOrCreateConfigFile(configFile, options.cipher()); + auto config = _loadOrCreateConfigFile(configFile, options.cipher(), options.blocksizeBytes()); if (config == none) { std::cerr << "Could not load config file. Did you enter the correct password?" << std::endl; exit(1); @@ -205,17 +205,17 @@ namespace cryfs { } } - optional Cli::_loadOrCreateConfigFile(const bf::path &configFilePath, const optional &cipher) { + optional Cli::_loadOrCreateConfigFile(const bf::path &configFilePath, const optional &cipher, const optional &blocksizeBytes) { if (_noninteractive) { return CryConfigLoader(_console, _keyGenerator, _scryptSettings, &Cli::_askPasswordNoninteractive, &Cli::_askPasswordNoninteractive, - cipher, _noninteractive).loadOrCreate(configFilePath); + cipher, blocksizeBytes, _noninteractive).loadOrCreate(configFilePath); } else { return CryConfigLoader(_console, _keyGenerator, _scryptSettings, &Cli::_askPasswordForExistingFilesystem, &Cli::_askPasswordForNewFilesystem, - cipher, _noninteractive).loadOrCreate(configFilePath); + cipher, blocksizeBytes, _noninteractive).loadOrCreate(configFilePath); } } diff --git a/src/cryfs-cli/Cli.h b/src/cryfs-cli/Cli.h index ee9919a7..9a837a9d 100644 --- a/src/cryfs-cli/Cli.h +++ b/src/cryfs-cli/Cli.h @@ -22,7 +22,7 @@ namespace cryfs { void _checkForUpdates(); void _runFilesystem(const program_options::ProgramOptions &options); CryConfigFile _loadOrCreateConfig(const program_options::ProgramOptions &options); - boost::optional _loadOrCreateConfigFile(const boost::filesystem::path &configFilePath, const boost::optional &cipher); + boost::optional _loadOrCreateConfigFile(const boost::filesystem::path &configFilePath, const boost::optional &cipher, const boost::optional &blocksizeBytes); boost::filesystem::path _determineConfigFile(const program_options::ProgramOptions &options); static std::string _askPasswordForExistingFilesystem(); static std::string _askPasswordForNewFilesystem(); diff --git a/src/cryfs-cli/program_options/Parser.cpp b/src/cryfs-cli/program_options/Parser.cpp index 6a8dc999..8ca9c994 100644 --- a/src/cryfs-cli/program_options/Parser.cpp +++ b/src/cryfs-cli/program_options/Parser.cpp @@ -62,8 +62,12 @@ ProgramOptions Parser::parse(const vector &supportedCiphers) const { cipher = vm["cipher"].as(); _checkValidCipher(*cipher, supportedCiphers); } + optional blocksizeBytes = none; + if (vm.count("blocksize-bytes")) { + blocksizeBytes = vm["blocksize-bytes"].as(); + } - return ProgramOptions(baseDir, mountDir, configfile, foreground, unmountAfterIdleMinutes, logfile, cipher, options.second); + return ProgramOptions(baseDir, mountDir, configfile, foreground, unmountAfterIdleMinutes, logfile, cipher, blocksizeBytes, options.second); } void Parser::_checkValidCipher(const string &cipher, const vector &supportedCiphers) { @@ -108,7 +112,8 @@ void Parser::_addAllowedOptions(po::options_description *desc) { ("help,h", "show help message") ("config,c", po::value(), "Configuration file") ("foreground,f", "Run CryFS in foreground.") - ("cipher", po::value(), "Cipher to use for encryption. See possible values by calling cryfs with --show-ciphers") + ("cipher", po::value(), "Cipher to use for encryption. See possible values by calling cryfs with --show-ciphers.") + ("blocksize-bytes", po::value(), "The block size used when storing ciphertext blocks (in bytes).") ("show-ciphers", "Show list of supported ciphers.") ("unmount-idle", po::value(), "Automatically unmount after specified number of idle minutes.") ("logfile", po::value(), "Specify the file to write log messages to. If this is not specified, log messages will go to stdout, or syslog if CryFS is running in the background.") diff --git a/src/cryfs-cli/program_options/ProgramOptions.cpp b/src/cryfs-cli/program_options/ProgramOptions.cpp index 4f8c7107..ee9fdaf2 100644 --- a/src/cryfs-cli/program_options/ProgramOptions.cpp +++ b/src/cryfs-cli/program_options/ProgramOptions.cpp @@ -11,9 +11,11 @@ namespace bf = boost::filesystem; ProgramOptions::ProgramOptions(const bf::path &baseDir, const bf::path &mountDir, const optional &configFile, bool foreground, const optional &unmountAfterIdleMinutes, const optional &logFile, const optional &cipher, + const optional &blocksizeBytes, const vector &fuseOptions) :_baseDir(baseDir), _mountDir(nullptr), _configFile(configFile), _foreground(foreground), - _cipher(cipher), _unmountAfterIdleMinutes(unmountAfterIdleMinutes), _logFile(logFile), _fuseOptions(fuseOptions) { + _cipher(cipher), _blocksizeBytes(blocksizeBytes), _unmountAfterIdleMinutes(unmountAfterIdleMinutes), + _logFile(logFile), _fuseOptions(fuseOptions) { string mountDirStr = mountDir.native(); _mountDir = new char[mountDirStr.size()+1]; @@ -65,6 +67,10 @@ const optional &ProgramOptions::cipher() const { return _cipher; } +const optional &ProgramOptions::blocksizeBytes() const { + return _blocksizeBytes; +} + const vector &ProgramOptions::fuseOptions() const { return _fuseOptions; } diff --git a/src/cryfs-cli/program_options/ProgramOptions.h b/src/cryfs-cli/program_options/ProgramOptions.h index 910b608e..29dfbf53 100644 --- a/src/cryfs-cli/program_options/ProgramOptions.h +++ b/src/cryfs-cli/program_options/ProgramOptions.h @@ -17,6 +17,7 @@ namespace cryfs { bool foreground, const boost::optional &unmountAfterIdleMinutes, const boost::optional &logFile, const boost::optional &cipher, + const boost::optional &blocksizeBytes, const std::vector &fuseOptions); ProgramOptions(ProgramOptions &&rhs); ~ProgramOptions(); @@ -26,6 +27,7 @@ namespace cryfs { const boost::optional &configFile() const; bool foreground() const; const boost::optional &cipher() const; + const boost::optional &blocksizeBytes() const; const boost::optional &unmountAfterIdleMinutes() const; const boost::optional &logFile() const; const std::vector &fuseOptions() const; @@ -36,6 +38,7 @@ namespace cryfs { boost::optional _configFile; bool _foreground; boost::optional _cipher; + boost::optional _blocksizeBytes; boost::optional _unmountAfterIdleMinutes; boost::optional _logFile; std::vector _fuseOptions; diff --git a/src/cryfs/config/CryConfigCreator.cpp b/src/cryfs/config/CryConfigCreator.cpp index 34fa3041..6cf01867 100644 --- a/src/cryfs/config/CryConfigCreator.cpp +++ b/src/cryfs/config/CryConfigCreator.cpp @@ -17,18 +17,23 @@ namespace cryfs { :_console(console), _configConsole(console, noninteractive), _encryptionKeyGenerator(encryptionKeyGenerator) { } - CryConfig CryConfigCreator::create(const optional &cipherFromCommandLine) { + CryConfig CryConfigCreator::create(const optional &cipherFromCommandLine, const optional &blocksizeBytesFromCommandLine) { CryConfig config; config.SetCipher(_generateCipher(cipherFromCommandLine)); config.SetVersion(gitversion::VersionString()); - config.SetBlocksizeBytes(_generateBlocksizeBytes()); + config.SetBlocksizeBytes(_generateBlocksizeBytes(blocksizeBytesFromCommandLine)); config.SetRootBlob(_generateRootBlobKey()); config.SetEncryptionKey(_generateEncKey(config.Cipher())); return config; } - uint32_t CryConfigCreator::_generateBlocksizeBytes() { - return _configConsole.askBlocksizeBytes(); + uint32_t CryConfigCreator::_generateBlocksizeBytes(const optional &blocksizeBytesFromCommandLine) { + if (blocksizeBytesFromCommandLine != none) { + // TODO Check block size is valid (i.e. large enough) + return *blocksizeBytesFromCommandLine; + } else { + return _configConsole.askBlocksizeBytes(); + } } string CryConfigCreator::_generateCipher(const optional &cipherFromCommandLine) { diff --git a/src/cryfs/config/CryConfigCreator.h b/src/cryfs/config/CryConfigCreator.h index c3c57b27..867b9598 100644 --- a/src/cryfs/config/CryConfigCreator.h +++ b/src/cryfs/config/CryConfigCreator.h @@ -14,12 +14,12 @@ namespace cryfs { CryConfigCreator(std::shared_ptr console, cpputils::RandomGenerator &encryptionKeyGenerator, bool noninteractive); CryConfigCreator(CryConfigCreator &&rhs) = default; - CryConfig create(const boost::optional &cipherFromCommandLine); + CryConfig create(const boost::optional &cipherFromCommandLine, const boost::optional &blocksizeBytesFromCommandLine); private: std::string _generateCipher(const boost::optional &cipherFromCommandLine); std::string _generateEncKey(const std::string &cipher); std::string _generateRootBlobKey(); - uint32_t _generateBlocksizeBytes(); + uint32_t _generateBlocksizeBytes(const boost::optional &blocksizeBytesFromCommandLine); std::shared_ptr _console; CryConfigConsole _configConsole; diff --git a/src/cryfs/config/CryConfigLoader.cpp b/src/cryfs/config/CryConfigLoader.cpp index 6a3fc90b..819f0fbe 100644 --- a/src/cryfs/config/CryConfigLoader.cpp +++ b/src/cryfs/config/CryConfigLoader.cpp @@ -25,10 +25,10 @@ using namespace cpputils::logging; namespace cryfs { -CryConfigLoader::CryConfigLoader(shared_ptr console, RandomGenerator &keyGenerator, const SCryptSettings &scryptSettings, function askPasswordForExistingFilesystem, function askPasswordForNewFilesystem, const optional &cipherFromCommandLine, bool noninteractive) +CryConfigLoader::CryConfigLoader(shared_ptr console, RandomGenerator &keyGenerator, const SCryptSettings &scryptSettings, function askPasswordForExistingFilesystem, function askPasswordForNewFilesystem, const optional &cipherFromCommandLine, const boost::optional &blocksizeBytesFromCommandLine, bool noninteractive) : _creator(std::move(console), keyGenerator, noninteractive), _scryptSettings(scryptSettings), _askPasswordForExistingFilesystem(askPasswordForExistingFilesystem), _askPasswordForNewFilesystem(askPasswordForNewFilesystem), - _cipherFromCommandLine(cipherFromCommandLine) { + _cipherFromCommandLine(cipherFromCommandLine), _blocksizeBytesFromCommandLine(blocksizeBytesFromCommandLine) { } optional CryConfigLoader::_loadConfig(const bf::path &filename) { @@ -66,7 +66,7 @@ optional CryConfigLoader::loadOrCreate(const bf::path &filename) } CryConfigFile CryConfigLoader::_createConfig(const bf::path &filename) { - auto config = _creator.create(_cipherFromCommandLine); + auto config = _creator.create(_cipherFromCommandLine, _blocksizeBytesFromCommandLine); //TODO Ask confirmation if using insecure password (<8 characters) string password = _askPasswordForNewFilesystem(); std::cout << "Creating config file (this can take some time)..." << std::flush; diff --git a/src/cryfs/config/CryConfigLoader.h b/src/cryfs/config/CryConfigLoader.h index 4eb97450..4741d9e2 100644 --- a/src/cryfs/config/CryConfigLoader.h +++ b/src/cryfs/config/CryConfigLoader.h @@ -13,7 +13,7 @@ namespace cryfs { class CryConfigLoader final { public: - CryConfigLoader(std::shared_ptr console, cpputils::RandomGenerator &keyGenerator, const cpputils::SCryptSettings &scryptSettings, std::function askPasswordForExistingFilesystem, std::function askPasswordForNewFilesystem, const boost::optional &cipherFromCommandLine, bool noninteractive); + CryConfigLoader(std::shared_ptr console, cpputils::RandomGenerator &keyGenerator, const cpputils::SCryptSettings &scryptSettings, std::function askPasswordForExistingFilesystem, std::function askPasswordForNewFilesystem, const boost::optional &cipherFromCommandLine, const boost::optional &blocksizeBytesFromCommandLine, bool noninteractive); CryConfigLoader(CryConfigLoader &&rhs) = default; boost::optional loadOrCreate(const boost::filesystem::path &filename); @@ -29,6 +29,7 @@ private: std::function _askPasswordForExistingFilesystem; std::function _askPasswordForNewFilesystem; boost::optional _cipherFromCommandLine; + boost::optional _blocksizeBytesFromCommandLine; DISALLOW_COPY_AND_ASSIGN(CryConfigLoader); }; diff --git a/test/cryfs-cli/program_options/ProgramOptionsTest.cpp b/test/cryfs-cli/program_options/ProgramOptionsTest.cpp index d3cba542..3fbd58d5 100644 --- a/test/cryfs-cli/program_options/ProgramOptionsTest.cpp +++ b/test/cryfs-cli/program_options/ProgramOptionsTest.cpp @@ -23,73 +23,83 @@ namespace boost { class ProgramOptionsTest: public ProgramOptionsTestBase {}; TEST_F(ProgramOptionsTest, BaseDir) { - ProgramOptions testobj("/home/user/mydir", "", none, false, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("/home/user/mydir", "", none, false, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ("/home/user/mydir", testobj.baseDir()); } TEST_F(ProgramOptionsTest, MountDir) { - ProgramOptions testobj("", "/home/user/mydir", none, false, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "/home/user/mydir", none, false, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ("/home/user/mydir", testobj.mountDir()); } TEST_F(ProgramOptionsTest, ConfigfileNone) { - ProgramOptions testobj("", "", none, true, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ(none, testobj.configFile()); } TEST_F(ProgramOptionsTest, ConfigfileSome) { - ProgramOptions testobj("", "", bf::path("/home/user/configfile"), true, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", bf::path("/home/user/configfile"), true, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ("/home/user/configfile", testobj.configFile().get()); } TEST_F(ProgramOptionsTest, ForegroundFalse) { - ProgramOptions testobj("", "", none, false, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, false, none, none, none, none, options({"./myExecutable"})); EXPECT_FALSE(testobj.foreground()); } TEST_F(ProgramOptionsTest, ForegroundTrue) { - ProgramOptions testobj("", "", none, true, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); EXPECT_TRUE(testobj.foreground()); } TEST_F(ProgramOptionsTest, LogfileNone) { - ProgramOptions testobj("", "", none, true, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ(none, testobj.logFile()); } TEST_F(ProgramOptionsTest, LogfileSome) { - ProgramOptions testobj("", "", none, true, none, bf::path("logfile"), none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, bf::path("logfile"), none, none, options({"./myExecutable"})); EXPECT_EQ("logfile", testobj.logFile().get()); } TEST_F(ProgramOptionsTest, UnmountAfterIdleMinutesNone) { -ProgramOptions testobj("", "", none, true, none, none, none, options({"./myExecutable"})); +ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ(none, testobj.unmountAfterIdleMinutes()); } TEST_F(ProgramOptionsTest, UnmountAfterIdleMinutesSome) { - ProgramOptions testobj("", "", none, true, 10, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, 10, none, none, none, options({"./myExecutable"})); EXPECT_EQ(10, testobj.unmountAfterIdleMinutes().get()); } TEST_F(ProgramOptionsTest, CipherNone) { - ProgramOptions testobj("", "", none, true, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); EXPECT_EQ(none, testobj.cipher()); } TEST_F(ProgramOptionsTest, CipherSome) { - ProgramOptions testobj("", "", none, true, none, none, string("aes-256-gcm"), options({"./myExecutable"})); + ProgramOptions testobj("", "", none, true, none, none, string("aes-256-gcm"), none, options({"./myExecutable"})); EXPECT_EQ("aes-256-gcm", testobj.cipher().get()); } +TEST_F(ProgramOptionsTest, BlocksizeBytesNone) { + ProgramOptions testobj("", "", none, true, none, none, none, none, options({"./myExecutable"})); + EXPECT_EQ(none, testobj.blocksizeBytes()); +} + +TEST_F(ProgramOptionsTest, BlocksizeSome) { + ProgramOptions testobj("", "", none, true, none, none, none, 10*1024, options({"./myExecutable"})); + EXPECT_EQ(10*1024u, testobj.blocksizeBytes().get()); +} + TEST_F(ProgramOptionsTest, EmptyFuseOptions) { - ProgramOptions testobj("/rootDir", "/home/user/mydir", none, false, none, none, none, options({"./myExecutable"})); + ProgramOptions testobj("/rootDir", "/home/user/mydir", none, false, none, none, none, none, options({"./myExecutable"})); //Fuse should have the mount dir as first parameter EXPECT_VECTOR_EQ({"./myExecutable", "/home/user/mydir"}, testobj.fuseOptions()); } TEST_F(ProgramOptionsTest, SomeFuseOptions) { - ProgramOptions testobj("/rootDir", "/home/user/mydir", none, false, none, none, none, options({"./myExecutable", "-f", "--longoption"})); + ProgramOptions testobj("/rootDir", "/home/user/mydir", none, false, none, none, none, none, options({"./myExecutable", "-f", "--longoption"})); //Fuse should have the mount dir as first parameter EXPECT_VECTOR_EQ({"./myExecutable", "/home/user/mydir", "-f", "--longoption"}, testobj.fuseOptions()); } diff --git a/test/cryfs/config/CryConfigCreatorTest.cpp b/test/cryfs/config/CryConfigCreatorTest.cpp index b3a87a74..25f5ee9c 100644 --- a/test/cryfs/config/CryConfigCreatorTest.cpp +++ b/test/cryfs/config/CryConfigCreatorTest.cpp @@ -62,72 +62,82 @@ public: TEST_F(CryConfigCreatorTest, DoesAskForCipherIfNotSpecified) { AnswerNoToDefaultSettings(); EXPECT_ASK_FOR_CIPHER().WillOnce(ChooseAnyCipher()); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); } TEST_F(CryConfigCreatorTest, DoesNotAskForCipherIfSpecified) { AnswerNoToDefaultSettings(); EXPECT_DOES_NOT_ASK_FOR_CIPHER(); - CryConfig config = creator.create(string("aes-256-gcm")); + CryConfig config = creator.create(string("aes-256-gcm"), none); } TEST_F(CryConfigCreatorTest, DoesNotAskForCipherIfUsingDefaultSettings) { AnswerYesToDefaultSettings(); EXPECT_DOES_NOT_ASK_FOR_CIPHER(); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); } TEST_F(CryConfigCreatorTest, DoesNotAskForCipherIfNoninteractive) { EXPECT_DOES_NOT_ASK_TO_USE_DEFAULT_SETTINGS(); EXPECT_DOES_NOT_ASK_FOR_CIPHER(); - CryConfig config = noninteractiveCreator.create(none); + CryConfig config = noninteractiveCreator.create(none, none); } TEST_F(CryConfigCreatorTest, DoesAskForBlocksizeIfNotSpecified) { AnswerNoToDefaultSettings(); EXPECT_ASK_FOR_BLOCKSIZE().WillOnce(Return(1)); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); } -//TODO DoesNotAskForCipherIfSpecified +TEST_F(CryConfigCreatorTest, DoesNotAskForBlocksizeIfSpecified) { + AnswerNoToDefaultSettings(); + EXPECT_DOES_NOT_ASK_FOR_BLOCKSIZE(); + CryConfig config = creator.create(none, 10*1024u); +} TEST_F(CryConfigCreatorTest, DoesNotAskForBlocksizeIfNoninteractive) { EXPECT_DOES_NOT_ASK_TO_USE_DEFAULT_SETTINGS(); EXPECT_DOES_NOT_ASK_FOR_BLOCKSIZE(); - CryConfig config = noninteractiveCreator.create(none); + CryConfig config = noninteractiveCreator.create(none, none); } TEST_F(CryConfigCreatorTest, DoesNotAskForBlocksizeIfUsingDefaultSettings) { AnswerYesToDefaultSettings(); EXPECT_DOES_NOT_ASK_FOR_BLOCKSIZE(); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); } TEST_F(CryConfigCreatorTest, ChoosesEmptyRootBlobId) { AnswerNoToDefaultSettings(); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); EXPECT_EQ("", config.RootBlob()); // This tells CryFS to create a new root blob } TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_448) { AnswerNoToDefaultSettings(); EXPECT_ASK_FOR_CIPHER().WillOnce(ChooseCipher("mars-448-gcm")); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); cpputils::Mars448_GCM::EncryptionKey::FromString(config.EncryptionKey()); // This crashes if invalid } TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_256) { AnswerNoToDefaultSettings(); EXPECT_ASK_FOR_CIPHER().WillOnce(ChooseCipher("aes-256-gcm")); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); cpputils::AES256_GCM::EncryptionKey::FromString(config.EncryptionKey()); // This crashes if invalid } TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_128) { AnswerNoToDefaultSettings(); EXPECT_ASK_FOR_CIPHER().WillOnce(ChooseCipher("aes-128-gcm")); - CryConfig config = creator.create(none); + CryConfig config = creator.create(none, none); cpputils::AES128_GCM::EncryptionKey::FromString(config.EncryptionKey()); // This crashes if invalid } +TEST_F(CryConfigCreatorTest, DoesNotAskForAnythingIfEverythingIsSpecified) { + EXPECT_DOES_NOT_ASK_TO_USE_DEFAULT_SETTINGS(); + EXPECT_DOES_NOT_ASK_FOR_CIPHER(); + CryConfig config = noninteractiveCreator.create(string("aes-256-gcm"), 10*1024u); +} + //TODO Add test cases ensuring that the values entered are correctly taken diff --git a/test/cryfs/config/CryConfigLoaderTest.cpp b/test/cryfs/config/CryConfigLoaderTest.cpp index def88d5d..f3b4f92b 100644 --- a/test/cryfs/config/CryConfigLoaderTest.cpp +++ b/test/cryfs/config/CryConfigLoaderTest.cpp @@ -32,7 +32,7 @@ public: CryConfigLoader loader(const string &password, bool noninteractive, const optional &cipher = none) { auto askPassword = [password] { return password;}; - return CryConfigLoader(mockConsole(), cpputils::Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, cipher, noninteractive); + return CryConfigLoader(mockConsole(), cpputils::Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, cipher, none, noninteractive); } CryConfigFile Create(const string &password = "mypassword", const optional &cipher = none, bool noninteractive = false) { diff --git a/test/cryfs/filesystem/CryFsTest.cpp b/test/cryfs/filesystem/CryFsTest.cpp index 60e633e1..d80995e3 100644 --- a/test/cryfs/filesystem/CryFsTest.cpp +++ b/test/cryfs/filesystem/CryFsTest.cpp @@ -37,7 +37,7 @@ public: CryConfigFile loadOrCreateConfig() { auto askPassword = [] {return "mypassword";}; - return CryConfigLoader(mockConsole(), Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, none, true).loadOrCreate(config.path()).value(); + return CryConfigLoader(mockConsole(), Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, none, none, true).loadOrCreate(config.path()).value(); } unique_ref blockStore() { diff --git a/test/cryfs/filesystem/FileSystemTest.cpp b/test/cryfs/filesystem/FileSystemTest.cpp index 9ee176da..e4b0681d 100644 --- a/test/cryfs/filesystem/FileSystemTest.cpp +++ b/test/cryfs/filesystem/FileSystemTest.cpp @@ -28,7 +28,7 @@ public: unique_ref createDevice() override { auto blockStore = cpputils::make_unique_ref(); auto askPassword = [] {return "mypassword";}; - auto config = CryConfigLoader(mockConsole(), Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, none, true) + auto config = CryConfigLoader(mockConsole(), Random::PseudoRandom(), SCrypt::TestSettings, askPassword, askPassword, none, none, true) .loadOrCreate(configFile.path()).value(); return make_unique_ref(std::move(config), std::move(blockStore)); }