aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-11-25 19:49:22 +0200
committerRiccardo Spagni <ric@spagni.net>2017-11-25 19:49:22 +0200
commit7dc58410e5883cdf73e45eee2ba8d5eb3b30d25f (patch)
tree3352ef09ae125ba278881df1cb346a32a0b4e148 /src
parentMerge pull request #2368 (diff)
parentcryptonote: do not overwrite const data (diff)
downloadmonero-7dc58410e5883cdf73e45eee2ba8d5eb3b30d25f.tar.xz
Merge pull request #2784
54a4c1cb cryptonote: do not overwrite const data (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp4
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
index 1c28ca4d8..3c760493f 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
+++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -994,7 +994,7 @@ namespace cryptonote
block_hashes_cached = block_hashes_cached_count;
}
//---------------------------------------------------------------
- crypto::secret_key encrypt_key(const crypto::secret_key &key, const std::string &passphrase)
+ crypto::secret_key encrypt_key(crypto::secret_key key, const std::string &passphrase)
{
crypto::hash hash;
crypto::cn_slow_hash(passphrase.data(), passphrase.size(), hash);
@@ -1002,7 +1002,7 @@ namespace cryptonote
return key;
}
//---------------------------------------------------------------
- crypto::secret_key decrypt_key(const crypto::secret_key &key, const std::string &passphrase)
+ crypto::secret_key decrypt_key(crypto::secret_key key, const std::string &passphrase)
{
crypto::hash hash;
crypto::cn_slow_hash(passphrase.data(), passphrase.size(), hash);
diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h
index f88310c4c..aebeaa6f4 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.h
+++ b/src/cryptonote_basic/cryptonote_format_utils.h
@@ -226,8 +226,8 @@ namespace cryptonote
bool is_valid_decomposed_amount(uint64_t amount);
void get_hash_stats(uint64_t &tx_hashes_calculated, uint64_t &tx_hashes_cached, uint64_t &block_hashes_calculated, uint64_t & block_hashes_cached);
- crypto::secret_key encrypt_key(const crypto::secret_key &key, const std::string &passphrase);
- crypto::secret_key decrypt_key(const crypto::secret_key &key, const std::string &passphrase);
+ crypto::secret_key encrypt_key(crypto::secret_key key, const std::string &passphrase);
+ crypto::secret_key decrypt_key(crypto::secret_key key, const std::string &passphrase);
#define CHECKED_GET_SPECIFIC_VARIANT(variant_var, specific_type, variable_name, fail_return_val) \
CHECK_AND_ASSERT_MES(variant_var.type() == typeid(specific_type), fail_return_val, "wrong variant type: " << variant_var.type().name() << ", expected " << typeid(specific_type).name()); \
specific_type& variable_name = boost::get<specific_type>(variant_var);