Merge pull request #1571 from slingamn/validation

validate that passphrases are valid as non-final IRC parameters
This commit is contained in:
Shivaram Lingamneni 2021-03-01 17:09:51 -05:00 committed by GitHub
commit 143e6ba9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -479,7 +479,11 @@ func validatePassphrase(passphrase string) error {
if passphrase == "*" {
return errAccountBadPassphrase
}
// for now, just enforce that spaces are not allowed
// validate that the passphrase contains no spaces, and furthermore is valid as a
// non-final IRC parameter. we already checked that it is nonempty:
if passphrase[0] == ':' {
return errAccountBadPassphrase
}
for _, r := range passphrase {
if unicode.IsSpace(r) {
return errAccountBadPassphrase