From ddaaf2c344b157aac01312b8d908ffde8e17dc11 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 14 Oct 2024 16:36:38 +0200 Subject: [PATCH] Fail with error before calling folder metada setup when received empty signature. Signed-off-by: Camila Ayres --- src/libsync/discoveryphase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 0fcfabed9..38e4a424c 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -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),