Fix no-compatibility mode

This commit is contained in:
Sebastian Messmer 2017-09-16 00:52:23 +01:00
parent 2151d6f453
commit 666d24e7b8
2 changed files with 15 additions and 2 deletions

View File

@ -21,7 +21,18 @@ using cpputils::Random;
namespace cryfs {
CryConfig::CryConfig()
: _rootBlob(""), _encKey(""), _cipher(""), _version(""), _createdWithVersion(""), _blocksizeBytes(0), _filesystemId(FilesystemID::Null()), _exclusiveClientId(none), _hasVersionNumbers(true) {
: _rootBlob("")
, _encKey("")
, _cipher("")
, _version("")
, _createdWithVersion("")
, _blocksizeBytes(0)
, _filesystemId(FilesystemID::Null())
, _exclusiveClientId(none)
#ifndef CRYFS_NO_COMPATIBILITY
, _hasVersionNumbers(true)
#endif
{
}
CryConfig CryConfig::load(const Data &data) {

View File

@ -57,7 +57,7 @@ namespace cryfs {
}
#else
_checkHeader(&deserializer);
_deserializeNewFormat(&deserializer);
return _deserializeNewFormat(&deserializer);
#endif
} catch (const exception &e) {
LOG(ERROR, "Error deserializing outer configuration: {}", e.what());
@ -65,6 +65,7 @@ namespace cryfs {
}
}
#ifndef CRYFS_NO_COMPATIBILITY
OuterConfig OuterConfig::_deserializeOldFormat(Deserializer *deserializer) {
auto kdfParameters = SCryptParameters::deserializeOldFormat(deserializer);
auto kdfParametersSerialized = kdfParameters.serialize();
@ -72,6 +73,7 @@ namespace cryfs {
deserializer->finished();
return OuterConfig {std::move(kdfParametersSerialized), std::move(encryptedInnerConfig), true};
}
#endif
OuterConfig OuterConfig::_deserializeNewFormat(Deserializer *deserializer) {
auto kdfParameters = deserializer->readData();