From b8e8f337c26eae261c71184e9504003c69c32840 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 3 Jul 2019 02:50:19 +0300 Subject: [PATCH] Minor TlsInit improvements. GitOrigin-RevId: 59619af2a0059a85bbdeab2775ed3805dd3ab818 --- td/mtproto/TlsInit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td/mtproto/TlsInit.cpp b/td/mtproto/TlsInit.cpp index 1490cadc9..6958d0e4c 100644 --- a/td/mtproto/TlsInit.cpp +++ b/td/mtproto/TlsInit.cpp @@ -347,7 +347,7 @@ class TlsObfusaction { void TlsInit::send_hello() { auto hello = TlsObfusaction::generate_header(username_, password_, static_cast(Clocks::system())); // TODO correct time - hello_rand_ = Slice(hello).substr(11, 32).str(); + hello_rand_ = hello.substr(11, 32); fd_.output_buffer().append(hello); state_ = State::WaitHelloResponse; } @@ -381,7 +381,7 @@ Status TlsInit::wait_hello_response() { std::string hash_dest(32, '\0'); hmac_sha256(password_, PSLICE() << hello_rand_ << response.as_slice(), hash_dest); if (hash_dest != response_rand) { - return td::Status::Error("response hash mismatch"); + return td::Status::Error("Response hash mismatch"); } stop();