hasSupportedVersion is a helper function that returns true if the list of supported versions contains a version between min and max. If the versions list is outside the min/max, then it returns false.
(minVal, maxVal uint16, versions []uint16)
| 1974 | // of supported versions contains a version between min and max. |
| 1975 | // If the versions list is outside the min/max, then it returns false. |
| 1976 | func hasSupportedVersion(minVal, maxVal uint16, versions []uint16) bool { |
| 1977 | for _, v := range versions { |
| 1978 | if v >= minVal && v <= maxVal { |
| 1979 | // If one version is in between min/max, return true. |
| 1980 | return true |
| 1981 | } |
| 1982 | } |
| 1983 | return false |
| 1984 | } |
| 1985 | |
| 1986 | // versionName is tls.VersionName in go 1.21. |
| 1987 | // Until the switch, the function is copied locally. |
no outgoing calls
no test coverage detected