This commit is contained in:
Unknwon 2014-11-18 15:13:08 -05:00
parent 37d8d3afe9
commit ce8d4cc80b
4 changed files with 57 additions and 44 deletions

View file

@ -108,6 +108,7 @@ var (
// CheckPublicKeyString checks if the given public key string is recognized by SSH.
func CheckPublicKeyString(content string) (bool, error) {
content = strings.TrimRight(content, "\n\r")
if strings.ContainsAny(content, "\n\r") {
return false, errors.New("only a single line with a single key please")
}