update dependencies

This commit is contained in:
Darien Raymond
2019-01-17 15:44:22 +01:00
parent f1934a4ff2
commit 840c559490
4 changed files with 35 additions and 68 deletions
-34
View File
@@ -1,34 +0,0 @@
version: "{build}"
os: Windows Server 2012 R2
environment:
GOPATH: c:\gopath
CGO_ENABLED: 0
TIMESCALE_FACTOR: 20
matrix:
- GOARCH: 386
- GOARCH: amd64
clone_folder: c:\gopath\src\v2ray.com/core/external/github.com\lucas-clemente\quic-go
install:
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.11.windows-amd64.zip
- 7z x go1.11.windows-amd64.zip -y -oC:\ > NUL
- set PATH=%PATH%;%GOPATH%\bin\windows_%GOARCH%;%GOPATH%\bin
- echo %PATH%
- echo %GOPATH%
- go get v2ray.com/core/external/github.com/onsi/ginkgo/ginkgo
- go get v2ray.com/core/external/github.com/onsi/gomega
- go version
- go env
- go get -v -t ./...
build_script:
- ginkgo -r -v -randomizeAllSpecs -randomizeSuites -trace -skipPackage benchmark,integrationtests
- ginkgo -randomizeAllSpecs -randomizeSuites -trace benchmark -- -samples=1
test: off
deploy: off
-18
View File
@@ -1,18 +0,0 @@
coverage:
round: nearest
ignore:
- streams_map_incoming_bidi.go
- streams_map_incoming_uni.go
- streams_map_outgoing_bidi.go
- streams_map_outgoing_uni.go
- h2quic/gzipreader.go
- h2quic/response.go
- internal/ackhandler/packet_linkedlist.go
- internal/utils/byteinterval_linkedlist.go
- internal/utils/packetinterval_linkedlist.go
- internal/utils/linkedlist/linkedlist.go
status:
project:
default:
threshold: 0.5
patch: false
@@ -53,6 +53,7 @@ var ErrOpenerNotYetAvailable = errors.New("CryptoSetup: opener at this encryptio
type cryptoSetup struct {
tlsConf *qtls.Config
conn *qtls.Conn
messageChan chan []byte
@@ -124,7 +125,7 @@ func NewCryptoSetupClient(
currentVersion,
logger,
)
return newCryptoSetup(
cs, clientHelloWritten, err := newCryptoSetup(
initialStream,
handshakeStream,
connID,
@@ -135,6 +136,11 @@ func NewCryptoSetupClient(
logger,
perspective,
)
if err != nil {
return nil, nil, err
}
cs.conn = qtls.Client(nil, cs.tlsConf)
return cs, clientHelloWritten, nil
}
// NewCryptoSetupServer creates a new crypto setup for the server
@@ -167,7 +173,11 @@ func NewCryptoSetupServer(
logger,
perspective,
)
return cs, err
if err != nil {
return nil, err
}
cs.conn = qtls.Server(nil, cs.tlsConf)
return cs, nil
}
func newCryptoSetup(
@@ -180,7 +190,7 @@ func newCryptoSetup(
tlsConf *tls.Config,
logger utils.Logger,
perspective protocol.Perspective,
) (CryptoSetup, <-chan struct{} /* ClientHello written */, error) {
) (*cryptoSetup, <-chan struct{} /* ClientHello written */, error) {
initialSealer, initialOpener, err := NewInitialAEAD(connID, perspective)
if err != nil {
return nil, nil, err
@@ -214,19 +224,12 @@ func newCryptoSetup(
}
func (h *cryptoSetup) RunHandshake() error {
var conn *qtls.Conn
switch h.perspective {
case protocol.PerspectiveClient:
conn = qtls.Client(nil, h.tlsConf)
case protocol.PerspectiveServer:
conn = qtls.Server(nil, h.tlsConf)
}
// Handle errors that might occur when HandleData() is called.
handshakeErrChan := make(chan error, 1)
handshakeComplete := make(chan struct{})
go func() {
defer close(h.handshakeDone)
if err := conn.Handshake(); err != nil {
if err := h.conn.Handshake(); err != nil {
handshakeErrChan <- err
return
}
@@ -327,7 +330,6 @@ func (h *cryptoSetup) handleMessageForServer(msgType messageType) bool {
return false
}
// get the handshake read key
// TODO: check that the initial stream doesn't have any more data
select {
case <-h.receivedReadKey:
case <-h.handshakeErrChan:
@@ -526,6 +528,10 @@ func (h *cryptoSetup) GetOpener(level protocol.EncryptionLevel) (Opener, error)
}
func (h *cryptoSetup) ConnectionState() ConnectionState {
// TODO: return the connection state
return ConnectionState{}
connState := h.conn.ConnectionState()
return ConnectionState{
HandshakeComplete: connState.HandshakeComplete,
ServerName: connState.ServerName,
PeerCertificates: connState.PeerCertificates,
}
}