whisper

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 whisper provides a message type for sending a message to a hidden service, or back to a hidden service client.

These messages are the same for both sides after a route message forwards via the intro routing header an introducer receives for a hidden service, as there is no intermediary bridge like in rendezvous routing.

Index

Constants

View Source
const (
	MessageMagic    = "whis"
	ReplyCiphersLen = 2*consts.RoutingHeaderLen +
		6*sha256.Len +
		6*nonce.IVLen
	MessageLen = magic.Len +
		2*nonce.IDLen +
		2*consts.RoutingHeaderLen +
		ReplyCiphersLen
)

Variables

This section is empty.

Functions

func Gen

func Gen() codec.Codec

Types

type Message

type Message struct {
	Forwards        [2]*sessions.Data
	Address         *crypto.Pub
	ID, Re          nonce.ID
	Forward, Return *hidden.ReplyHeader
	Payload         slice.Bytes
}

Message is the generic, peer to peer, bidirectional messade type for between a client and a hidden service.

The message format is the same for both sides, as the connection is maintained by each side forwarding a new return path each message they send.

func NewMessage

func NewMessage() (msg *Message)

NewMessage ... TODO

func (*Message) Account

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

Account for the Message. The client obviously doesn't do anything with this.

todo: how does hidden service bill? We need to establish hidden service session type.

func (*Message) Decode

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

Decode a Message from a provided splice.Splice.

func (*Message) Encode

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

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

func (*Message) Handle

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

Handle is the relay logic for an engine handling a Message.

func (*Message) Len

func (x *Message) Len() int

Len returns the length of this Message.

func (*Message) Magic

func (x *Message) Magic() string

Magic is the identifying 4 byte string indicating a Message follows.

func (*Message) Unwrap

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

Unwrap is a no-op because there is no onion inside a Message, only the reply parameters.

func (*Message) Wrap

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

Wrap is a no-op because there is no further onion inside a Message, only reply parameters.

Jump to

Keyboard shortcuts

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