From 1f825a467a0123c2db2ef41afa2ccb9619268b36 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 4 Feb 2022 18:06:30 +0300 Subject: [PATCH] [#1136] cli: Allow usage of empty wallet passwords Signed-off-by: Pavel Karpy (cherry picked from commit c7a8c762e0f5795719b1d4c0d086aa3b32bf85c5) --- cmd/neofs-cli/modules/root.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/neofs-cli/modules/root.go b/cmd/neofs-cli/modules/root.go index 3b7b81299..0c5d16b6e 100644 --- a/cmd/neofs-cli/modules/root.go +++ b/cmd/neofs-cli/modules/root.go @@ -215,9 +215,11 @@ func getKeyNoGenerate() (*ecdsa.PrivateKey, error) { } func getPassword() (string, error) { - if pass := viper.GetString(password); pass != "" { - return pass, nil + // this check allows empty passwords + if viper.IsSet(password) { + return viper.GetString(password), nil } + return input.ReadPassword("Enter password > ") }