Fix clang warnings.
GitOrigin-RevId: f96c46f526330b6857578689d624d8858380e121
This commit is contained in:
parent
d8c3c2c505
commit
00590f1b72
@ -94,15 +94,14 @@ void PasswordManager::do_get_secure_secret(bool recursive, string password, opti
|
||||
return promise.set_error(Status::Error(400, "Failed to get secure secret"));
|
||||
}
|
||||
|
||||
auto new_promise =
|
||||
PromiseCreator::lambda([recursive, password, hash = std::move(hash), promise = std::move(promise),
|
||||
actor_id = actor_id](Result<bool> r_ok) mutable {
|
||||
if (r_ok.is_error()) {
|
||||
return promise.set_error(r_ok.move_as_error());
|
||||
}
|
||||
send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password),
|
||||
std::move(hash), std::move(promise));
|
||||
});
|
||||
auto new_promise = PromiseCreator::lambda([password, hash = std::move(hash), promise = std::move(promise),
|
||||
actor_id = actor_id](Result<bool> r_ok) mutable {
|
||||
if (r_ok.is_error()) {
|
||||
return promise.set_error(r_ok.move_as_error());
|
||||
}
|
||||
send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password), std::move(hash),
|
||||
std::move(promise));
|
||||
});
|
||||
|
||||
UpdateSettings update_settings;
|
||||
update_settings.current_password = password;
|
||||
|
@ -199,7 +199,6 @@ TEST(Actor2, locker_stress) {
|
||||
std::atomic<int> begin{0};
|
||||
std::atomic<int> ready{0};
|
||||
std::atomic<int> check{0};
|
||||
std::atomic<int> finish{0};
|
||||
std::vector<td::thread> threads;
|
||||
for (size_t i = 0; i < threads_n; i++) {
|
||||
threads.push_back(td::thread([&, id = i] {
|
||||
|
@ -469,7 +469,8 @@ Result<BufferSlice> rsa_encrypt_pkcs1_oaep(Slice public_key, Slice data) {
|
||||
RSA *rsa = pkey->pkey.rsa;
|
||||
int outlen = RSA_size(rsa);
|
||||
BufferSlice res(outlen);
|
||||
if (RSA_public_encrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) {
|
||||
if (RSA_public_encrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()),
|
||||
res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) {
|
||||
#else
|
||||
EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(pkey, nullptr);
|
||||
if (!ctx) {
|
||||
@ -520,7 +521,8 @@ Result<BufferSlice> rsa_decrypt_pkcs1_oaep(Slice private_key, Slice data) {
|
||||
RSA *rsa = pkey->pkey.rsa;
|
||||
size_t outlen = RSA_size(rsa);
|
||||
BufferSlice res(outlen);
|
||||
auto inlen = RSA_private_decrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING);
|
||||
auto inlen = RSA_private_decrypt(narrow_cast<int>(data.size()), const_cast<unsigned char *>(data.ubegin()),
|
||||
res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING);
|
||||
if (inlen == -1) {
|
||||
return Status::Error("Cannot decrypt");
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ class DoAuthentication : public Task {
|
||||
default:
|
||||
CHECK(false) << "Unexpected authorization state " << to_string(authorization_state);
|
||||
}
|
||||
send_query(std::move(function), [this](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); });
|
||||
send_query(std::move(function), [](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); });
|
||||
}
|
||||
void on_authorization_ready() {
|
||||
LOG(INFO) << "GOT AUTHORIZED";
|
||||
|
Reference in New Issue
Block a user