diff options
| author | levlam <levlam@telegram.org> | 2024-09-10 18:10:08 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-09-10 18:10:08 +0300 |
| commit | ac8c0ee4e7f4016cb9c91decdcaa085277d276fb (patch) | |
| tree | 3809d1019da5cfc699d8153d0471a9725a6d48e6 /td/telegram/SecureStorage.cpp | |
| parent | dcfd86c70c565c9c1d2f576a9ff0a769f2ef5e49 (diff) | |
Improve variable names.
Diffstat (limited to 'td/telegram/SecureStorage.cpp')
| -rw-r--r-- | td/telegram/SecureStorage.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/td/telegram/SecureStorage.cpp b/td/telegram/SecureStorage.cpp index 362e87354..44b48b2f6 100644 --- a/td/telegram/SecureStorage.cpp +++ b/td/telegram/SecureStorage.cpp @@ -354,9 +354,9 @@ Result<BufferSlice> decrypt_value(const Secret &secret, const ValueHash &hash, S auto aes_cbc_state = calc_aes_cbc_state_sha512(PSLICE() << secret.as_slice() << hash.as_slice()); Decryptor decryptor(std::move(aes_cbc_state)); TRY_RESULT(decrypted_value, decryptor.append(BufferSlice(data))); - TRY_RESULT(got_hash, decryptor.finish()); - if (got_hash.as_slice() != hash.as_slice()) { - return Status::Error(PSLICE() << "Hash mismatch " << format::as_hex_dump<4>(got_hash.as_slice()) << " " + TRY_RESULT(stored_hash, decryptor.finish()); + if (stored_hash.as_slice() != hash.as_slice()) { + return Status::Error(PSLICE() << "Hash mismatch " << format::as_hex_dump<4>(stored_hash.as_slice()) << " " << format::as_hex_dump<4>(hash.as_slice())); } return std::move(decrypted_value); @@ -395,9 +395,9 @@ Status decrypt_file(const Secret &secret, const ValueHash &hash, const string &s return Status::OK(); })); - TRY_RESULT(got_hash, decryptor.finish()); + TRY_RESULT(stored_hash, decryptor.finish()); - if (hash.as_slice() != got_hash.as_slice()) { + if (hash.as_slice() != stored_hash.as_slice()) { return Status::Error("Hash mismatch"); } |
