GitOrigin-RevId: deeb8146386c0f5aedba7fca70a061fc5341e669
This commit is contained in:
Arseny Smirnov 2019-07-02 17:34:27 +02:00
parent 61206293fe
commit 8a4402e0b1

View File

@ -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");
}