dissector

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 6 Imported by: 0

README

tls-dissector

Dissect TLS handshake messages

Documentation

Index

Constants

View Source
const (
	HelloRequest = 0
	ClientHello  = 1
	ServerHello  = 2
)
View Source
const (
	ExtServerName uint16 = 0x0000
)
View Source
const (
	Handshake = 0x16
)
View Source
const (
	RecordHeaderLen = 5
)

Variables

View Source
var (
	ErrBadType = errors.New("bad type")
)

Functions

This section is empty.

Types

type CipherSuite

type CipherSuite uint16

type ClientHelloHandshake

type ClientHelloHandshake struct {
	Version            Version
	Random             Random
	SessionID          []byte
	CipherSuites       []CipherSuite
	CompressionMethods []CompressionMethod
	Extensions         []Extension
}

func (*ClientHelloHandshake) Decode

func (h *ClientHelloHandshake) Decode(data []byte) (err error)

func (*ClientHelloHandshake) Encode

func (h *ClientHelloHandshake) Encode() (data []byte, err error)

func (*ClientHelloHandshake) ReadFrom

func (h *ClientHelloHandshake) ReadFrom(r io.Reader) (n int64, err error)

func (*ClientHelloHandshake) WriteTo

func (h *ClientHelloHandshake) WriteTo(w io.Writer) (n int64, err error)

type CompressionMethod

type CompressionMethod uint8

type Extension

type Extension interface {
	Type() uint16
	Bytes() []byte
}

func NewExtension

func NewExtension(t uint16, data []byte) Extension

func ReadExtension

func ReadExtension(r io.Reader) (ext Extension, err error)

type Random

type Random struct {
	Time   uint32
	Opaque [28]byte
}

type Record

type Record struct {
	Type    uint8
	Version Version
	Opaque  []byte
}

func ReadRecord

func ReadRecord(r io.Reader) (*Record, error)

func (*Record) ReadFrom

func (rec *Record) ReadFrom(r io.Reader) (n int64, err error)

func (*Record) WriteTo

func (rec *Record) WriteTo(w io.Writer) (n int64, err error)

type ServerNameExtension

type ServerNameExtension struct {
	NameType uint8
	Name     string
}

func (*ServerNameExtension) Bytes

func (ext *ServerNameExtension) Bytes() []byte

func (*ServerNameExtension) Type

func (ext *ServerNameExtension) Type() uint16

type Version

type Version uint16

Jump to

Keyboard shortcuts

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