This commit is contained in:
Unknwon committed 2014-11-18 15:13:08 -05:00
1 parent 37d8d3afe9
commit ce8d4cc80b
4 files changed
+57 -44

No files matched your search

+1
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")
}