move the mint cookie protector to the handshake package

It's duplicate code now, but it reduces the dependency on mint.
This commit is contained in:
Marten Seemann
2018-08-13 11:04:47 +07:00
parent 00775db9d5
commit 623fcd85b0
4 changed files with 128 additions and 7 deletions

View File

@@ -8,8 +8,6 @@ import (
"net"
"time"
"github.com/bifurcation/mint"
"github.com/lucas-clemente/quic-go/internal/crypto"
"github.com/lucas-clemente/quic-go/internal/mocks/crypto"
"github.com/lucas-clemente/quic-go/internal/protocol"
@@ -99,7 +97,7 @@ type mockCookieProtector struct {
decodeErr error
}
var _ mint.CookieProtector = &mockCookieProtector{}
var _ cookieProtector = &mockCookieProtector{}
func (mockCookieProtector) NewToken(sourceAddr []byte) ([]byte, error) {
return append([]byte("token "), sourceAddr...), nil