package alert

import "github.com/pion/dtls/v3/pkg/protocol/alert"

Package alert implements TLS alert protocol https://tools.ietf.org/html/rfc5246#section-7.2

Index

Types

type Alert

type Alert struct {
	Level       Level
	Description Description
}

Alert is one of the content types supported by the TLS record layer. Alert messages convey the severity of the message (warning or fatal) and a description of the alert. Alert messages with a level of fatal result in the immediate termination of the connection. In this case, other connections corresponding to the session may continue, but the session identifier MUST be invalidated, preventing the failed session from being used to establish new connections. Like other messages, alert messages are encrypted and compressed, as specified by the current connection state. https://tools.ietf.org/html/rfc5246#section-7.2

func (Alert) ContentType

func (a Alert) ContentType() protocol.ContentType

ContentType returns the ContentType of this Content

func (*Alert) Marshal

func (a *Alert) Marshal() ([]byte, error)

Marshal returns the encoded alert

func (*Alert) String

func (a *Alert) String() string

func (*Alert) Unmarshal

func (a *Alert) Unmarshal(data []byte) error

Unmarshal populates the alert from binary data

type Description

type Description byte

Description is the extended info of the TLS Alert

const (
	CloseNotify            Description = 0
	UnexpectedMessage      Description = 10
	BadRecordMac           Description = 20
	DecryptionFailed       Description = 21
	RecordOverflow         Description = 22
	DecompressionFailure   Description = 30
	HandshakeFailure       Description = 40
	NoCertificate          Description = 41
	BadCertificate         Description = 42
	UnsupportedCertificate Description = 43
	CertificateRevoked     Description = 44
	CertificateExpired     Description = 45
	CertificateUnknown     Description = 46
	IllegalParameter       Description = 47
	UnknownCA              Description = 48
	AccessDenied           Description = 49
	DecodeError            Description = 50
	DecryptError           Description = 51
	ExportRestriction      Description = 60
	ProtocolVersion        Description = 70
	InsufficientSecurity   Description = 71
	InternalError          Description = 80
	UserCanceled           Description = 90
	NoRenegotiation        Description = 100
	UnsupportedExtension   Description = 110
	NoApplicationProtocol  Description = 120
)

Description enums

func (Description) String

func (d Description) String() string

type Level

type Level byte

Level is the level of the TLS Alert

const (
	Warning Level = 1
	Fatal   Level = 2
)

Level enums

func (Level) String

func (l Level) String() string

Source Files

alert.go

Version
v3.0.4 (latest)
Published
Nov 4, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
1 week ago

Tools for package owners.