From 305def9493d9ba20246068b7676e50f384b6ae39 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 9 Jun 2014 18:28:08 -0400 Subject: [PATCH 1/4] changed some print messages --- src/simplewallet/simplewallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 95d163f2e..e2b0cab13 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -42,7 +42,7 @@ namespace const command_line::arg_descriptor arg_password = {"password", "Wallet password", "", true}; const command_line::arg_descriptor arg_electrum_seed = {"electrum-seed", "Specify electrum seed for wallet recovery/creation", ""}; const command_line::arg_descriptor arg_restore_deterministic_wallet = {"restore-deterministic-wallet", "Recover wallet using electrum-style mnemonic", false}; - const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "requires --generate-new-wallet, uses old generation method", false}; + const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "created non-deterministic view and spend keys", false}; const command_line::arg_descriptor arg_daemon_port = {"daemon-port", "Use daemon instance at port instead of 8081", 0}; const command_line::arg_descriptor arg_log_level = {"set_log", "", 0, true}; @@ -399,7 +399,7 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas if (!two_random) { - print_electrum = "\nYour wallet can be recovered using the following electrum-style word list:\n"; + print_electrum = "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; print_electrum += electrum_words; print_electrum += "\n"; } From 0c85229924f7e0d85cb16fedf1ffbf23f870770e Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 9 Jun 2014 20:04:56 -0400 Subject: [PATCH 2/4] changed text a bit more --- src/simplewallet/simplewallet.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index e2b0cab13..21f3a8688 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -42,7 +42,7 @@ namespace const command_line::arg_descriptor arg_password = {"password", "Wallet password", "", true}; const command_line::arg_descriptor arg_electrum_seed = {"electrum-seed", "Specify electrum seed for wallet recovery/creation", ""}; const command_line::arg_descriptor arg_restore_deterministic_wallet = {"restore-deterministic-wallet", "Recover wallet using electrum-style mnemonic", false}; - const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "created non-deterministic view and spend keys", false}; + const command_line::arg_descriptor arg_non_deterministic = {"non-deterministic", "creates non-deterministic view and spend keys", false}; const command_line::arg_descriptor arg_daemon_port = {"daemon-port", "Use daemon instance at port instead of 8081", 0}; const command_line::arg_descriptor arg_log_level = {"set_log", "", 0, true}; @@ -397,12 +397,6 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas std::string print_electrum = ""; - if (!two_random) - { - print_electrum = "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; - print_electrum += electrum_words; - print_electrum += "\n"; - } success_msg_writer() << "**********************************************************************\n" << @@ -411,9 +405,16 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas "Use \"help\" command to see the list of available commands.\n" << "Always use \"exit\" command when closing simplewallet to save\n" << "current session's state. Otherwise, you will possibly need to synchronize \n" << - "your wallet again. Your wallet key is NOT under risk anyway.\n" << - print_electrum << - "**********************************************************************"; + "your wallet again. Your wallet key is NOT under risk anyway.\n" + ; + + if (!two_random) + { + success_msg_writer(true) << "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; + success_msg_writer() << electrum_words; + } + success_msg_writer() << "**********************************************************************"; + return true; } //---------------------------------------------------------------------------------------------------- From 205494f0d1bee85444d087f45d58558329f8c4ae Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 9 Jun 2014 20:36:51 -0400 Subject: [PATCH 3/4] change hash for keygen from blake to keccak --- src/cryptonote_core/account.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptonote_core/account.cpp b/src/cryptonote_core/account.cpp index 7da1c6745..3bedd7404 100644 --- a/src/cryptonote_core/account.cpp +++ b/src/cryptonote_core/account.cpp @@ -12,7 +12,7 @@ #include "crypto/crypto.h" extern "C" { -#include "crypto/blake256.h" +#include "crypto/keccak.h" } #include "cryptonote_core/cryptonote_basic_impl.h" #include "cryptonote_core/cryptonote_format_utils.h" @@ -39,7 +39,7 @@ DISABLE_VS_WARNINGS(4244 4345) // rng for generating second set of keys is hash of first rng. means only one set of electrum-style words needed for recovery crypto::secret_key second; - blake256_hash((uint8_t *)&second, (uint8_t *)&first, sizeof(crypto::secret_key)); + keccak((uint8_t *)&first, sizeof(crypto::secret_key), (uint8_t *)&second, sizeof(crypto::secret_key)); generate_keys(m_keys.m_account_address.m_view_public_key, m_keys.m_view_secret_key, second, two_random ? false : true); m_creation_timestamp = time(NULL); From c49cb0461091495c023fb9aa56ca8298a556f0a5 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Thu, 12 Jun 2014 19:34:24 -0400 Subject: [PATCH 4/4] changed wallet mnemonic to use cout so it doesn't print to log --- src/simplewallet/simplewallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 21f3a8688..6af0de9f9 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3,6 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include @@ -411,7 +412,7 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas if (!two_random) { success_msg_writer(true) << "\nPLEASE NOTE: the following 24 words can be used to recover access to your wallet. Please write them down and store them somewhere safe and secure. Please do not store them in your email or on file storage services outside of your immediate control. You will not be able to view these words again, so it is imperative to make note of them now.\n"; - success_msg_writer() << electrum_words; + std::cout << electrum_words << std::endl; } success_msg_writer() << "**********************************************************************";