Fix no-compatibility mode
This commit is contained in:
parent
2151d6f453
commit
666d24e7b8
@ -21,7 +21,18 @@ using cpputils::Random;
|
|||||||
namespace cryfs {
|
namespace cryfs {
|
||||||
|
|
||||||
CryConfig::CryConfig()
|
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) {
|
CryConfig CryConfig::load(const Data &data) {
|
||||||
|
@ -57,7 +57,7 @@ namespace cryfs {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
_checkHeader(&deserializer);
|
_checkHeader(&deserializer);
|
||||||
_deserializeNewFormat(&deserializer);
|
return _deserializeNewFormat(&deserializer);
|
||||||
#endif
|
#endif
|
||||||
} catch (const exception &e) {
|
} catch (const exception &e) {
|
||||||
LOG(ERROR, "Error deserializing outer configuration: {}", e.what());
|
LOG(ERROR, "Error deserializing outer configuration: {}", e.what());
|
||||||
@ -65,6 +65,7 @@ namespace cryfs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CRYFS_NO_COMPATIBILITY
|
||||||
OuterConfig OuterConfig::_deserializeOldFormat(Deserializer *deserializer) {
|
OuterConfig OuterConfig::_deserializeOldFormat(Deserializer *deserializer) {
|
||||||
auto kdfParameters = SCryptParameters::deserializeOldFormat(deserializer);
|
auto kdfParameters = SCryptParameters::deserializeOldFormat(deserializer);
|
||||||
auto kdfParametersSerialized = kdfParameters.serialize();
|
auto kdfParametersSerialized = kdfParameters.serialize();
|
||||||
@ -72,6 +73,7 @@ namespace cryfs {
|
|||||||
deserializer->finished();
|
deserializer->finished();
|
||||||
return OuterConfig {std::move(kdfParametersSerialized), std::move(encryptedInnerConfig), true};
|
return OuterConfig {std::move(kdfParametersSerialized), std::move(encryptedInnerConfig), true};
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
OuterConfig OuterConfig::_deserializeNewFormat(Deserializer *deserializer) {
|
OuterConfig OuterConfig::_deserializeNewFormat(Deserializer *deserializer) {
|
||||||
auto kdfParameters = deserializer->readData();
|
auto kdfParameters = deserializer->readData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user