masterthesis

package module
v0.0.0-...-514d240 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2018 License: AGPL-3.0 Imports: 24 Imported by: 0

README

A test suite for QUIC

Note: This project has moved to https://github.com/QUIC-Tracker

This work is part of my master thesis for my master's degree in Computer Science at Université catholique de Louvain. It is supervised by Pr. Olivier Bonaventure and Quentin De Coninck.

It is two-fold:

  • It is a test suite that exchanges packets with IETF-QUIC implementations to verify whether an implementation conforms with the IETF specification of QUIC. The test suite is consisting of several test scenarii. Each of them aims at testing a particular feature of the QUIC protocol. The test suite runs daily, and its results are available on https://quic-tracker.info.ucl.ac.be. This is the main focus of my effort.

  • It also contains a tool that collects HTTP Alt-Svc headers sent by web-servers of popular domain names in the hope of discovering IETF-QUIC capable hosts. It lists the versions advertised by the hosts, if any.

Installation

Test suite

The test suite comprises a minimal Go implementation of QUIC which is currently draft-13 and TLS-1.3-draft-28 compatible, as well as several test scenarii built upon this implementation. The test suite outputs its result as JSON files, which contains the result, the decrypted packets exchanged, as well as a pcap file and exporter secrets.

You should have Go 1.9, tcpdump, libpcap libraries and header installed before starting.

go get github.com/mpiraux/master-thesis
cd $GOPATH/src/github.com/mpiraux/pigotls
make

The test suite is run by bin/scenario/scenario_runner.go. For help about its usage see:

go run bin/scenario/scenario_runner.go -h

It takes as first parameter a tab-delimited CSV containing a list of hosts and particular URLs which will generate data when requested.

A second optional parameter exists to specify a particular scenario from the directory scenarii to run exclusively, e.g. stream_opening_reordering.

The results are printed to stdout.

Web application

The web application is a Python Flask application that presents the test results in an human-readable way.

It is known to be working with Python 3.6, but it should be compatible with earlier Python 3 versions. It requires the following packages:

pip3 install flask pyyaml sqlobject

Then

  • Fetch web dependencies using yarn install in quic_tracker/static

  • Add the project root directory to $PYTHONPATH using export PYTHONPATH=$PYTHONPATH:$PWD

  • Start the application with python3 quic_tracker/app.py

  • Output from the scenario runner should be placed into quic_tracker/traces with a name in the format \d*.json

Documentation

Overview

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Maxime Piraux's master's thesis
    Copyright (C) 2017-2018  Maxime Piraux

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
	as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	MinimumInitialLength   = 1252
	MinimumInitialLengthv6 = 1232
	MaxUDPPayloadSize      = 65507
	MaximumVersion         = 0xff00000d
	MinimumVersion         = 0xff00000d
)
View Source
const (
	ERR_STREAM_ID_ERROR    = 0x4
	ERR_PROTOCOL_VIOLATION = 0xA
)
View Source
const (
	PaddingFrameType     FrameType = 0x00
	ResetStreamType                = 0x01
	ConnectionCloseType            = 0x02
	ApplicationCloseType           = 0x03
	MaxDataType                    = 0x04
	MaxStreamDataType              = 0x05
	MaxStreamIdType                = 0x06
	PingType                       = 0x07
	BlockedType                    = 0x08
	StreamBlockedType              = 0x09
	StreamIdBlockedType            = 0x0a
	NewConnectionIdType            = 0x0b
	StopSendingType                = 0x0c
	AckType                        = 0x0d
	PathChallengeType              = 0x0e
	PathResponseType               = 0x0f
	StreamType                     = 0x10
	CryptoType                     = 0x18
	NewTokenType                   = 0x19
	AckECNType                     = 0x20
)
View Source
const (
	InitialMaxStreamData  TransportParametersType = 0x0000
	InitialMaxData                                = 0x0001
	InitialMaxBidiStreams                         = 0x0002
	IdleTimeout                                   = 0x0003
	PreferredAddress                              = 0x0004 // TODO: Handle this parameter
	MaxPacketSize                                 = 0x0005
	StatelessResetToken                           = 0x0006
	AckDelayExponent                              = 0x0007
	InitialMaxUniStreams                          = 0x0008
	DisableMigration                              = 0x0009 // TODO: Handle this parameter
)

Variables

View Source
var PNSpaceToString = map[PNSpace]string{
	PNSpaceInitial:   "Initial",
	PNSpaceHandshake: "Handshake",
	PNSpaceAppData:   "Application data",
}

Functions

func DecodePacketNumber

func DecodePacketNumber(buffer *bytes.Reader) uint32

func EncodePacketNumber

func EncodePacketNumber(packetNumber uint32) []byte

func EstablishUDPConnection

func EstablishUDPConnection(addr *net.UDPAddr) (*net.UDPConn, error)

func GetPacketSample

func GetPacketSample(header Header, packetBytes []byte) ([]byte, int)

func GitCommit

func GitCommit() string

func Max

func Max(a, b int) int

func NewbyteIntervalList

func NewbyteIntervalList() *byteIntervalList

NewbyteIntervalList returns an initialized list.

func PacketNumberLen

func PacketNumberLen(packetNumber uint32) int

func StartPcapCapture

func StartPcapCapture(conn *Connection, netInterface string) (*exec.Cmd, error)

func StopPcapCapture

func StopPcapCapture(conn *Connection, cmd *exec.Cmd) ([]byte, error)

func Uint16ToBEBytes

func Uint16ToBEBytes(uint16 uint16) []byte

func Uint32ToBEBytes

func Uint32ToBEBytes(uint32 uint32) []byte

Types

type AckBlock

type AckBlock struct {
	Gap   uint64
	Block uint64
}

type AckECNFrame

type AckECNFrame struct {
	AckFrame
	ECT0Count  uint64
	ECT1Count  uint64
	ECTCECount uint64
}

func ReadAckECNFrame

func ReadAckECNFrame(buffer *bytes.Reader, conn *Connection) *AckECNFrame

func (AckECNFrame) FrameLength

func (frame AckECNFrame) FrameLength() uint16

func (AckECNFrame) FrameType

func (frame AckECNFrame) FrameType() FrameType

type AckFrame

type AckFrame struct {
	LargestAcknowledged uint64
	AckDelay            uint64
	AckBlockCount       uint64
	AckBlocks           []AckBlock
}

func NewAckFrame

func NewAckFrame(largestAcknowledged uint64, ackBlockCount uint64) *AckFrame

func ReadAckFrame

func ReadAckFrame(buffer *bytes.Reader) *AckFrame

func (AckFrame) FrameLength

func (frame AckFrame) FrameLength() uint16

func (AckFrame) FrameType

func (frame AckFrame) FrameType() FrameType

func (AckFrame) GetAckedPackets

func (frame AckFrame) GetAckedPackets() []uint64

type Acknowledger

type Acknowledger interface {
	ShouldBeAcknowledged() bool // Indicates whether or not the packet type should be acknowledged by the mean of sending an ack
}

type ApplicationCloseFrame

type ApplicationCloseFrame struct {
	// contains filtered or unexported fields
}

func NewApplicationCloseFrame

func NewApplicationCloseFrame(buffer *bytes.Reader) *ApplicationCloseFrame

func (ApplicationCloseFrame) FrameLength

func (frame ApplicationCloseFrame) FrameLength() uint16

func (ApplicationCloseFrame) FrameType

func (frame ApplicationCloseFrame) FrameType() FrameType

type BlockedFrame

type BlockedFrame struct {
	// contains filtered or unexported fields
}

func NewBlockedFrame

func NewBlockedFrame(buffer *bytes.Reader) *BlockedFrame

func (BlockedFrame) FrameLength

func (frame BlockedFrame) FrameLength() uint16

func (BlockedFrame) FrameType

func (frame BlockedFrame) FrameType() FrameType

type ClientHelloTransportParameters

type ClientHelloTransportParameters struct {
	InitialVersion uint32
	Parameters     TransportParameterList `tls:"head=2"`
}

type Connection

type Connection struct {
	ServerName    string
	UdpConnection *net.UDPConn
	UseIPv6       bool
	Host          *net.UDPAddr

	Tls          *pigotls.Connection
	TLSTPHandler *TLSTransportParameterHandler

	CryptoStates map[EncryptionLevel]*CryptoState

	ClientRandom   []byte
	ExporterSecret []byte

	ReceivedPacketHandler func([]byte, unsafe.Pointer)
	SentPacketHandler     func([]byte, unsafe.Pointer)

	CryptoStreams CryptoStreams // TODO: It should be a parent class without closing states
	Streams       Streams

	IncomingPackets           broadcast.Broadcaster //type: Packet
	OutgoingPackets           broadcast.Broadcaster //type: Packet
	IncomingPayloads          broadcast.Broadcaster //type: []byte
	UnprocessedPayloads       broadcast.Broadcaster //type: UnprocessedPayload
	EncryptionLevelsAvailable broadcast.Broadcaster //type: DirectionalEncryptionLevel
	FrameQueue                broadcast.Broadcaster //type: QueuedFrame

	OriginalDestinationCID ConnectionID
	SourceCID              ConnectionID
	DestinationCID         ConnectionID
	Version                uint32

	PacketNumber map[PNSpace]uint64

	AckQueue map[PNSpace][]uint64 // Stores the packet numbers to be acked TODO: This should be a channel actually
	Logger   *log.Logger
}

func NewConnection

func NewConnection(serverName string, version uint32, ALPN string, SCID []byte, DCID []byte, udpConn *net.UDPConn, resumptionTicket []byte) *Connection

func NewDefaultConnection

func NewDefaultConnection(address string, serverName string, resumptionTicket []byte, useIPv6 bool) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) CloseConnection

func (c *Connection) CloseConnection(quicLayer bool, errCode uint16, reasonPhrase string)

func (*Connection) ConnectedIp

func (c *Connection) ConnectedIp() net.Addr

func (*Connection) GetAckFrame

func (c *Connection) GetAckFrame(space PNSpace) *AckFrame

func (*Connection) GetInitialPacket

func (c *Connection) GetInitialPacket() *InitialPacket

func (*Connection) ProcessVersionNegotation

func (c *Connection) ProcessVersionNegotation(vn *VersionNegotationPacket) error

func (*Connection) SendHTTPGETRequest

func (c *Connection) SendHTTPGETRequest(path string, streamID uint64)

func (*Connection) SendPacket

func (c *Connection) SendPacket(packet Packet, level EncryptionLevel)

func (*Connection) TransitionTo

func (c *Connection) TransitionTo(version uint32, ALPN string, resumptionTicket []byte)

type ConnectionCloseFrame

type ConnectionCloseFrame struct {
	ErrorCode          uint16
	ErrorFrameType     uint64
	ReasonPhraseLength uint64
	ReasonPhrase       string
}

func NewConnectionCloseFrame

func NewConnectionCloseFrame(buffer *bytes.Reader) *ConnectionCloseFrame

func (ConnectionCloseFrame) FrameLength

func (frame ConnectionCloseFrame) FrameLength() uint16

func (ConnectionCloseFrame) FrameType

func (frame ConnectionCloseFrame) FrameType() FrameType

type ConnectionID

type ConnectionID []byte

func (ConnectionID) CIDL

func (c ConnectionID) CIDL() uint8

type CryptoFrame

type CryptoFrame struct {
	Offset     uint64
	Length     uint64
	CryptoData []byte
}

func NewCryptoFrame

func NewCryptoFrame(cryptoStream *Stream, data []byte) *CryptoFrame

func ReadCryptoFrame

func ReadCryptoFrame(buffer *bytes.Reader, conn *Connection) *CryptoFrame

func (CryptoFrame) FrameLength

func (frame CryptoFrame) FrameLength() uint16

func (CryptoFrame) FrameType

func (frame CryptoFrame) FrameType() FrameType

type CryptoState

type CryptoState struct {
	Read        cipher.AEAD
	Write       cipher.AEAD
	PacketRead  *pigotls.Cipher
	PacketWrite *pigotls.Cipher
}

func NewInitialPacketProtection

func NewInitialPacketProtection(conn *Connection) *CryptoState

func NewProtectedCryptoState

func NewProtectedCryptoState(tls *pigotls.Connection, readSecret []byte, writeSecret []byte) *CryptoState

func (*CryptoState) InitRead

func (s *CryptoState) InitRead(tls *pigotls.Connection, readSecret []byte)

func (*CryptoState) InitWrite

func (s *CryptoState) InitWrite(tls *pigotls.Connection, writeSecret []byte)

type CryptoStreams

type CryptoStreams map[PNSpace]*Stream

func (CryptoStreams) Get

func (s CryptoStreams) Get(space PNSpace) *Stream

type Direction

type Direction string
const ToClient Direction = "to_client"
const ToServer Direction = "to_server"

type DirectionalEncryptionLevel

type DirectionalEncryptionLevel struct {
	EncryptionLevel
	Read bool
}

type EncryptedExtensionsTransportParameters

type EncryptedExtensionsTransportParameters struct {
	NegotiatedVersion uint32
	SupportedVersions []SupportedVersion     `tls:"head=1"`
	Parameters        TransportParameterList `tls:"head=2"`
}

type EncryptionLevel

type EncryptionLevel int
const (
	EncryptionLevelNone EncryptionLevel = iota
	EncryptionLevelInitial
	EncryptionLevel0RTT
	EncryptionLevelHandshake
	EncryptionLevel1RTT
	EncryptionLevelBest // A special flag to indicate that the best encryption level available should be used
)

func (EncryptionLevel) String

func (eL EncryptionLevel) String() string

type Frame

type Frame interface {
	FrameType() FrameType

	FrameLength() uint16
	// contains filtered or unexported methods
}

func NewFrame

func NewFrame(buffer *bytes.Reader, conn *Connection) (Frame, error)

type FramePacket

type FramePacket struct {
	Frames []Frame
	// contains filtered or unexported fields
}

func (*FramePacket) AddFrame

func (p *FramePacket) AddFrame(frame Frame)

func (*FramePacket) Contains

func (p *FramePacket) Contains(frameType FrameType) bool

func (FramePacket) Encode

func (p FramePacket) Encode(payload []byte) []byte

func (FramePacket) EncodeHeader

func (p FramePacket) EncodeHeader() []byte

func (*FramePacket) EncodePayload

func (p *FramePacket) EncodePayload() []byte

func (*FramePacket) GetAll

func (p *FramePacket) GetAll(frameType FrameType) []Frame

func (*FramePacket) GetFirst

func (p *FramePacket) GetFirst(frameType FrameType) Frame

func (*FramePacket) GetFrames

func (p *FramePacket) GetFrames() []Frame

func (*FramePacket) GetRetransmittableFrames

func (p *FramePacket) GetRetransmittableFrames() []Frame

func (FramePacket) Header

func (p FramePacket) Header() Header

func (*FramePacket) Pointer

func (p *FramePacket) Pointer() unsafe.Pointer

func (FramePacket) ShortString

func (p FramePacket) ShortString() string

func (*FramePacket) ShouldBeAcknowledged

func (p *FramePacket) ShouldBeAcknowledged() bool

type FrameType

type FrameType uint64

type Framer

type Framer interface {
	Packet
	GetFrames() []Frame
	AddFrame(frame Frame)
	GetRetransmittableFrames() []Frame
	Contains(frameType FrameType) bool
	GetFirst(frameType FrameType) Frame
	GetAll(frameType FrameType) []Frame
}

type HandshakePacket

type HandshakePacket struct {
	FramePacket
}

func NewHandshakePacket

func NewHandshakePacket(conn *Connection) *HandshakePacket

func ReadHandshakePacket

func ReadHandshakePacket(buffer *bytes.Reader, conn *Connection) *HandshakePacket

func (HandshakePacket) Encode

func (p HandshakePacket) Encode(payload []byte) []byte

func (HandshakePacket) EncodeHeader

func (p HandshakePacket) EncodeHeader() []byte

func (*HandshakePacket) EncryptionLevel

func (p *HandshakePacket) EncryptionLevel() EncryptionLevel

func (HandshakePacket) Header

func (p HandshakePacket) Header() Header

func (*HandshakePacket) PNSpace

func (p *HandshakePacket) PNSpace() PNSpace

func (HandshakePacket) ShortString

func (p HandshakePacket) ShortString() string
type Header interface {
	PacketType() PacketType
	DestinationConnectionID() ConnectionID
	PacketNumber() uint32
	EncryptionLevel() EncryptionLevel
	Encode() []byte
	Length() int
}

func ReadHeader

func ReadHeader(buffer *bytes.Reader, conn *Connection) Header

type InitialPacket

type InitialPacket struct {
	FramePacket
}

func NewInitialPacket

func NewInitialPacket(conn *Connection) *InitialPacket

func ReadInitialPacket

func ReadInitialPacket(buffer *bytes.Reader, conn *Connection) *InitialPacket

func (InitialPacket) Encode

func (p InitialPacket) Encode(payload []byte) []byte

func (InitialPacket) EncodeHeader

func (p InitialPacket) EncodeHeader() []byte

func (*InitialPacket) EncryptionLevel

func (p *InitialPacket) EncryptionLevel() EncryptionLevel

func (*InitialPacket) GetRetransmittableFrames

func (p *InitialPacket) GetRetransmittableFrames() []Frame

func (InitialPacket) Header

func (p InitialPacket) Header() Header

func (*InitialPacket) PNSpace

func (p *InitialPacket) PNSpace() PNSpace

func (InitialPacket) ShortString

func (p InitialPacket) ShortString() string

type KeyPhaseBit

type KeyPhaseBit bool
const KeyPhaseOne KeyPhaseBit = true
const KeyPhaseZero KeyPhaseBit = false

type LongHeader

type LongHeader struct {
	Version        uint32
	DestinationCID ConnectionID
	SourceCID      ConnectionID
	PayloadLength  uint64
	Token          []byte

	LengthBeforePN int
	// contains filtered or unexported fields
}

func NewLongHeader

func NewLongHeader(packetType PacketType, conn *Connection, space PNSpace) *LongHeader

func ReadLongHeader

func ReadLongHeader(buffer *bytes.Reader) *LongHeader

func (*LongHeader) DestinationConnectionID

func (h *LongHeader) DestinationConnectionID() ConnectionID

func (*LongHeader) Encode

func (h *LongHeader) Encode() []byte

func (*LongHeader) EncryptionLevel

func (h *LongHeader) EncryptionLevel() EncryptionLevel

func (*LongHeader) Length

func (h *LongHeader) Length() int

func (*LongHeader) PacketNumber

func (h *LongHeader) PacketNumber() uint32

func (*LongHeader) PacketType

func (h *LongHeader) PacketType() PacketType

type MaxDataFrame

type MaxDataFrame struct {
	MaximumData uint64
}

func NewMaxDataFrame

func NewMaxDataFrame(buffer *bytes.Reader) *MaxDataFrame

func (MaxDataFrame) FrameLength

func (frame MaxDataFrame) FrameLength() uint16

func (MaxDataFrame) FrameType

func (frame MaxDataFrame) FrameType() FrameType

type MaxStreamDataFrame

type MaxStreamDataFrame struct {
	StreamId          uint64
	MaximumStreamData uint64
}

func NewMaxStreamDataFrame

func NewMaxStreamDataFrame(buffer *bytes.Reader) *MaxStreamDataFrame

func (MaxStreamDataFrame) FrameLength

func (frame MaxStreamDataFrame) FrameLength() uint16

func (MaxStreamDataFrame) FrameType

func (frame MaxStreamDataFrame) FrameType() FrameType

type MaxStreamIdFrame

type MaxStreamIdFrame struct {
	// contains filtered or unexported fields
}

func NewMaxStreamIdFrame

func NewMaxStreamIdFrame(buffer *bytes.Reader) *MaxStreamIdFrame

func (MaxStreamIdFrame) FrameLength

func (frame MaxStreamIdFrame) FrameLength() uint16

func (MaxStreamIdFrame) FrameType

func (frame MaxStreamIdFrame) FrameType() FrameType

type NewConnectionIdFrame

type NewConnectionIdFrame struct {
	Sequence            uint64
	Length              uint8
	ConnectionId        []byte
	StatelessResetToken [16]byte
}

func NewNewConnectionIdFrame

func NewNewConnectionIdFrame(buffer *bytes.Reader) *NewConnectionIdFrame

func (NewConnectionIdFrame) FrameLength

func (frame NewConnectionIdFrame) FrameLength() uint16

func (NewConnectionIdFrame) FrameType

func (frame NewConnectionIdFrame) FrameType() FrameType

type NewTokenFrame

type NewTokenFrame struct {
	Token []byte
}

func ReadNewTokenFrame

func ReadNewTokenFrame(buffer *bytes.Reader, conn *Connection) *NewTokenFrame

func (NewTokenFrame) FrameLength

func (frame NewTokenFrame) FrameLength() uint16

func (NewTokenFrame) FrameType

func (frame NewTokenFrame) FrameType() FrameType

type PNSpace

type PNSpace int
const (
	PNSpaceInitial PNSpace = iota
	PNSpaceHandshake
	PNSpaceAppData
	PNSpaceNoSpace
)

func (PNSpace) Epoch

func (pns PNSpace) Epoch() pigotls.Epoch

func (PNSpace) String

func (pns PNSpace) String() string

type Packet

type Packet interface {
	Header() Header
	Acknowledger
	PacketEncoder
	Pointer() unsafe.Pointer
	PNSpace() PNSpace
	EncryptionLevel() EncryptionLevel
	ShortString() string
}

type PacketEncoder

type PacketEncoder interface {
	EncodeHeader() []byte
	EncodePayload() []byte
	Encode([]byte) []byte
}

type PacketNumberQueue

type PacketNumberQueue []uint64

func (PacketNumberQueue) Len

func (a PacketNumberQueue) Len() int

func (PacketNumberQueue) Less

func (a PacketNumberQueue) Less(i, j int) bool

func (PacketNumberQueue) Swap

func (a PacketNumberQueue) Swap(i, j int)

type PacketType

type PacketType uint8
const (
	Initial          PacketType = 0x7f
	Retry            PacketType = 0x7e
	Handshake        PacketType = 0x7d
	ZeroRTTProtected PacketType = 0x7c

	ShortHeaderPacket PacketType = 0 // TODO: Find a way around this
)

func (PacketType) String

func (t PacketType) String() string

type PaddingFrame

type PaddingFrame byte

func NewPaddingFrame

func NewPaddingFrame(buffer *bytes.Reader) *PaddingFrame

func (PaddingFrame) FrameLength

func (frame PaddingFrame) FrameLength() uint16

func (PaddingFrame) FrameType

func (frame PaddingFrame) FrameType() FrameType

type PathChallenge

type PathChallenge struct {
	Data [8]byte
}

func ReadPathChallenge

func ReadPathChallenge(buffer *bytes.Reader) *PathChallenge

func (PathChallenge) FrameLength

func (frame PathChallenge) FrameLength() uint16

func (PathChallenge) FrameType

func (frame PathChallenge) FrameType() FrameType

type PathResponse

type PathResponse struct {
	Data [8]byte
}

func NewPathResponse

func NewPathResponse(data [8]byte) *PathResponse

func ReadPathResponse

func ReadPathResponse(buffer *bytes.Reader) *PathResponse

func (PathResponse) FrameLength

func (frame PathResponse) FrameLength() uint16

func (PathResponse) FrameType

func (frame PathResponse) FrameType() FrameType

type PingFrame

type PingFrame byte

func NewPingFrame

func NewPingFrame(buffer *bytes.Reader) *PingFrame

func (PingFrame) FrameLength

func (frame PingFrame) FrameLength() uint16

func (PingFrame) FrameType

func (frame PingFrame) FrameType() FrameType

type ProtectedPacket

type ProtectedPacket struct {
	FramePacket
}

func NewProtectedPacket

func NewProtectedPacket(conn *Connection) *ProtectedPacket

func ReadProtectedPacket

func ReadProtectedPacket(buffer *bytes.Reader, conn *Connection) *ProtectedPacket

func (ProtectedPacket) Encode

func (p ProtectedPacket) Encode(payload []byte) []byte

func (ProtectedPacket) EncodeHeader

func (p ProtectedPacket) EncodeHeader() []byte

func (*ProtectedPacket) EncryptionLevel

func (p *ProtectedPacket) EncryptionLevel() EncryptionLevel

func (ProtectedPacket) Header

func (p ProtectedPacket) Header() Header

func (*ProtectedPacket) PNSpace

func (p *ProtectedPacket) PNSpace() PNSpace

func (ProtectedPacket) ShortString

func (p ProtectedPacket) ShortString() string

type QueuedFrame

type QueuedFrame struct {
	Frame
	EncryptionLevel
}

type QuicTransportParameters

type QuicTransportParameters struct {
	MaxStreamData        uint32
	MaxData              uint32
	MaxBidiStreams       uint16
	MaxUniStreams        uint16
	IdleTimeout          uint16
	PreferredAddress     string
	MaxPacketSize        uint16
	StatelessResetToken  []byte
	AckDelayExponent     uint8
	DisableMigration     bool
	AdditionalParameters TransportParameterList
	ToJSON               map[string]interface{}
}

type ResetStream

type ResetStream struct {
	StreamId    uint64
	ErrorCode   uint16
	FinalOffset uint64
}

func NewResetStream

func NewResetStream(buffer *bytes.Reader) *ResetStream

func (ResetStream) FrameLength

func (frame ResetStream) FrameLength() uint16

func (ResetStream) FrameType

func (frame ResetStream) FrameType() FrameType

type RetryPacket

type RetryPacket struct {
	OriginalDestinationCID ConnectionID
	RetryToken             []byte
	// contains filtered or unexported fields
}

func ReadRetryPacket

func ReadRetryPacket(buffer *bytes.Reader) *RetryPacket

func (RetryPacket) Encode

func (p RetryPacket) Encode(payload []byte) []byte

func (RetryPacket) EncodeHeader

func (p RetryPacket) EncodeHeader() []byte

func (*RetryPacket) EncodePayload

func (p *RetryPacket) EncodePayload() []byte

func (*RetryPacket) EncryptionLevel

func (p *RetryPacket) EncryptionLevel() EncryptionLevel

func (*RetryPacket) GetRetransmittableFrames

func (p *RetryPacket) GetRetransmittableFrames() []Frame

func (RetryPacket) Header

func (p RetryPacket) Header() Header

func (*RetryPacket) PNSpace

func (p *RetryPacket) PNSpace() PNSpace

func (*RetryPacket) Pointer

func (p *RetryPacket) Pointer() unsafe.Pointer

func (RetryPacket) ShortString

func (p RetryPacket) ShortString() string

func (*RetryPacket) ShouldBeAcknowledged

func (p *RetryPacket) ShouldBeAcknowledged() bool

type ShortHeader

type ShortHeader struct {
	KeyPhase       KeyPhaseBit
	DestinationCID ConnectionID
	// contains filtered or unexported fields
}

func NewShortHeader

func NewShortHeader(keyPhase KeyPhaseBit, conn *Connection) *ShortHeader

func ReadShortHeader

func ReadShortHeader(buffer *bytes.Reader, conn *Connection) *ShortHeader

func (*ShortHeader) DestinationConnectionID

func (h *ShortHeader) DestinationConnectionID() ConnectionID

func (*ShortHeader) Encode

func (h *ShortHeader) Encode() []byte

func (*ShortHeader) EncryptionLevel

func (h *ShortHeader) EncryptionLevel() EncryptionLevel

func (*ShortHeader) Length

func (h *ShortHeader) Length() int

func (*ShortHeader) PacketNumber

func (h *ShortHeader) PacketNumber() uint32

func (*ShortHeader) PacketType

func (h *ShortHeader) PacketType() PacketType

type StopSendingFrame

type StopSendingFrame struct {
	StreamId  uint64
	ErrorCode uint16
}

func NewStopSendingFrame

func NewStopSendingFrame(buffer *bytes.Reader) *StopSendingFrame

func (StopSendingFrame) FrameLength

func (frame StopSendingFrame) FrameLength() uint16

func (StopSendingFrame) FrameType

func (frame StopSendingFrame) FrameType() FrameType

type Stream

type Stream struct {
	ReadOffset  uint64
	WriteOffset uint64

	ReadData  []byte
	WriteData []byte

	ReadChan        broadcast.Broadcaster
	MaxReadReceived uint64

	ReadClosed      bool
	ReadCloseOffset uint64

	WriteClosed      bool
	WriteCloseOffset uint64
	// contains filtered or unexported fields
}

func NewStream

func NewStream() *Stream

type StreamBlockedFrame

type StreamBlockedFrame struct {
	// contains filtered or unexported fields
}

func NewStreamBlockedFrame

func NewStreamBlockedFrame(buffer *bytes.Reader) *StreamBlockedFrame

func (StreamBlockedFrame) FrameLength

func (frame StreamBlockedFrame) FrameLength() uint16

func (StreamBlockedFrame) FrameType

func (frame StreamBlockedFrame) FrameType() FrameType

type StreamFrame

type StreamFrame struct {
	FinBit bool
	LenBit bool
	OffBit bool

	StreamId   uint64
	Offset     uint64
	Length     uint64
	StreamData []byte
}

func NewStreamFrame

func NewStreamFrame(streamId uint64, stream *Stream, data []byte, finBit bool) *StreamFrame

func ReadStreamFrame

func ReadStreamFrame(buffer *bytes.Reader, conn *Connection) *StreamFrame

func (StreamFrame) FrameLength

func (frame StreamFrame) FrameLength() uint16

func (StreamFrame) FrameType

func (frame StreamFrame) FrameType() FrameType

type StreamIdBlockedFrame

type StreamIdBlockedFrame struct {
	// contains filtered or unexported fields
}

func NewStreamIdNeededFrame

func NewStreamIdNeededFrame(buffer *bytes.Reader) *StreamIdBlockedFrame

func (StreamIdBlockedFrame) FrameLength

func (frame StreamIdBlockedFrame) FrameLength() uint16

func (StreamIdBlockedFrame) FrameType

func (frame StreamIdBlockedFrame) FrameType() FrameType

type Streams

type Streams map[uint64]*Stream

func (Streams) Get

func (s Streams) Get(streamId uint64) *Stream

type SupportedVersion

type SupportedVersion uint32

type TLSTransportParameterHandler

type TLSTransportParameterHandler struct {
	NegotiatedVersion uint32
	InitialVersion    uint32
	QuicTransportParameters
	*EncryptedExtensionsTransportParameters
	ReceivedParameters *QuicTransportParameters
}

func NewTLSTransportParameterHandler

func NewTLSTransportParameterHandler(negotiatedVersion uint32, initialVersion uint32) *TLSTransportParameterHandler

func (*TLSTransportParameterHandler) GetExtensionData

func (h *TLSTransportParameterHandler) GetExtensionData() ([]byte, error)

func (*TLSTransportParameterHandler) ReceiveExtensionData

func (h *TLSTransportParameterHandler) ReceiveExtensionData(data []byte) error

type Trace

type Trace struct {
	Commit              string                 `json:"commit"`
	Scenario            string                 `json:"scenario"`
	ScenarioVersion     int                    `json:"scenario_version"`
	Host                string                 `json:"host"`
	Ip                  string                 `json:"ip"`
	Results             map[string]interface{} `json:"results"`
	StartedAt           int64                  `json:"started_at"`
	Duration            uint64                 `json:"duration"`
	ErrorCode           uint8                  `json:"error_code"`
	Stream              []TracePacket          `json:"stream"`
	Pcap                []byte                 `json:"pcap"`
	DecryptedPcap       []byte                 `json:"decrypted_pcap"`
	ClientRandom        []byte                 `json:"client_random"`
	ExporterSecret      []byte                 `json:"exporter_secret"`
	EarlyExporterSecret []byte                 `json:"early_exporter_secret"`
}

func NewTrace

func NewTrace(scenarioName string, scenarioVersion int, host string) *Trace

func (*Trace) AddPcap

func (t *Trace) AddPcap(conn *Connection, cmd *exec.Cmd) error

func (*Trace) AttachTo

func (t *Trace) AttachTo(conn *Connection)

func (*Trace) Complete

func (t *Trace) Complete(conn *Connection)

func (*Trace) MarkError

func (t *Trace) MarkError(error uint8, message string, packet Packet)

type TracePacket

type TracePacket struct {
	Direction    Direction      `json:"direction"`
	Timestamp    int64          `json:"timestamp"`
	Data         []byte         `json:"data"`
	IsOfInterest bool           `json:"is_of_interest"`
	Pointer      unsafe.Pointer `json:"-"`
}

type TransportParameter

type TransportParameter struct {
	ParameterType TransportParametersType
	Value         []byte `tls:"head=2"`
}

type TransportParameterList

type TransportParameterList []TransportParameter

func (*TransportParameterList) AddParameter

func (list *TransportParameterList) AddParameter(p TransportParameter)

func (*TransportParameterList) GetParameter

func (list *TransportParameterList) GetParameter(id TransportParametersType) []byte

type TransportParametersType

type TransportParametersType uint16

type UnprocessedPayload

type UnprocessedPayload struct {
	EncryptionLevel
	Payload []byte
}

type VersionNegotationPacket

type VersionNegotationPacket struct {
	UnusedField       uint8
	Version           uint32
	DestinationCID    ConnectionID
	SourceCID         ConnectionID
	SupportedVersions []SupportedVersion
	// contains filtered or unexported fields
}

func NewVersionNegotationPacket

func NewVersionNegotationPacket(unusedField uint8, version uint32, versions []SupportedVersion, conn *Connection) *VersionNegotationPacket

func ReadVersionNegotationPacket

func ReadVersionNegotationPacket(buffer *bytes.Reader) *VersionNegotationPacket

func (VersionNegotationPacket) Encode

func (p VersionNegotationPacket) Encode(payload []byte) []byte

func (VersionNegotationPacket) EncodeHeader

func (p VersionNegotationPacket) EncodeHeader() []byte

func (*VersionNegotationPacket) EncodePayload

func (p *VersionNegotationPacket) EncodePayload() []byte

func (*VersionNegotationPacket) EncryptionLevel

func (p *VersionNegotationPacket) EncryptionLevel() EncryptionLevel

func (VersionNegotationPacket) Header

func (p VersionNegotationPacket) Header() Header

func (*VersionNegotationPacket) PNSpace

func (p *VersionNegotationPacket) PNSpace() PNSpace

func (*VersionNegotationPacket) Pointer

func (p *VersionNegotationPacket) Pointer() unsafe.Pointer

func (VersionNegotationPacket) ShortString

func (p VersionNegotationPacket) ShortString() string

func (*VersionNegotationPacket) ShouldBeAcknowledged

func (p *VersionNegotationPacket) ShouldBeAcknowledged() bool

type ZeroRTTProtectedPacket

type ZeroRTTProtectedPacket struct {
	FramePacket
}

func NewZeroRTTProtectedPacket

func NewZeroRTTProtectedPacket(conn *Connection) *ZeroRTTProtectedPacket

func (ZeroRTTProtectedPacket) Encode

func (p ZeroRTTProtectedPacket) Encode(payload []byte) []byte

func (ZeroRTTProtectedPacket) EncodeHeader

func (p ZeroRTTProtectedPacket) EncodeHeader() []byte

func (*ZeroRTTProtectedPacket) EncryptionLevel

func (p *ZeroRTTProtectedPacket) EncryptionLevel() EncryptionLevel

func (ZeroRTTProtectedPacket) Header

func (p ZeroRTTProtectedPacket) Header() Header

func (*ZeroRTTProtectedPacket) PNSpace

func (p *ZeroRTTProtectedPacket) PNSpace() PNSpace

func (ZeroRTTProtectedPacket) ShortString

func (p ZeroRTTProtectedPacket) ShortString() string

Directories

Path Synopsis
bin
http
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
test_suite
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
Maxime Piraux's master's thesis Copyright (C) 2017-2018 Maxime Piraux This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL