server

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

README

Katzenpost mixnet PANDA service
===============================

This is a rough draft untested in memory PANDA service plugin. PANDA
stands for Phrase Automated Nym Discovery Authentication, which is a
protocol variation of EKE2, a PAKE, Password Authenticated Key
Exchange, with some design variations that allows clients to perform
the key exchanges asynchronously using a ciphertext intermediary, this
PANDA server. That is to say, this server is simple a merely
facilitates the exchanges of cryphtographic binary blobs between
clients participating in the PANDA protocol.

See **Katzenpost PANDA Autoresponder Extension** specification document:
* https://github.com/katzenpost/docs/blob/master/drafts/panda.txt


Usage
-----

::

   ./panda -h
   Usage of ./panda:
     -dwell_time string
        ciphertext max dwell time before garbage collection (default "336h")
     -log_dir string
        logging directory
     -log_level string
        logging level could be set to: DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL (default "DEBUG")


Configuration
-------------

Your Katzenpost server configuration should contain
a section that looks like the following:

::

   [[Provider.PluginKaetzchen]]
     Capability = "panda"
     Endpoint = "+panda"
     Disable = false
     Command = "/home/user/test_mixnet/bin/panda"
     MaxConcurrency = 1
     [Provider.PluginKaetzchen.Config]
       log_dir = "/home/user/test_mixnet/service_logs"
       dwell_time = "200h"

Documentation

Index

Constants

View Source
const (
	// PandaStorageVersion is the version of our on disk format.
	PandaStorageVersion = 0
)

Variables

View Source
var ErrNoSURBRequest = errors.New("Request received without SURB")

ErrNoSURBRequest is the error returned when no SURB accompanies a query.

Functions

This section is empty.

Types

type Panda

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

Panda is the PANDA server type.

func New

func New(log *logging.Logger, fileStore string, dwellDuration time.Duration, writeBackInterval time.Duration) (*Panda, error)

New constructs a new Panda server instance

func (*Panda) OnRequest

func (k *Panda) OnRequest(id uint64, payload []byte, hasSURB bool) ([]byte, error)

OnRequest services a client request and returns the reply.

type PandaPosting

type PandaPosting struct {
	sync.Mutex

	Dirty    bool
	UnixTime int64
	A, B     []byte
}

PandaPosting is the data structure stored on Panda server with each client interaction.

func (*PandaPosting) Expired

func (p *PandaPosting) Expired(expiration time.Duration) bool

Expired returns true if the posting is older than the specified expiration duration.

type PandaStorage added in v0.0.3

type PandaStorage struct {
	worker.Worker
	// contains filtered or unexported fields
}

PandaStorage handles the on disk persistence for the PANDA server.

func NewPandaStorage added in v0.0.3

func NewPandaStorage(fileStore string, dwellDuration time.Duration, writeBackInterval time.Duration) (*PandaStorage, error)

NewPandaStorage creates an in memory store for Panda postings

func (*PandaStorage) Get added in v0.0.3

Get returns a posting from the data store that is referenced by the given tag.

func (*PandaStorage) Put added in v0.0.3

func (s *PandaStorage) Put(tag *[common.PandaTagLength]byte, posting *PandaPosting) error

Put stores a posting in the data store such that it is referenced by the given tag.

func (*PandaStorage) Replace added in v0.0.3

func (s *PandaStorage) Replace(tag *[common.PandaTagLength]byte, posting *PandaPosting) error

Replace replaces the stored posting.

func (*PandaStorage) Shutdown added in v0.0.3

func (s *PandaStorage) Shutdown()

Shutdown stops the worker thread and sync the db.

func (*PandaStorage) Vacuum added in v0.0.3

func (s *PandaStorage) Vacuum() error

Vacuum removes the postings that have expired.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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