From 767f1352ebe12585be2869d917f63cc13d9bc835 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Mon, 12 Jul 2021 23:15:58 +0300 Subject: [PATCH] Fix ciphering of partial blocks. --- src/Functions/FileEncryption.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Functions/FileEncryption.h b/src/Functions/FileEncryption.h index 864f8cf0866..3830e90bff5 100644 --- a/src/Functions/FileEncryption.h +++ b/src/Functions/FileEncryption.h @@ -151,7 +151,7 @@ public: throw DB::Exception("Expected key with size " + std::to_string(CipherKeyLength(evp_cipher)) + ", got iv with size " + std::to_string(key_.Size()), DB::ErrorCodes::DATA_ENCRYPTION_ERROR); - offset = BlockOffset(offset_); + offset = offset_; } protected: @@ -202,7 +202,6 @@ public: buf.write(EncryptPartialBlock(plaintext, part_size, iv, off).data(), part_size); offset += part_size; size -= part_size; - plaintext += part_size; iv.Inc(); }