allow trailing+leading whitespace for passwords - #1717

warn users when they enter passwords with leading/trailing whitespaces

Updated config_test.go, removing deprecated test case and updated TestReveal
This commit is contained in:
ishuah
2017-10-19 14:36:12 +03:00
committed by Nick Craig-Wood
parent d121a94c20
commit 10f27e2ff2
3 changed files with 11 additions and 11 deletions

View File

@@ -107,9 +107,9 @@ func TestReveal(t *testing.T) {
in string
wantErr string
}{
{"YmJiYmJiYmJiYmJiYmJiYp*gcEWbAw", "base64 decode failed: illegal base64 data at input byte 22"},
{"aGVsbG8", "input too short"},
{"", "input too short"},
{"YmJiYmJiYmJiYmJiYmJiYp*gcEWbAw", "base64 decode failed when revealing password - is it obscured?: illegal base64 data at input byte 22"},
{"aGVsbG8", "input too short when revealing password - is it obscured?"},
{"", "input too short when revealing password - is it obscured?"},
} {
gotString, gotErr := Reveal(test.in)
assert.Equal(t, "", gotString)
@@ -203,9 +203,6 @@ func TestPassword(t *testing.T) {
// Simple check of wrong passwords
hashedKeyCompare(t, "mis", "match", false)
// Check that passwords match with trimmed whitespace
hashedKeyCompare(t, " abcdef \t", "abcdef", true)
// Check that passwords match after unicode normalization
hashedKeyCompare(t, "ff\u0041\u030A", "ffÅ", true)