mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
run gofmt -s
This commit is contained in:
parent
598d023802
commit
86e57706df
9 changed files with 36 additions and 36 deletions
|
@ -205,8 +205,8 @@ var _ = Describe("receivedPacketHandler", func() {
|
|||
Expect(ack.LargestAcked).To(Equal(protocol.PacketNumber(4)))
|
||||
Expect(ack.LowestAcked).To(Equal(protocol.PacketNumber(1)))
|
||||
Expect(ack.AckRanges).To(Equal([]wire.AckRange{
|
||||
wire.AckRange{First: 4, Last: 4},
|
||||
wire.AckRange{First: 1, Last: 1},
|
||||
{First: 4, Last: 4},
|
||||
{First: 1, Last: 1},
|
||||
}))
|
||||
})
|
||||
|
||||
|
@ -222,8 +222,8 @@ var _ = Describe("receivedPacketHandler", func() {
|
|||
Expect(ack.LargestAcked).To(Equal(protocol.PacketNumber(3)))
|
||||
Expect(ack.LowestAcked).To(Equal(protocol.PacketNumber(0)))
|
||||
Expect(ack.AckRanges).To(Equal([]wire.AckRange{
|
||||
wire.AckRange{First: 3, Last: 3},
|
||||
wire.AckRange{First: 0, Last: 1},
|
||||
{First: 3, Last: 3},
|
||||
{First: 0, Last: 1},
|
||||
}))
|
||||
})
|
||||
|
||||
|
|
|
@ -513,9 +513,9 @@ var _ = Describe("SentPacketHandler", func() {
|
|||
Context("determining which ACKs we have received an ACK for", func() {
|
||||
BeforeEach(func() {
|
||||
morePackets := []*Packet{
|
||||
&Packet{PacketNumber: 13, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 80, LargestAcked: 100}, &streamFrame}, Length: 1},
|
||||
&Packet{PacketNumber: 14, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 50, LargestAcked: 200}, &streamFrame}, Length: 1},
|
||||
&Packet{PacketNumber: 15, Frames: []wire.Frame{&streamFrame}, Length: 1},
|
||||
{PacketNumber: 13, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 80, LargestAcked: 100}, &streamFrame}, Length: 1},
|
||||
{PacketNumber: 14, Frames: []wire.Frame{&wire.AckFrame{LowestAcked: 50, LargestAcked: 200}, &streamFrame}, Length: 1},
|
||||
{PacketNumber: 15, Frames: []wire.Frame{&streamFrame}, Length: 1},
|
||||
}
|
||||
for _, packet := range morePackets {
|
||||
err := handler.SentPacket(packet)
|
||||
|
|
|
@ -95,8 +95,8 @@ var _ = Describe("Client Crypto Setup", func() {
|
|||
|
||||
BeforeEach(func() {
|
||||
shloMap = map[Tag][]byte{
|
||||
TagPUBS: []byte{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
|
||||
TagVER: []byte{},
|
||||
TagPUBS: {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f},
|
||||
TagVER: {},
|
||||
}
|
||||
keyDerivation := func(forwardSecure bool, sharedSecret, nonces []byte, connID protocol.ConnectionID, chlo []byte, scfg []byte, cert []byte, divNonce []byte, pers protocol.Perspective) (crypto.AEAD, error) {
|
||||
keyDerivationCalledWith = &keyDerivationValues{
|
||||
|
@ -231,8 +231,8 @@ var _ = Describe("Client Crypto Setup", func() {
|
|||
cs.negotiatedVersions = []protocol.VersionNumber{protocol.VersionWhatever}
|
||||
cs.receivedSecurePacket = true
|
||||
_, err := cs.handleSHLOMessage(map[Tag][]byte{
|
||||
TagPUBS: []byte{0},
|
||||
TagVER: []byte{0, 1},
|
||||
TagPUBS: {0},
|
||||
TagVER: {0, 1},
|
||||
})
|
||||
Expect(err).To(MatchError(qerr.Error(qerr.VersionNegotiationMismatch, "Downgrade attack detected")))
|
||||
})
|
||||
|
|
|
@ -17,7 +17,7 @@ func getDefaultServerConfigClient() map[Tag][]byte {
|
|||
TagAEAD: []byte("AESG"),
|
||||
TagPUBS: append([]byte{0x20, 0x00, 0x00}, bytes.Repeat([]byte{0}, 32)...),
|
||||
TagOBIT: bytes.Repeat([]byte{0}, 8),
|
||||
TagEXPY: []byte{0x0, 0x6c, 0x57, 0x78, 0, 0, 0, 0}, // 2033-12-24
|
||||
TagEXPY: {0x0, 0x6c, 0x57, 0x78, 0, 0, 0, 0}, // 2033-12-24
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,10 +66,10 @@ var _ = Describe("TLS Extension Handler, for the client", func() {
|
|||
BeforeEach(func() {
|
||||
fakeBody = &tlsExtensionBody{data: []byte("foobar foobar")}
|
||||
parameters = map[transportParameterID][]byte{
|
||||
initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66},
|
||||
idleTimeoutParameterID: []byte{0x13, 0x37},
|
||||
initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66},
|
||||
idleTimeoutParameterID: {0x13, 0x37},
|
||||
statelessResetTokenParameterID: bytes.Repeat([]byte{0}, 16),
|
||||
}
|
||||
})
|
||||
|
|
|
@ -77,10 +77,10 @@ var _ = Describe("TLS Extension Handler, for the server", func() {
|
|||
BeforeEach(func() {
|
||||
fakeBody = &tlsExtensionBody{data: []byte("foobar foobar")}
|
||||
parameters = map[transportParameterID][]byte{
|
||||
initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66},
|
||||
idleTimeoutParameterID: []byte{0x13, 0x37},
|
||||
initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66},
|
||||
idleTimeoutParameterID: {0x13, 0x37},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -115,11 +115,11 @@ var _ = Describe("Transport Parameters", func() {
|
|||
|
||||
BeforeEach(func() {
|
||||
parameters = map[transportParameterID][]byte{
|
||||
initialMaxStreamDataParameterID: []byte{0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: []byte{0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: []byte{0x33, 0x44, 0x55, 0x66},
|
||||
initialMaxStreamIDUniParameterID: []byte{0x44, 0x55, 0x66, 0x77},
|
||||
idleTimeoutParameterID: []byte{0x13, 0x37},
|
||||
initialMaxStreamDataParameterID: {0x11, 0x22, 0x33, 0x44},
|
||||
initialMaxDataParameterID: {0x22, 0x33, 0x44, 0x55},
|
||||
initialMaxStreamIDBiDiParameterID: {0x33, 0x44, 0x55, 0x66},
|
||||
initialMaxStreamIDUniParameterID: {0x44, 0x55, 0x66, 0x77},
|
||||
idleTimeoutParameterID: {0x13, 0x37},
|
||||
}
|
||||
})
|
||||
It("reads parameters", func() {
|
||||
|
|
|
@ -83,8 +83,8 @@ var _ = Describe("ACK Frame (for IETF QUIC)", func() {
|
|||
Expect(frame.LowestAcked).To(Equal(protocol.PacketNumber(750)))
|
||||
Expect(frame.HasMissingRanges()).To(BeTrue())
|
||||
Expect(frame.AckRanges).To(Equal([]AckRange{
|
||||
AckRange{Last: 1000, First: 900},
|
||||
AckRange{Last: 800, First: 750},
|
||||
{Last: 1000, First: 900},
|
||||
{Last: 800, First: 750},
|
||||
}))
|
||||
Expect(b.Len()).To(BeZero())
|
||||
})
|
||||
|
@ -106,9 +106,9 @@ var _ = Describe("ACK Frame (for IETF QUIC)", func() {
|
|||
Expect(frame.LowestAcked).To(Equal(protocol.PacketNumber(94)))
|
||||
Expect(frame.HasMissingRanges()).To(BeTrue())
|
||||
Expect(frame.AckRanges).To(Equal([]AckRange{
|
||||
AckRange{Last: 100, First: 100},
|
||||
AckRange{Last: 98, First: 98},
|
||||
AckRange{Last: 95, First: 94},
|
||||
{Last: 100, First: 100},
|
||||
{Last: 98, First: 98},
|
||||
{Last: 95, First: 94},
|
||||
}))
|
||||
Expect(b.Len()).To(BeZero())
|
||||
})
|
||||
|
|
|
@ -56,7 +56,7 @@ var _ = Describe("public reset", func() {
|
|||
|
||||
It("rejects packets missing the nonce", func() {
|
||||
data := map[handshake.Tag][]byte{
|
||||
handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
}
|
||||
handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b)
|
||||
_, err := ParsePublicReset(bytes.NewReader(b.Bytes()))
|
||||
|
@ -65,8 +65,8 @@ var _ = Describe("public reset", func() {
|
|||
|
||||
It("rejects packets with a wrong length nonce", func() {
|
||||
data := map[handshake.Tag][]byte{
|
||||
handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13},
|
||||
handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13},
|
||||
}
|
||||
handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b)
|
||||
_, err := ParsePublicReset(bytes.NewReader(b.Bytes()))
|
||||
|
@ -75,7 +75,7 @@ var _ = Describe("public reset", func() {
|
|||
|
||||
It("accepts packets missing the rejected packet number", func() {
|
||||
data := map[handshake.Tag][]byte{
|
||||
handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
}
|
||||
handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b)
|
||||
pr, err := ParsePublicReset(bytes.NewReader(b.Bytes()))
|
||||
|
@ -85,8 +85,8 @@ var _ = Describe("public reset", func() {
|
|||
|
||||
It("rejects packets with a wrong length rejected packet number", func() {
|
||||
data := map[handshake.Tag][]byte{
|
||||
handshake.TagRSEQ: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13},
|
||||
handshake.TagRNON: []byte{0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
handshake.TagRSEQ: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13},
|
||||
handshake.TagRNON: {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0x13, 0x37},
|
||||
}
|
||||
handshake.HandshakeMessage{Tag: handshake.TagPRST, Data: data}.Write(b)
|
||||
_, err := ParsePublicReset(bytes.NewReader(b.Bytes()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue