From 8a4402e0b12cfc11a75d99551651b1c8d0d41ad9 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Tue, 2 Jul 2019 17:34:27 +0200 Subject: [PATCH] bufix GitOrigin-RevId: deeb8146386c0f5aedba7fca70a061fc5341e669 --- 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 9457cc32f..865b49270 100644 --- a/td/mtproto/TlsInit.cpp +++ b/td/mtproto/TlsInit.cpp @@ -378,8 +378,8 @@ Status TlsInit::wait_hello_response() { auto response_rand_slice = response.as_slice().substr(11, 32); auto response_rand = response_rand_slice.str(); std::fill(response_rand_slice.begin(), response_rand_slice.end(), '\0'); - std::string hash_dest(32, 0); - hmac_sha256(password_, PSLICE() << hello_rand_ << response_rand, hash_dest); + 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"); }