Closed MCM-Mike closed 3 years ago
Give the wallet the wrong foreign API password.
Setup a Grin-Wallet.
Give the wallet the wrong foreign API password, run grin-wallet info. verify that the error includes the cause (authorization denied).
It should fail. Expect the error message to not indicate that password is incorrect, instead it should report ResponseError error: Cannot parse response
Include the output of command
grin-wallet -V
and your environment
uname -a
OS: Debian 10\
Grin Wallet: grin-wallet 5.0.0-rc.1
\
System Info: Linux debian2 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
$ ./grin-wallet init
Please enter a password for your new wallet
Password:
A 24-word recovery phrase will appear that can be used to back-up the wallet. (An example recovery phrase is shown.)
20201227 10:51:25.831 WARN grin_wallet_impls::lifecycle::seed - Generating wallet seed file at: /home/user2/.grin/main/wallet_data/wallet.seed
Your recovery phrase is:
wash swarm aerobic friend taxi unknown skin foil legal kick range win weasel bring neck unknown skin foil aerobic kick
Please back-up these words in a non-digital format.
Command 'init' completed successfully
~/.grin/main/wallet_data/wallet.seed
. The wallet configuration file will be in ~/.grin/main/grin-wallet.toml
.While the GRIN-Node is running, check the basic wallet contents summary. Enter your password to continue.
$ ./grin-wallet info
The output should appear similar to this.
20201227 11:03:14.001 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20201227 11:03:14.026 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201227 11:03:14.042 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201227 11:03:14.043 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete
____ Wallet Summary Info - Account 'default' as of height 1020371 ____
Confirmed Total | 0.000000000
Awaiting Confirmation (< 10) | 0.000000000
Awaiting Finalization | 0.000000000
Locked by previous transaction | 0.000000000
-------------------------------- | -------------
Currently Spendable | 0.000000000
Command 'info' completed successfully
node_api_secret_path
in the grin-wallet.toml
config file at the ~/.grin/main
directory.
grin-wallet.toml
node_api_secret_path = "/home/user2/.grin/main/.foreign_api_secret"
$ cp .foreign_api_secret .foreign_api_secret_backup
Edit your foreign API secret into a string of x's.
.foreign_api_secret
xxxxxxxxxxxxxxxxxxxx
It's now time to test the wallet by giving it the wrong foreign API secret. While the GRIN-Node is running, check the basic wallet contents summary. Enter your password at the prompt.
$ cd ~/grin-wallet-5.0.0-rc.1/target/release/
$ ./grin-wallet info
An unexpected output will appear.
20201227 11:24:23.779 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 0% complete
20201227 11:24:23.799 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201227 11:24:23.810 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning - 99% complete
20201227 11:24:23.811 WARN grin_wallet_libwallet::api_impl::owner_updater - Scanning Complete
____ Wallet Summary Info - Account 'default' as of height 1020388 ____
Confirmed Total | 0.000000000
Awaiting Confirmation (< 10) | 0.000000000
Awaiting Finalization | 0.000000000
Locked by previous transaction | 0.000000000
-------------------------------- | -------------
Currently Spendable | 0.000000000
Command 'info' completed successfully
The actual output of ./grin-wallet info
does not match with the expected error output after providing the wallet with the wrong foreign API secret.
Thanks for checking @goyle I will attempt to reproduce this.
@goyle I'm afraid this issue was not valid. The foreign API is not protected https://docs.rs/grin_wallet_api/4.0.0/grin_wallet_api/trait.ForeignRpc.html and it should not affect the performance of the wallet grin-wallet info
. I think I have misunderstood the issue, terribly sorry for this, of course you will be rewarded for your test work regardless of that.
Maybe @MCM-Mike could elaborate what he meant in this test, in the current form I am not really sure. Your findings seems perfectly correct to me.
Description: Give the wallet the wrong foreign API password.
Prerequisites: Setup a Grin-Wallet.
Give the wallet the wrong foreign API password, run
grin-wallet info
. verify that the error includes the cause (authorization denied).Expected result: It should fail. Expect the error message to not indicate that password is incorrect, instead it should report
ResponseError error: Cannot parse response
Include the output of command
and your environment