hiddenservice

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Unlicense Imports: 17 Imported by: 0

Documentation

Overview

Package hiddenservice provides a message type for hidden services to send to designated introducer relays.

These are a message type that does not go into a peer's ad bundle, they are simply gossiped when they are received, and will stop being gossiped after the expiry in the embedded intro message expiry is passed.

Of course a hidden service can decide to unilaterally stop sending these before this expiry for any reason, and each new client triggers the generation of a new intro, which is forwarded to the introducer after it performs an introduction with this data, but usually it will continue to give a new intro each time a client connects through until the expiry time.

Index

Constants

View Source
const (
	Magic = "hids"
	Len   = magic.Len +
		intro.Len +
		3*sha256.Len +
		nonce.IVLen*3 +
		consts.RoutingHeaderLen
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function for a HiddenService.

func New

func New(in *intro.Ad, point *exit.ExitPoint) ont.Onion

New generates a new HiddenService data structure and returns it as an ont.Onion interface.

Types

type HiddenService

type HiddenService struct {

	// Intro of the hidden service.
	Intro intro.Ad

	// Ciphers is a set of 3 symmetric ciphers that are to be used in their
	// given order over the reply message from the service.
	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

	hidden.RoutingHeaderBytes

	ont.Onion
}

HiddenService is a message providing an Intro and the necessary Ciphers, Nonces and RoutingHeaderBytes to forward a Route message through to the hidden service, using the client's reply RoutingHeader.

func (*HiddenService) Account

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

Account the traffic for the relay handling this message.

func (*HiddenService) Decode

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

Decode the HiddenService message from the next bytes of a Splice.

func (*HiddenService) Encode

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

Encode a HiddenService into a the next bytes of a Splice.

func (*HiddenService) Handle

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

Handle defines how the ont.Ngin should deal with this onion type.

func (*HiddenService) Len

func (x *HiddenService) Len() int

Len returns the length of the onion starting from this one (used to size a Splice).

func (*HiddenService) Magic

func (x *HiddenService) Magic() string

Magic bytes identifying a HiddenService message is up next.

func (*HiddenService) Unwrap

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

Unwrap returns the inner onion or remaining parts of the message prototype.

func (*HiddenService) Wrap

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

Wrap places another onion inside this one in its slot.

Jump to

Keyboard shortcuts

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