forked from quic-go/quic-go
Merge pull request #510 from lucas-clemente/remove-unused
Remove several unused fields and symbols
This commit is contained in:
@@ -30,8 +30,6 @@ type client struct {
|
||||
session packetHandler
|
||||
}
|
||||
|
||||
var errHostname = errors.New("Invalid hostname")
|
||||
|
||||
var (
|
||||
errCloseSessionForNewVersion = errors.New("closing session in order to recreate it with a new version")
|
||||
)
|
||||
|
||||
@@ -12,12 +12,8 @@ type Bandwidth uint64
|
||||
const (
|
||||
// BitsPerSecond is 1 bit per second
|
||||
BitsPerSecond Bandwidth = 1
|
||||
// KBitsPerSecond is 1000 bits per second
|
||||
KBitsPerSecond = 1000 * BitsPerSecond
|
||||
// BytesPerSecond is 1 byte per second
|
||||
BytesPerSecond = 8 * BitsPerSecond
|
||||
// KBytesPerSecond is 1000 bytes per second
|
||||
KBytesPerSecond = 1000 * BytesPerSecond
|
||||
)
|
||||
|
||||
// BandwidthFromDelta calculates the bandwidth from a number of bytes and a time delta
|
||||
|
||||
@@ -2,7 +2,6 @@ package handshake
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -55,8 +54,6 @@ type connectionParametersManager struct {
|
||||
|
||||
var _ ConnectionParametersManager = &connectionParametersManager{}
|
||||
|
||||
var errTagNotInConnectionParameterMap = errors.New("ConnectionParametersManager: Tag not found in ConnectionsParameter map")
|
||||
|
||||
// ErrMalformedTag is returned when the tag value cannot be read
|
||||
var (
|
||||
ErrMalformedTag = qerr.Error(qerr.InvalidCryptoMessageParameter, "malformed Tag value")
|
||||
|
||||
@@ -2,14 +2,9 @@ package handshake
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"encoding/binary"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/lucas-clemente/quic-go/crypto"
|
||||
@@ -20,27 +15,6 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
// taken from https://golang.org/src/crypto/tls/generate_cert.go
|
||||
func pemBlockForKey(priv interface{}) *pem.Block {
|
||||
switch k := priv.(type) {
|
||||
case *rsa.PrivateKey:
|
||||
return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)}
|
||||
case *ecdsa.PrivateKey:
|
||||
b, err := x509.MarshalECPrivateKey(k)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Unable to marshal ECDSA private key: %v", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func pemBlockForCert(certDER []byte) *pem.Block {
|
||||
return &pem.Block{Type: "CERTIFICATE", Bytes: certDER}
|
||||
}
|
||||
|
||||
type keyDerivationValues struct {
|
||||
forwardSecure bool
|
||||
sharedSecret []byte
|
||||
|
||||
@@ -81,8 +81,6 @@ func (m *mockAEAD) Open(dst, src []byte, packetNumber protocol.PacketNumber, ass
|
||||
return nil, errors.New("authentication failed")
|
||||
}
|
||||
|
||||
func (mockAEAD) DiversificationNonce() []byte { return nil }
|
||||
|
||||
var expectedInitialNonceLen int
|
||||
var expectedFSNonceLen int
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@ func (m *mockCryptoSetup) GetSealerWithEncryptionLevel(protocol.EncryptionLevel)
|
||||
return append(src, bytes.Repeat([]byte{0}, 12)...)
|
||||
}, nil
|
||||
}
|
||||
func (m *mockCryptoSetup) LockForSealing() {}
|
||||
func (m *mockCryptoSetup) UnlockForSealing() {}
|
||||
func (m *mockCryptoSetup) HandshakeComplete() bool { return m.handshakeComplete }
|
||||
func (m *mockCryptoSetup) DiversificationNonce() []byte {
|
||||
return m.divNonce
|
||||
|
||||
@@ -33,9 +33,6 @@ type ByteCount uint64
|
||||
// MaxByteCount is the maximum value of a ByteCount
|
||||
const MaxByteCount = math.MaxUint64
|
||||
|
||||
// CryptoStreamID is the ID of the crypto stream
|
||||
const CryptoStreamID StreamID = 1
|
||||
|
||||
// MaxReceivePacketSize maximum packet size of any QUIC packet, based on
|
||||
// ethernet's max size, minus the IP and UDP headers. IPv6 has a 40 byte header,
|
||||
// UDP adds an additional 8 bytes. This is a total overhead of 48 bytes.
|
||||
|
||||
@@ -25,8 +25,7 @@ type packetHandler interface {
|
||||
type server struct {
|
||||
config *Config
|
||||
|
||||
conn net.PacketConn
|
||||
connMutex sync.Mutex
|
||||
conn net.PacketConn
|
||||
|
||||
certChain crypto.CertChain
|
||||
scfg *handshake.ServerConfig
|
||||
|
||||
@@ -31,9 +31,7 @@ type streamsMap struct {
|
||||
|
||||
newStream newStreamLambda
|
||||
|
||||
maxOutgoingStreams uint32
|
||||
numOutgoingStreams uint32
|
||||
maxIncomingStreams uint32
|
||||
numIncomingStreams uint32
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user