This commit is contained in:
parent
37d8d3afe9
commit
ce8d4cc80b
4 changed files with 57 additions and 44 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue