mse

package
v1.64.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MPL-2.0 Imports: 15 Imported by: 230 modules, 226 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSecretKeyMatch = errors.New("no skey matched")

Functions

This section is empty.

Types

type CryptoMethod

type CryptoMethod uint32
const (
	CryptoMethodPlaintext CryptoMethod = 1 // After header obfuscation, drop into plaintext
	CryptoMethodRC4       CryptoMethod = 2 // After header obfuscation, use RC4 for the rest of the stream
	AllSupportedCrypto                 = CryptoMethodPlaintext | CryptoMethodRC4
)

func DefaultCryptoSelector

func DefaultCryptoSelector(provided CryptoMethod) CryptoMethod

func InitiateHandshake

func InitiateHandshake(
	rw io.ReadWriter,
	skey, initialPayload []byte,
	cryptoProvides CryptoMethod,
) (
	ret io.ReadWriter, method CryptoMethod, err error,
)

func InitiateHandshakeContext added in v1.57.0

func InitiateHandshakeContext(
	ctx context.Context,
	rw io.ReadWriter,
	skey, initialPayload []byte,
	cryptoProvides CryptoMethod,
) (
	ret io.ReadWriter, method CryptoMethod, err error,
)

func ReceiveHandshake

func ReceiveHandshake(
	ctx context.Context,
	rw io.ReadWriter,
	skeys SecretKeyIter,
	selectCrypto CryptoSelector,
) (io.ReadWriter, CryptoMethod, error)

type CryptoSelector

type CryptoSelector func(CryptoMethod) CryptoMethod

type HandshakeResult added in v1.20.0

type HandshakeResult struct {
	io.ReadWriter
	CryptoMethod

	SecretKey []byte
	// contains filtered or unexported fields
}

func ReceiveHandshakeEx added in v1.20.0

func ReceiveHandshakeEx(
	ctx context.Context,
	rw io.ReadWriter,
	skeys SecretKeyIter,
	selectCrypto CryptoSelector,
) (ret HandshakeResult)

type SecretKeyIter

type SecretKeyIter func(callback func(skey []byte) (more bool))

A function that given a function, calls it with secret keys until it returns false or exhausted.

Directories

Path Synopsis
cmd
mse command

Jump to

Keyboard shortcuts

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