diff options
Diffstat (limited to 'protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp')
-rw-r--r-- | protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp b/protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp index 82247af84e..ef0440ef6f 100644 --- a/protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp +++ b/protocols/Telegram/tdlib/td/td/mtproto/Transport.cpp @@ -1,5 +1,5 @@ // -// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022 +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -111,7 +111,7 @@ struct NoCryptoHeader { // message_id is removed from CryptoHeader. Should be removed from here too. // - // int64 message_id; + // uint64 message_id; // uint32 message_data_length; uint8 data[0]; // use compiler extension @@ -158,7 +158,7 @@ std::pair<uint32, UInt128> Transport::calc_message_key2(const AuthKey &auth_key, // msg_key = substr (msg_key_large, 8, 16); UInt128 res; - as_slice(res).copy_from(msg_key_large.substr(8, 16)); + as_mutable_slice(res).copy_from(msg_key_large.substr(8, 16)); return std::make_pair(as<uint32>(msg_key_large_raw) | (1u << 31), res); } @@ -243,7 +243,7 @@ Status Transport::read_crypto_impl(int X, MutableSlice message, const AuthKey &a KDF2(auth_key.key(), header->message_key, X, &aes_key, &aes_iv); } - aes_ige_decrypt(as_slice(aes_key), as_slice(aes_iv), to_decrypt, to_decrypt); + aes_ige_decrypt(as_slice(aes_key), as_mutable_slice(aes_iv), to_decrypt, to_decrypt); size_t tail_size = message.end() - reinterpret_cast<char *>(header->data); if (tail_size < sizeof(PrefixT)) { @@ -378,7 +378,7 @@ void Transport::write_crypto_impl(int X, const Storer &storer, const AuthKey &au KDF2(auth_key.key(), header->message_key, X, &aes_key, &aes_iv); } - aes_ige_encrypt(as_slice(aes_key), as_slice(aes_iv), to_encrypt, to_encrypt); + aes_ige_encrypt(as_slice(aes_key), as_mutable_slice(aes_iv), to_encrypt, to_encrypt); } size_t Transport::write_crypto(const Storer &storer, const AuthKey &auth_key, PacketInfo *info, MutableSlice dest) { |