]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Fail with error before calling folder metada setup when received empty signature.
authorCamila Ayres <hello@camilasan.com>
Mon, 14 Oct 2024 14:36:38 +0000 (16:36 +0200)
committerCamila Ayres <hello@camilasan.com>
Wed, 16 Oct 2024 09:51:01 +0000 (11:51 +0200)
Signed-off-by: Camila Ayres <hello@camilasan.com>
src/libsync/discoveryphase.cpp

index 0fcfabed9c82ee8eb8b10edb509e8741c6b1b4f2..38e4a424c5a736cc59ee04238e6cb269d6c5e4e7 100644 (file)
@@ -696,6 +696,14 @@ void DiscoverySingleDirectoryJob::metadataReceived(const QJsonDocument &json, in
         }
     }
 
+    if (job->signature().isEmpty()) {
+        qCDebug(lcDiscovery) << "Initial signature is empty.";
+        _account->reportClientStatus(OCC::ClientStatusReportingStatus::E2EeError_GeneralError);
+        emit finished(HttpError{0, tr("Encrypted metadata setup error: initial signature from server is empty.")});
+        deleteLater();
+        return;
+    }
+
     const auto e2EeFolderMetadata = new FolderMetadata(_account,
                                                  _remoteRootFolderPath,
                                                  statusCode == 404 ? QByteArray{} : json.toJson(QJsonDocument::Compact),