From 937eab5f27f8dceeab499609b51739bd7f437a58 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Apr 2025 20:13:58 +0400 Subject: [PATCH] Update tde2e/tgcalls. --- Telegram/SourceFiles/tde2e/tde2e_api.cpp | 11 ++++++++--- Telegram/SourceFiles/tde2e/tde2e_api.h | 2 +- Telegram/ThirdParty/tgcalls | 2 +- Telegram/build/docker/centos_env/Dockerfile | 2 +- Telegram/build/prepare/prepare.py | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/tde2e/tde2e_api.cpp b/Telegram/SourceFiles/tde2e/tde2e_api.cpp index 3f20804c75..c3cc45d89a 100644 --- a/Telegram/SourceFiles/tde2e/tde2e_api.cpp +++ b/Telegram/SourceFiles/tde2e/tde2e_api.cpp @@ -75,11 +75,12 @@ constexpr auto kShortPollChainBlocksWaitFor = crl::time(1000); } // namespace auto EncryptDecrypt::callback() --> Fn { +-> Fn { return [that = shared_from_this()]( const EncryptionBuffer &data, int64_t userId, - bool encrypt) -> EncryptionBuffer { + bool encrypt, + int32_t unencryptedPrefixSize) -> EncryptionBuffer { const auto libId = that->_id.load(); if (!libId) { return {}; @@ -87,7 +88,11 @@ auto EncryptDecrypt::callback() const auto channelId = tde2e_api::CallChannelId(0); const auto slice = Slice(data); const auto result = encrypt - ? tde2e_api::call_encrypt(libId, channelId, slice) + ? tde2e_api::call_encrypt( + libId, + channelId, + slice, + size_t(unencryptedPrefixSize)) : tde2e_api::call_decrypt(libId, userId, channelId, slice); if (!result.is_ok()) { return {}; diff --git a/Telegram/SourceFiles/tde2e/tde2e_api.h b/Telegram/SourceFiles/tde2e/tde2e_api.h index e1de49c6fa..8d538a47a3 100644 --- a/Telegram/SourceFiles/tde2e/tde2e_api.h +++ b/Telegram/SourceFiles/tde2e/tde2e_api.h @@ -73,7 +73,7 @@ class EncryptDecrypt final : public std::enable_shared_from_this { public: [[nodiscard]] auto callback() - -> Fn; + -> Fn; void setCallId(CallId id); void clearCallId(CallId fromId); diff --git a/Telegram/ThirdParty/tgcalls b/Telegram/ThirdParty/tgcalls index 7f04d5360f..e87034dbdd 160000 --- a/Telegram/ThirdParty/tgcalls +++ b/Telegram/ThirdParty/tgcalls @@ -1 +1 @@ -Subproject commit 7f04d5360f3208d032dffdf634c8ff9c508da2f1 +Subproject commit e87034dbdd8c209318aca57c4ff417117398d14f diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 5a1dd639f9..8bf42a9281 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -818,7 +818,7 @@ COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache / RUN git init td \ && cd td \ && git remote add origin {{ GIT }}/tdlib/td.git \ - && git fetch --depth=1 origin 04adfc87deea4c804def118e88c89a08c388b32b \ + && git fetch --depth=1 origin f1b7500310baa496c0b779e4273a3aff0f14f42f \ && git reset --hard FETCH_HEAD \ && rm -rf .git \ && env -u CFLAGS -u CXXFLAGS cmake -B out/Release . \ diff --git a/Telegram/build/prepare/prepare.py b/Telegram/build/prepare/prepare.py index c9c8fcb149..e26c85c2d4 100644 --- a/Telegram/build/prepare/prepare.py +++ b/Telegram/build/prepare/prepare.py @@ -1928,7 +1928,7 @@ win: stage('td', """ git clone https://github.com/tdlib/td.git cd td - git checkout 04adfc87de + git checkout f1b7500310 win: SET OPENSSL_DIR=%LIBS_DIR%\\openssl3 SET OPENSSL_LIBS_DIR=%OPENSSL_DIR%\\out