From e78831cd2b28fa67b8c25d086cbce200ef0caaf9 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Mon, 29 Jun 2020 19:29:17 +0300 Subject: [PATCH] secret chats: fix CHECK GitOrigin-RevId: 191ec9b6542f1e861465c862261ed78a93d33886 --- td/telegram/SecretChatActor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/SecretChatActor.cpp b/td/telegram/SecretChatActor.cpp index a983b4a1d..a5569db73 100644 --- a/td/telegram/SecretChatActor.cpp +++ b/td/telegram/SecretChatActor.cpp @@ -2138,7 +2138,10 @@ Status SecretChatActor::on_inbound_action(secret_api::decryptedMessageActionRequ if (pfs_state_.state != PfsState::Empty) { return Status::Error("Unexpected RequestKey"); } - LOG_CHECK(pfs_state_.other_auth_key.empty()) << "TODO: got requestKey, before old key is dropped"; + if (!pfs_state_.other_auth_key.empty()) { + LOG_CHECK(pfs_state_.can_forget_other_key) << "TODO: got requestKey, before old key is dropped"; + return Status::Error("Unexpected RequestKey (old key is used)"); + } pfs_state_.state = PfsState::SendAccept; pfs_state_.handshake = DhHandshake(); pfs_state_.exchange_id = request_key.exchange_id_;