model

package
v1.2.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TLSRecord byte = 0x16

	ClientHelloTLS byte = 0x01
	ServerHelloTLS byte = 0x02
	CertificateTLS byte = 0x0b

	ServerNameExt        uint16 = 0x0000
	SupportedVersionsExt uint16 = 0x002b
	TLSVersionExt        uint16 = 0x002b
)

Variables

This section is empty.

Functions

func GetCipherSuite added in v1.0.1

func GetCipherSuite(cipherSuite uint16) string

func GetTLSVersion

func GetTLSVersion(version uint16) string

Types

type CertificateTLSRecord added in v1.1.0

type CertificateTLSRecord struct {
	HandshakeType            uint8
	CertificateMessageLength [3]byte
	CertificatesLength       [3]byte
	Certificates             []x509.Certificate
}

type CipherSuite

type CipherSuite struct {
	Value uint16
}

type Ciphers

type Ciphers struct {
	Length uint16
	Value  []byte
}

type ClientCiphers added in v1.0.1

type ClientCiphers struct {
	Ciphers []string
}

type ClientHelloTLSRecord

type ClientHelloTLSRecord struct {
	HandshakeProtocol    HandshakeProtocol
	Session              Session
	Ciphers              Ciphers
	CompressionMethods   CompressionMethods
	Extensions           Extensions
	ResolvedClientFields ResolvedClientFields
}

type CompressionMethods

type CompressionMethods struct {
	Length uint8
	Value  []byte
}

type Extension

type Extension struct {
	Type   uint16
	Length uint16
	Value  []byte
}

type Extensions

type Extensions struct {
	Length     uint16
	Extensions map[uint16]Extension
}

type HandshakeProtocol

type HandshakeProtocol struct {
	HandshakeType uint8
	Length        [3]byte
	TLSVersion    uint16
	Random        [32]byte
}

type RecordLayer

type RecordLayer struct {
	HandshakeType uint8
	TLSVersion    uint16
	Length        uint16
}

type ResolvedClientFields added in v1.0.1

type ResolvedClientFields struct {
	ServerName        string
	SupportedVersions []string
	Ciphers           []string
}

type ResolvedServerFields added in v1.0.1

type ResolvedServerFields struct {
	SupportedVersion string
	Cipher           string
}

type ServerHelloTLSRecord

type ServerHelloTLSRecord struct {
	HandshakeProtocol    HandshakeProtocol
	Session              Session
	CipherSuite          CipherSuite
	CompressionMethods   CompressionMethods
	Extensions           Extensions
	ResolvedServerFields ResolvedServerFields
}

type ServerNameExtension

type ServerNameExtension struct {
	ListLength uint16
	Type       uint8
	Length     uint16
	Value      string
}

type Session

type Session struct {
	Length uint8
	Id     []byte
}

type SupportedVersionExtension added in v1.0.1

type SupportedVersionExtension struct {
	Type  uint16
	Value []byte
}

type SupportedVersionsExtension added in v1.0.1

type SupportedVersionsExtension struct {
	SupportedVersionLength uint8
	Value                  []string
}

type TLSWrapper added in v1.1.0

type TLSWrapper struct {
	ClientHelloTLSRecord ClientHelloTLSRecord
	ServerHelloTLSRecord ServerHelloTLSRecord
	CertificateTLSRecord CertificateTLSRecord
}

Jump to

Keyboard shortcuts

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