Documentation
¶
Overview ¶
Package exit is an onion message type that contains a payload intended to be forwarded to the exit service of a relay.
Index ¶
- Constants
- func Gen() codec.Codec
- func New(id nonce.ID, port uint16, payload slice.Bytes, ep *ExitPoint) ont.Onion
- type Exit
- func (x *Exit) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
- func (x *Exit) Decode(s *splice.Splice) (e error)
- func (x *Exit) Encode(s *splice.Splice) (e error)
- func (x *Exit) Handle(s *splice.Splice, p ont.Onion, ng ont.Ngin) (e error)
- func (x *Exit) Len() int
- func (x *Exit) Magic() string
- func (x *Exit) Unwrap() interface{}
- func (x *Exit) Wrap(inner ont.Onion)
- type ExitPoint
- type Params
- type Routing
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Exit ¶
type Exit struct {
// ID is the identifier that will be embedded with the response to this message
// relayed from the exit service.
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
// Port identifies the type of service as well as being the port used by the
// service to be relayed to. This should be the well-known protocol associated
// with the port number, eg 80 for HTTP, 53 for DNS, etc.
Port uint16
// Bytes are the message to be passed to the exit service.
slice.Bytes
// Onion contains the rest of the message, in this case the reply RoutingHeader.
ont.Onion
}
Exit is a
func (*Exit) Account ¶
func (x *Exit) Account(res *sess.Data, sm *sess.Manager, s *sessions.Data, last bool) (skip bool, sd *sessions.Data)
Account searches for the relevant service, applies the balance change to the account that will be in effect when the response has arrived and delivery is confirmed.
func (*Exit) Handle ¶
Handle provides the relay switching logic for an engine handling an Exit message.
func (*Exit) Len ¶
Len returns the length of this Exit message (payload and return header Onion included.
type ExitPoint ¶
type ExitPoint struct {
// Routing contains all the information required to generate a RoutingHeader and
// cipher/nonce set.
*Routing
// ReturnPubs are the public keys of the session payload, which are not in the
// message but previously shared to create a session.
ReturnPubs crypto.Pubs
}
ExitPoint is the return routing parameters delivered inside an Exit onion.
type Params ¶
type Params struct {
Port uint16
Payload slice.Bytes
ID nonce.ID
Alice, Bob *sessions.Data
S sessions.Circuit
KS *crypto.KeySet
}
Params are the parameters to generate an Exit onion.
type Routing ¶
type Routing struct {
// Sessions that the RoutingHeader is using.
Sessions [3]*sessions.Data
// Keys being used to form the other ECDH half for the encryption.
Keys crypto.Privs
// The three nonces that match up with each of the three session RoutingHeader
// Crypt nonces.
crypto.Nonces
}
Routing is the sessions and keys required to generate a return RoutingHeader.
Click to show internal directories.
Click to hide internal directories.