forked from quic-go/quic-go
add a unit test using the test vector from the draft
This commit is contained in:
@@ -3,6 +3,8 @@ package handshake
|
||||
import (
|
||||
"crypto"
|
||||
"crypto/cipher"
|
||||
"encoding/hex"
|
||||
"strings"
|
||||
|
||||
"github.com/alangpierce/go-forceexport"
|
||||
"github.com/golang/mock/gomock"
|
||||
@@ -52,6 +54,18 @@ var cipherSuites = []*qtls.CipherSuiteTLS13{
|
||||
},
|
||||
}
|
||||
|
||||
func splitHexString(s string) (slice []byte) {
|
||||
for _, ss := range strings.Split(s, " ") {
|
||||
if ss[0:2] == "0x" {
|
||||
ss = ss[2:]
|
||||
}
|
||||
d, err := hex.DecodeString(ss)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
slice = append(slice, d...)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func init() {
|
||||
if err := forceexport.GetFunc(&aeadChaCha20Poly1305, "github.com/marten-seemann/qtls.aeadChaCha20Poly1305"); err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user