]> Sergey Matveev's repositories - godlighty.git/commitdiff
GOST is only for TLS 1.3
authorSergey Matveev <stargrave@stargrave.org>
Wed, 6 Oct 2021 14:58:24 +0000 (17:58 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 6 Oct 2021 14:58:24 +0000 (17:58 +0300)
tls_gost.go

index a4ab28da5edac70aea776999d5371d529e6436a6..1ad67b42cb6ecd3cc6f25b82ae654f6267ef64c9 100644 (file)
@@ -5,6 +5,16 @@ package godlighty
 import "crypto/tls"
 
 func CHIHasGOST(chi *tls.ClientHelloInfo) bool {
+       tls13Found := false
+       for _, v := range chi.SupportedVersions {
+               if v == tls.VersionTLS13 {
+                       tls13Found = true
+                       break
+               }
+       }
+       if !tls13Found {
+               return false
+       }
        for _, ss := range chi.SignatureSchemes {
                switch ss {
                case tls.GOSTR34102012256A, tls.GOSTR34102012256B, tls.GOSTR34102012256C, tls.GOSTR34102012256D, tls.GOSTR34102012512A, tls.GOSTR34102012512B, tls.GOSTR34102012512C: