From 115053930e4894aa689afb8fb8dfa032585ccd01 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 16 Oct 2017 22:03:06 +0100 Subject: [PATCH] Make error messages less crypting when revealing an unobscured password - fixes #1743 --- fs/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/config.go b/fs/config.go index e8089132b..e559d56a6 100644 --- a/fs/config.go +++ b/fs/config.go @@ -182,15 +182,15 @@ func MustObscure(x string) string { func Reveal(x string) (string, error) { ciphertext, err := base64.RawURLEncoding.DecodeString(x) if err != nil { - return "", errors.Wrap(err, "base64 decode failed") + return "", errors.Wrap(err, "base64 decode failed when revealing password - is it obscured?") } if len(ciphertext) < aes.BlockSize { - return "", errors.New("input too short") + return "", errors.New("input too short when revealing password - is it obscured?") } buf := ciphertext[aes.BlockSize:] iv := ciphertext[:aes.BlockSize] if err := crypt(buf, buf, iv); err != nil { - return "", errors.Wrap(err, "decrypt failed") + return "", errors.Wrap(err, "decrypt failed when revealing password - is it obscured?") } return string(buf), nil }