aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-26 12:50:30 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-29 08:17:56 +0200
commitc2d87291dbf8bd240e3e96138ec52aa5da22416b (patch)
tree86cc1e5473383780ac9343ec8aeea578cd0356ff /lib/jobs
parent841846ea5efad80ce20e0d42b1885def224e58ad (diff)
downloadlibquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.tar.gz
libquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.zip
Move encryptFile/decryptFile out of EncryptedFileMetadata
These are not operations on EncryptedFileMetadata but rather on a combination of EncryptedFileMetadata and ciphertext. If C++ had multimethods these could be bound to such a combination.
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/downloadfilejob.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/jobs/downloadfilejob.cpp b/lib/jobs/downloadfilejob.cpp
index 85c235c7..032b24f2 100644
--- a/lib/jobs/downloadfilejob.cpp
+++ b/lib/jobs/downloadfilejob.cpp
@@ -128,7 +128,7 @@ BaseJob::Status DownloadFileJob::prepareResult()
QByteArray encrypted = d->tempFile->readAll();
EncryptedFileMetadata file = *d->encryptedFile;
- const auto decrypted = file.decryptFile(encrypted);
+ const auto decrypted = decryptFile(encrypted, file);
d->targetFile->write(decrypted);
d->tempFile->remove();
} else {
@@ -153,7 +153,7 @@ BaseJob::Status DownloadFileJob::prepareResult()
const auto encrypted = d->tempFile->readAll();
EncryptedFileMetadata file = *d->encryptedFile;
- const auto decrypted = file.decryptFile(encrypted);
+ const auto decrypted = decryptFile(encrypted, file);
d->tempFile->write(decrypted);
} else {
#endif