cookie

package
v0.0.0-...-11a1bd4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CookieStorageSize = 256

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieState

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

func (*CookieState) AppendCookie

func (c *CookieState) AppendCookie(cookie []byte, params Params, addr netip.AddrPort) []byte

func (*CookieState) IsCookieValid

func (c *CookieState) IsCookieValid(addr netip.AddrPort, cookie []byte, now time.Time, cookieValidDuration time.Duration) (_ Params, err error)

func (*CookieState) SetRand

func (c *CookieState) SetRand(rnd dtlsrand.Rand)

type Params

type Params struct {
	// those values are signed, so server can trust them after validation
	TranscriptHash    ciphersuite.Hash
	TimestampUnixNano int64
	KeyShareSet       bool           // we must remember to generate exactly same HRR for transcript
	CipherSuite       ciphersuite.ID // we must remember to generate exactly same HRR for transcript
	Age               time.Duration  // set during validation
}

Jump to

Keyboard shortcuts

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