secret chats: fix CHECK

GitOrigin-RevId: 191ec9b6542f1e861465c862261ed78a93d33886
This commit is contained in:
Arseny Smirnov 2020-06-29 19:29:17 +03:00
parent 5507d58339
commit e78831cd2b

View File

@ -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_;