Skip to content

Commit ea3e2e4

Browse files
authored
Merge pull request #9229 from nextcloud/backport/9195/stable-4.0
[stable-4.0] Bugfix/secure drop link
2 parents 95ea8a0 + bbb323c commit ea3e2e4

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/libsync/clientsideencryption.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,27 +2679,27 @@ bool EncryptionHelper::dataDecryption(const QByteArray &key, const QByteArray &i
26792679

26802680
/* Create and initialise the context */
26812681
if (!ctx) {
2682-
qCInfo(lcCse()) << "Could not create context";
2682+
qCWarning(lcCse()) << "Could not create context";
26832683
return false;
26842684
}
26852685

26862686
/* Initialise the decryption operation. */
26872687
if (!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
2688-
qCInfo(lcCse()) << "Could not init cipher";
2688+
qCWarning(lcCse()) << "Could not init cipher";
26892689
return false;
26902690
}
26912691

26922692
EVP_CIPHER_CTX_set_padding(ctx, 0);
26932693

26942694
/* Set IV length. */
26952695
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
2696-
qCInfo(lcCse()) << "Could not set iv length";
2696+
qCWarning(lcCse()) << "Could not set iv length";
26972697
return false;
26982698
}
26992699

27002700
/* Initialise key and IV */
27012701
if (!EVP_DecryptInit_ex(ctx, nullptr, nullptr, (const unsigned char *)key.constData(), (const unsigned char *)iv.constData())) {
2702-
qCInfo(lcCse()) << "Could not set key and iv";
2702+
qCWarning(lcCse()) << "Could not set key and iv";
27032703
return false;
27042704
}
27052705

@@ -2717,12 +2717,12 @@ bool EncryptionHelper::dataDecryption(const QByteArray &key, const QByteArray &i
27172717
QByteArray data = inputBuffer.read(toRead);
27182718

27192719
if (data.size() == 0) {
2720-
qCInfo(lcCse()) << "Could not read data from file";
2720+
qCWarning(lcCse()) << "Could not read data from file";
27212721
return false;
27222722
}
27232723

27242724
if (!EVP_DecryptUpdate(ctx, unsignedData(out), &len, (unsigned char *)data.constData(), data.size())) {
2725-
qCInfo(lcCse()) << "Could not decrypt";
2725+
qCWarning(lcCse()) << "Could not decrypt";
27262726
return false;
27272727
}
27282728

@@ -2733,12 +2733,12 @@ bool EncryptionHelper::dataDecryption(const QByteArray &key, const QByteArray &i
27332733

27342734
/* Set expected e2EeTag value. Works in OpenSSL 1.0.1d and later */
27352735
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, e2EeTag.size(), (unsigned char *)e2EeTag.constData())) {
2736-
qCInfo(lcCse()) << "Could not set expected e2EeTag";
2736+
qCWarning(lcCse()) << "Could not set expected e2EeTag";
27372737
return false;
27382738
}
27392739

27402740
if (1 != EVP_DecryptFinal_ex(ctx, unsignedData(out), &len)) {
2741-
qCInfo(lcCse()) << "Could not finalize decryption";
2741+
qCWarning(lcCse()) << "Could not finalize decryption";
27422742
return false;
27432743
}
27442744
outputBuffer.write(out, len);

src/libsync/foldermetadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ bool FolderMetadata::parseFileDropPart(const QJsonDocument &doc)
792792
if (userParsedId == _account->davUser()) {
793793
const auto fileDropEntryUser = UserWithFileDropEntryAccess{
794794
userParsedId,
795-
decryptDataWithPrivateKey(QByteArray::fromBase64(userParsed.value(usersEncryptedFiledropKey).toByteArray()))};
795+
QByteArray::fromBase64(decryptDataWithPrivateKey(userParsed.value(usersEncryptedFiledropKey).toByteArray()))
796+
};
796797
if (!fileDropEntryUser.isValid()) {
797798
qCWarning(lcCseMetadata()) << "Could not parse filedrop data. encryptedFiledropKey decryption failed";
798799
_account->reportClientStatus(OCC::ClientStatusReportingStatus::E2EeError_GeneralError);

0 commit comments

Comments
 (0)