handshake

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandshakeFamilyName    = "handshake"
	HandshakeFamilyVersion = 1
	HandshakeMCGroupTLSHD  = "tlshd"
)
View Source
const (
	HandshakeAX509Cert = iota + 1
	HandshakeAX509PrivKey
)
View Source
const (
	HandshakeAAcceptSockFD = iota + 1
	HandshakeAAcceptHandlerClass
	HandshakeAAcceptMessageType
	HandshakeAAcceptTimeout
	HandshakeAAcceptAuthMode
	HandshakeAAcceptPeerIdentity
	HandshakeAAcceptCertificate
	HandshakeAAcceptPeerName
)
View Source
const (
	HandshakeADoneStatus = iota + 1
	HandshakeADoneSockFD
	HandshakeADoneRemoteAuth
)
View Source
const (
	HandshakeCmdReady = iota + 1
	HandshakeCmdAccept
	HandshakeCmdDone
)
View Source
const (
	TLSNoCert    = 0
	TLSNoPrivKey = 0
)

Variables

This section is empty.

Functions

func NewNetlinkConn

func NewNetlinkConn() (*genetlink.Conn, *genetlink.Family, error)

NewNetlinkConn opens a new Netlink connection configured for TLS handshakes.

Types

type Handler

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

Handler is a handler for the handshake service.

func NewHandler

func NewHandler(logger *slog.Logger, tlsConfig *tls.Config) *Handler

NewHandler creates a new handshake Handler.

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, msg *genetlink.Message) error

Handle handles a handshake request from the kernel.

type HandshakeAuth

type HandshakeAuth int
const (
	HandshakeAuthUnspec HandshakeAuth = iota
	HandshakeAuthUnauth
	HandshakeAuthPSK
	HandshakeAuthX509
)

type HandshakeHandlerClass

type HandshakeHandlerClass int
const (
	HandshakeHandlerClassNone HandshakeHandlerClass = iota
	HandshakeHandlerClassTLSHD
)

type HandshakeMsgType

type HandshakeMsgType int
const (
	HandshakeMsgTypeUnspec HandshakeMsgType = iota
	HandshakeMsgTypeClientHello
	HandshakeMsgTypeServerHello
)

type HandshakeParams

type HandshakeParams struct {
	PeerName      string
	PeerAddr      net.Addr
	SockFD        int32
	Conn          net.Conn
	HandshakeType HandshakeMsgType
	Timeout       time.Duration
	AuthMode      HandshakeAuth
	X509Cert      keyring.KeySerial
	X509PrivKey   keyring.KeySerial
	PeerIDs       []keyring.KeySerial
	RemotePeerIDs []keyring.KeySerial
}

Jump to

Keyboard shortcuts

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