github.com/mikelsr/quic-go@v0.36.1-0.20230701132136-1d9415b66898/internal/handshake/handshake_suite_test.go (about) 1 package handshake 2 3 import ( 4 "crypto/tls" 5 "encoding/hex" 6 "strings" 7 "testing" 8 9 "github.com/golang/mock/gomock" 10 11 . "github.com/onsi/ginkgo/v2" 12 . "github.com/onsi/gomega" 13 ) 14 15 func TestHandshake(t *testing.T) { 16 RegisterFailHandler(Fail) 17 RunSpecs(t, "Handshake Suite") 18 } 19 20 var mockCtrl *gomock.Controller 21 22 var _ = BeforeEach(func() { 23 mockCtrl = gomock.NewController(GinkgoT()) 24 }) 25 26 var _ = AfterEach(func() { 27 mockCtrl.Finish() 28 }) 29 30 func splitHexString(s string) (slice []byte) { 31 for _, ss := range strings.Split(s, " ") { 32 if ss[0:2] == "0x" { 33 ss = ss[2:] 34 } 35 d, err := hex.DecodeString(ss) 36 ExpectWithOffset(1, err).ToNot(HaveOccurred()) 37 slice = append(slice, d...) 38 } 39 return 40 } 41 42 var cipherSuites = []*cipherSuite{ 43 getCipherSuite(tls.TLS_AES_128_GCM_SHA256), 44 getCipherSuite(tls.TLS_AES_256_GCM_SHA384), 45 getCipherSuite(tls.TLS_CHACHA20_POLY1305_SHA256), 46 }