tlssession

package
v0.0.0-...-919fc2c Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package tlssession performs a TLS handshake over the control channel, and then it exchanges keys with the server over this secure channel.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadTLSInit is returned when TLS configuration cannot be initialized
	ErrBadTLSInit = errors.New("TLS init error")

	// ErrBadTLSHandshake is returned when the OpenVPN handshake failed.
	ErrBadTLSHandshake = errors.New("handshake failure")

	// ErrBadCA is returned when the CA file cannot be found or is not valid.
	ErrBadCA = errors.New("bad ca conf")

	// ErrBadKeypair is returned when the key or cert file cannot be found or is not valid.
	ErrBadKeypair = errors.New("bad keypair conf")

	// ErrBadParrot is returned for errors during TLS parroting
	ErrBadParrot = errors.New("cannot parrot")

	// ErrCannotVerifyCertChain is returned for certificate chain validation errors.
	ErrCannotVerifyCertChain = errors.New("cannot verify chain")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// NotifyTLS is a channel where we receive incoming notifications.
	NotifyTLS chan *model.Notification

	// KeyUP is used to send newly negotiated data channel keys ready to be
	// used.
	KeyUp *chan *session.DataChannelKey

	// TLSRecordUp is data coming up from the control channel layer to us.
	// TODO(ainghazal): considere renaming when we have merged the whole
	// set of components. This name might not give a good idea of what the bytes being
	// moved around are - this is a serialized control channel packet, which is
	// mainly used to do the initial handshake and then receive control
	// packets encrypted with this TLS session.
	TLSRecordUp chan []byte

	// TLSRecordDown is data being transferred down from us to the control
	// channel.
	TLSRecordDown *chan []byte
}

Service is the tlssession service. Make sure you initialize the channels before invoking Service.StartWorkers.

func (*Service) StartWorkers

func (svc *Service) StartWorkers(
	config *config.Config,
	workersManager *workers.Manager,
	sessionManager *session.Manager,
)

StartWorkers starts the tlssession workers. See the ARCHITECTURE file for more information about the packet-muxer workers.

Jump to

Keyboard shortcuts

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