aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-07-15 14:33:48 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-08-16 11:57:49 +0000
commitab74dc277aac3922a266ccae30fa2c30d9222790 (patch)
tree5846c8cf7c865417039aa90540f330e950625ae6 /src/device
parentcommon: add a class to safely wrap mlock/munlock (diff)
downloadmonero-ab74dc277aac3922a266ccae30fa2c30d9222790.tar.xz
crypto: make secret_key automatically mlock
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_default.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/device_default.cpp b/src/device/device_default.cpp
index bf14813ea..a4f40e041 100644
--- a/src/device/device_default.cpp
+++ b/src/device/device_default.cpp
@@ -103,7 +103,7 @@ namespace hw {
bool device_default::generate_chacha_key(const cryptonote::account_keys &keys, crypto::chacha_key &key, uint64_t kdf_rounds) {
const crypto::secret_key &view_key = keys.m_view_secret_key;
const crypto::secret_key &spend_key = keys.m_spend_secret_key;
- tools::scrubbed_arr<char, sizeof(view_key) + sizeof(spend_key) + 1> data;
+ epee::mlocked<tools::scrubbed_arr<char, sizeof(view_key) + sizeof(spend_key) + 1>> data;
memcpy(data.data(), &view_key, sizeof(view_key));
memcpy(data.data() + sizeof(view_key), &spend_key, sizeof(spend_key));
data[sizeof(data) - 1] = CHACHA8_KEY_TAIL;