mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-29 18:19:57 +00:00
TUN-6637: Upgrade go version and quic-go
This commit is contained in:
11
vendor/github.com/marten-seemann/qtls-go1-17/conn.go
generated
vendored
11
vendor/github.com/marten-seemann/qtls-go1-17/conn.go
generated
vendored
@@ -32,6 +32,7 @@ type Conn struct {
|
||||
|
||||
// handshakeStatus is 1 if the connection is currently transferring
|
||||
// application data (i.e. is not currently processing a handshake).
|
||||
// handshakeStatus == 1 implies handshakeErr == nil.
|
||||
// This field is only to be accessed with sync/atomic.
|
||||
handshakeStatus uint32
|
||||
// constant after handshake; protected by handshakeMutex
|
||||
@@ -1451,6 +1452,13 @@ func (c *Conn) HandshakeContext(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (c *Conn) handshakeContext(ctx context.Context) (ret error) {
|
||||
// Fast sync/atomic-based exit if there is no handshake in flight and the
|
||||
// last one succeeded without an error. Avoids the expensive context setup
|
||||
// and mutex for most Read and Write calls.
|
||||
if c.handshakeComplete() {
|
||||
return nil
|
||||
}
|
||||
|
||||
handshakeCtx, cancel := context.WithCancel(ctx)
|
||||
// Note: defer this before starting the "interrupter" goroutine
|
||||
// so that we can tell the difference between the input being canceled and
|
||||
@@ -1509,6 +1517,9 @@ func (c *Conn) handshakeContext(ctx context.Context) (ret error) {
|
||||
if c.handshakeErr == nil && !c.handshakeComplete() {
|
||||
c.handshakeErr = errors.New("tls: internal error: handshake should have had a result")
|
||||
}
|
||||
if c.handshakeErr != nil && c.handshakeComplete() {
|
||||
panic("tls: internal error: handshake returned an error but is marked successful")
|
||||
}
|
||||
|
||||
return c.handshakeErr
|
||||
}
|
||||
|
1
vendor/github.com/marten-seemann/qtls-go1-17/handshake_server_tls13.go
generated
vendored
1
vendor/github.com/marten-seemann/qtls-go1-17/handshake_server_tls13.go
generated
vendored
@@ -777,6 +777,7 @@ func (hs *serverHandshakeStateTLS13) sendSessionTickets() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := c.writeRecord(recordTypeHandshake, m.marshal()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
15
vendor/github.com/marten-seemann/qtls-go1-17/ticket.go
generated
vendored
15
vendor/github.com/marten-seemann/qtls-go1-17/ticket.go
generated
vendored
@@ -11,6 +11,7 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"crypto/subtle"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"io"
|
||||
"time"
|
||||
@@ -232,6 +233,20 @@ func (c *Conn) getSessionTicketMsg(appData []byte) (*newSessionTicketMsgTLS13, e
|
||||
return nil, err
|
||||
}
|
||||
m.lifetime = uint32(maxSessionTicketLifetime / time.Second)
|
||||
|
||||
// ticket_age_add is a random 32-bit value. See RFC 8446, section 4.6.1
|
||||
// The value is not stored anywhere; we never need to check the ticket age
|
||||
// because 0-RTT is not supported.
|
||||
ageAdd := make([]byte, 4)
|
||||
_, err = c.config.rand().Read(ageAdd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m.ageAdd = binary.LittleEndian.Uint32(ageAdd)
|
||||
|
||||
// ticket_nonce, which must be unique per connection, is always left at
|
||||
// zero because we only ever send one ticket per connection.
|
||||
|
||||
if c.extraConfig != nil {
|
||||
m.maxEarlyData = c.extraConfig.MaxEarlyData
|
||||
}
|
||||
|
Reference in New Issue
Block a user