From 8221e76f3aa5dd2da63c34ca689f8a09d9dc292c Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 3 Feb 2018 21:33:07 -0800 Subject: [PATCH] Fix migration for loading 0.9.x file systems --- src/cryfs/filesystem/CryDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryfs/filesystem/CryDevice.cpp b/src/cryfs/filesystem/CryDevice.cpp index 3d1f6dd8..bed53960 100644 --- a/src/cryfs/filesystem/CryDevice.cpp +++ b/src/cryfs/filesystem/CryDevice.cpp @@ -104,7 +104,7 @@ unique_ref CryDevice::CreateIntegrityEncryptedBlockStore(unique_ref #ifndef CRYFS_NO_COMPATIBILITY if (!configFile->config()->HasVersionNumbers()) { IntegrityBlockStore2::migrateFromBlockstoreWithoutVersionNumbers(encryptedBlockStore.get(), integrityFilePath, myClientId); - configFile->config()->SetBlocksizeBytes(configFile->config()->BlocksizeBytes() + IntegrityBlockStore2::HEADER_LENGTH); + configFile->config()->SetBlocksizeBytes(configFile->config()->BlocksizeBytes() + IntegrityBlockStore2::HEADER_LENGTH - blockstore::BlockId::BINARY_LENGTH); // Minus BlockId size because EncryptedBlockStore doesn't store the BlockId anymore (that was moved to IntegrityBlockStore) configFile->config()->SetHasVersionNumbers(true); configFile->save(); }