From: Sergey Matveev Date: Wed, 6 Oct 2021 14:58:24 +0000 (+0300) Subject: GOST is only for TLS 1.3 X-Git-Url: http://www.git.stargrave.org/?p=godlighty.git;a=commitdiff_plain;h=3b94a1d826e19e44b9516551231d87024384c469 GOST is only for TLS 1.3 --- diff --git a/tls_gost.go b/tls_gost.go index a4ab28d..1ad67b4 100644 --- a/tls_gost.go +++ b/tls_gost.go @@ -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: