From c7a8c762e0f5795719b1d4c0d086aa3b32bf85c5 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 --- 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 b260684a1..801513815 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 > ") }