introquery

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: 17 Imported by: 0

Documentation

Overview

Package introquery is an onion message that verifies a relay is an introducer for a given hidden service, returning its intro.Ad.

After receiving this message if the intro is valid a client can use a route message to start a connection.

Index

Constants

View Source
const (
	Magic = "intq"
	Len   = magic.Len + nonce.IDLen + crypto.PubKeyLen +
		3*sha256.Len + nonce.IVLen*3
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Gen is a factory function for an IntroQuery.

func New

func New(id nonce.ID, hsk *crypto.Pub, exit *exit.ExitPoint) ont.Onion

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

Types

type IntroQuery

type IntroQuery struct {
	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.
	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

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

	// Onion contained in Introquery should be a RoutingHeader and cipher/nonce set.
	ont.Onion
}

IntroQuery is a query message to return the Intro for a given hidden service key.

func (*IntroQuery) Account

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

Account for an Introquery. In this case just the bytes size.

func (*IntroQuery) Decode

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

Decode what should be an IntroQuery message from a splice.Splice.

func (*IntroQuery) Encode

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

Encode this IntroQuery into a splice.Splice's next bytes.

func (*IntroQuery) Handle

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

Handle provides the relay switching logic for an engine handling an Introquery message.

func (*IntroQuery) Len

func (x *IntroQuery) Len() int

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

func (*IntroQuery) Magic

func (x *IntroQuery) Magic() string

Magic bytes identifying a HiddenService message is up next.

func (*IntroQuery) Unwrap

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

Unwrap returns the onion inside this IntroQuery message.

func (*IntroQuery) Wrap

func (x *IntroQuery) 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