challenger

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Secret = os.Getenv("SEEDER_KEY")

Secret is a shared secret between the voucher seeder and the node.

Functions

func ComputeChallenge

func ComputeChallenge(gen []byte) []byte

ComputeChallenge returns the expected answer by hashing the random string with the shared secret.

Types

type Challenger

type Challenger struct {
	// contains filtered or unexported fields
}

Challenger is the component responsible for vetting incoming connections.

func New

func New(store *node.Store) *Challenger

New creates a new, initialized Challenger.

func (*Challenger) ProcessResponse

func (c *Challenger) ProcessResponse(srcPeerID string, m message.Message) ([]bytes.Buffer, error)

ProcessResponse will process the response to a connection challenge.

func (*Challenger) SendChallenge

func (c *Challenger) SendChallenge(ctx context.Context, r *peer.Reader, w *peer.Writer)

SendChallenge to a connecting peer.

Jump to

Keyboard shortcuts

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