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