Util: added secure_zero_memory with type safety checks
This commit is contained in:
+1
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user