From 75fd1d21be5ae03834209bc1fcf9fb8221b97e7b Mon Sep 17 00:00:00 2001 From: alex-z Date: Wed, 11 Jan 2023 19:56:34 +0100 Subject: [PATCH] Always generate random initialization vector when uploading encrypted file. Signed-off-by: alex-z --- src/libsync/propagateuploadencrypted.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libsync/propagateuploadencrypted.cpp b/src/libsync/propagateuploadencrypted.cpp index 697229532..8e7738e84 100644 --- a/src/libsync/propagateuploadencrypted.cpp +++ b/src/libsync/propagateuploadencrypted.cpp @@ -155,7 +155,6 @@ void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDo if (!found) { encryptedFile.encryptionKey = EncryptionHelper::generateRandom(16); encryptedFile.encryptedFilename = EncryptionHelper::generateRandomFilename(); - encryptedFile.initializationVector = EncryptionHelper::generateRandom(16); encryptedFile.fileVersion = 1; encryptedFile.metadataKey = 1; encryptedFile.originalFilename = fileName; @@ -169,6 +168,8 @@ void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDo encryptedFile.mimetype = QByteArrayLiteral("httpd/unix-directory"); } } + + encryptedFile.initializationVector = EncryptionHelper::generateRandom(16); _item->_encryptedFileName = _remoteParentPath + QLatin1Char('/') + encryptedFile.encryptedFilename; _item->_isEncrypted = true;