From 257b02851136d243a87407a0dc7a663eefc9b895 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 29 Apr 2016 12:46:14 -0700 Subject: [PATCH] Prevent opening file systems that were created with newer versions of CryFS --- src/cryfs/config/CryConfigLoader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cryfs/config/CryConfigLoader.cpp b/src/cryfs/config/CryConfigLoader.cpp index 4738bd25..12a0c2fa 100644 --- a/src/cryfs/config/CryConfigLoader.cpp +++ b/src/cryfs/config/CryConfigLoader.cpp @@ -61,6 +61,9 @@ void CryConfigLoader::_checkVersion(const CryConfig &config) { if (!boost::starts_with(config.Version(), allowedVersionPrefix)) { throw std::runtime_error(string() + "This filesystem was created with CryFS " + config.Version() + " and is incompatible. Please create a new one with your version of CryFS and migrate your data."); } + if (gitversion::VersionCompare::isOlderThan(gitversion::VersionString(), config.Version())) { + throw std::runtime_error(string() + "This filesystem was used with CryFS " + config.Version() + " and should not be opened with older versions anymore. Please update your CryFS version."); + } } void CryConfigLoader::_checkCipher(const CryConfig &config) const {