Add comment about random_length value.

This commit is contained in:
levlam 2021-07-19 20:19:44 +03:00
parent efc762360c
commit 75022464b3

View File

@ -1933,13 +1933,13 @@ void SecretChatActor::get_dh_config() {
}
auto version = auth_state_.dh_config.version;
int32 random_length = 0;
int32 random_length = 256; // ignored server-side, always returns 256 random bytes
auto query = create_net_query(QueryType::DhConfig, telegram_api::messages_getDhConfig(version, random_length));
context_->send_net_query(std::move(query), actor_shared(this), false);
}
Status SecretChatActor::on_dh_config(NetQueryPtr query) {
LOG(INFO) << "Got dh config";
LOG(INFO) << "Got DH config";
TRY_RESULT(config, fetch_result<telegram_api::messages_getDhConfig>(std::move(query)));
downcast_call(*config, [&](auto &obj) { this->on_dh_config(obj); });
TRY_STATUS(mtproto::DhHandshake::check_config(auth_state_.dh_config.g, auth_state_.dh_config.prime,