route

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Unlicense Imports: 23 Imported by: 0

Documentation

Overview

Package route provides an onion mesage type that initiates a hidden service connection with a designated introducer who holds the forwarding routing header to send the route message to a hidden service, who replies to the client using their reply routing header with a ready message.

Index

Constants

View Source
const (
	RouteMagic = "rout"
	RouteLen   = magic.Len +
		crypto.CloakLen +
		crypto.PubKeyLen +
		nonce.IVLen +
		nonce.IDLen +
		3*sha256.Len +
		3*nonce.IVLen
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function for a Route.

func New

func New(id nonce.ID, k *crypto.Pub, ks *crypto.KeySet,
	ep *exit.ExitPoint) ont.Onion

New creates a new Route message to send to an introducer relay to establish a connection to a HiddenService.

Types

type Route

type Route struct {

	// HiddenService is the public key of the hidden service.
	HiddenService *crypto.Pub

	// HiddenCloaked is the cloaked key generated to conceal the session identity.
	HiddenCloaked crypto.CloakedPubKey

	// Sender is the ephemeral sender private key for this message.
	Sender *crypto.Prv

	// SenderPub is the key used by the receiver with their session private keys to
	// decrypt the message payload.
	SenderPub *crypto.Pub

	// IV is the initialization vector for the encryption to be used.
	nonce.IV

	// ID is a unique
	// identifier for the Ready message to enable the client to identify quickly
	// which hidden service has become ready.
	ID nonce.ID

	// Ciphers is a set of 3 symmetric ciphers that are to be used in their given
	// order over the reply message from the service.
	Ciphers crypto.Ciphers

	// Nonces are the nonces to use with the cipher when creating the encryption for
	// the reply message, they are common with the crypts in the header.
	crypto.Nonces

	// RoutingHeaderBytes are the three layer routing header that will be used for
	// the reply from the client.
	hidden.RoutingHeaderBytes

	// Onion contains the rest of the message.
	ont.Onion
}

Route is a message to establish a connection to a HiddenService.

func (*Route) Account

func (x *Route) Account(res *sess.Data, sm *sess.Manager,
	s *sessions.Data, last bool) (skip bool, sd *sessions.Data)

Account for the Route message. Basically standard relay fee for the Introducer.

func (*Route) Decode

func (x *Route) Decode(s *splice.Splice) (e error)

Decode a Route from a provided splice.Splice.

func (*Route) Decrypt

func (x *Route) Decrypt(prk *crypto.Prv, s *splice.Splice)

Decrypt decrypts the rest of a message after the Route segment if the recipient has the hidden service private key.

func (*Route) Encode

func (x *Route) Encode(s *splice.Splice) (e error)

Encode a Route into the next bytes of a splice.Splice.

func (*Route) Handle

func (x *Route) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)

func (*Route) Len

func (x *Route) Len() int

Len returns the length of this Route message.

func (*Route) Magic

func (x *Route) Magic() string

Magic is the identifying 4 byte string indicating a Route message follows.

func (*Route) Unwrap

func (x *Route) Unwrap() interface{}

Unwrap returns the onion inside this Route.

func (*Route) Wrap

func (x *Route) Wrap(inner ont.Onion)

Wrap puts another onion inside this Route onion.

Jump to

Keyboard shortcuts

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