Util: added secure_zero_memory with type safety checks

This commit is contained in:
SChernykh
2025-10-07 12:53:20 +02:00
parent dd9d5b03aa
commit 2ce8ce65e2
4 changed files with 40 additions and 2 deletions
+1 -2
View File
@@ -806,6 +806,7 @@ void p2pool::send_aux_job_donation()
}
Params::AuthorKey key;
ON_SCOPE_LEAVE([&key](){ secure_zero_memory(key); });
if (f.tellg() != static_cast<std::streampos>(sizeof(key))) {
LOGERR(1, "send_aux_job_donation: " << m_params->m_authorKeyFile << " has an invalid size");
@@ -869,8 +870,6 @@ void p2pool::send_aux_job_donation()
return;
}
OPENSSL_cleanse(&key, sizeof(key));
job.insert(job.end(), signature, signature + sizeof(signature));
m_p2pServer->broadcast_aux_job_donation_async(job.data(), static_cast<uint32_t>(job.size()), timestamp);