]> Sergey Matveev's repositories - godlighty.git/blob - tls_gost.go
.shtml MIME
[godlighty.git] / tls_gost.go
1 //go:build !nogostls13
2 // +build !nogostls13
3
4 package godlighty
5
6 import "crypto/tls"
7
8 func CHIHasGOST(chi *tls.ClientHelloInfo) bool {
9         tls13Found := false
10         for _, v := range chi.SupportedVersions {
11                 if v == tls.VersionTLS13 {
12                         tls13Found = true
13                         break
14                 }
15         }
16         if !tls13Found {
17                 return false
18         }
19         for _, ss := range chi.SignatureSchemes {
20                 switch ss {
21                 case tls.GOSTR34102012256A, tls.GOSTR34102012256B, tls.GOSTR34102012256C, tls.GOSTR34102012256D, tls.GOSTR34102012512A, tls.GOSTR34102012512B, tls.GOSTR34102012512C:
22                         return true
23                 }
24         }
25         return false
26 }