11 lines
325 B
Go
11 lines
325 B
Go
package ssh
|
|
|
|
import "regexp"
|
|
|
|
var clientVersionVerifier = regexp.MustCompile(`^[a-zA-Z0-9\.\-\_]+\x{20}?[a-zA-Z0-9\.\-\_]+?$`)
|
|
|
|
// isValidClientVersion returns true if provided SSH client version string is compliant with RFC-4253.
|
|
func isValidClientVersion(ver string) bool {
|
|
return clientVersionVerifier.MatchString(ver)
|
|
}
|