Documentation
¶
Overview ¶
Package config implements the configuration for the Katzenpost client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
// OnConnFn is the callback function that will be called when the
// connection status changes. The error parameter will be nil on
// successful connection establishment, otherwise it will be set
// with the reason why a connection has been torn down (or a connect
// attempt has failed).
OnConnFn func(error)
// OnMessageEmptyFn is the callback function that will be called
// when the user's server side spool is empty. This can happen
// as the result of periodic background fetches. Calls to the callback
// that return an error will be treated as a signal to tear down the
// connection.
OnEmptyFn func() error
// OnMessageFn is the callback function that will be called when
// a message is retrived from the user's server side spool. Callers
// MUST be prepared to receive multiple callbacks with the same
// message body. Calls to the callback that return an error will
// be treated as a signal to tear down the connection.
OnMessageFn func([]byte) error
// OnACKFn is the callback function that will be called when a
// message CK is retreived from the user's server side spool. Callers
// MUST be prepared to receive multiple callbacks with the same
// SURB ID and SURB ciphertext. Calls to the callback that return
// an error will be treated as a signal to tear down the connection.
OnACKFn func(*[constants.SURBIDLength]byte, []byte) error
// OnDocumentFn is the callback function taht will be called when a
// new directory document is retreived for the current epoch.
OnDocumentFn func(*cpki.Document)
}
type Config ¶
type Config struct {
// ListenNetwork is the network type that the daemon should listen on for thin client connections.
ListenNetwork string
// ListenAddress is the network address that the daemon should listen on for thin client connections.
ListenAddress string
// PKISignatureScheme specifies the signature scheme to use with the PKI protocol.
PKISignatureScheme string
// WireKEMScheme specifies which KEM to use with our PQ Noise based wire protocol.
WireKEMScheme string
// SphinxGeometry
SphinxGeometry *geo.Geometry
// PigeonholeGeometry
PigeonholeGeometry *pigeonholeGeo.Geometry
// Logging
Logging *Logging
// UpstreamProxy can be used to setup a SOCKS proxy for use with a VPN or Tor.
UpstreamProxy *UpstreamProxy
// Debug is used to set various parameters.
Debug *Debug
// CachedDocument is a PKI Document that has a MixDescriptor
// containg the Addresses and LinkKeys of minclient's Gateway
// so that it can connect directly without contacting an Authority.
CachedDocument *cpki.Document
// PinnedGateways is information about a set of Gateways; the required information that lets clients initially
// connect and download a cached PKI document.
PinnedGateways *Gateways
// VotingAuthority contains the voting authority peer public configuration.
VotingAuthority *VotingAuthority
// Callbacks should not be set by the config file.
Callbacks *Callbacks
// PreferedTransports is a list of the transports will be used to make
// outgoing network connections, with the most prefered first.
PreferedTransports []string
// contains filtered or unexported fields
}
Config is the top level client configuration.
func Load ¶
Load parses and validates the provided buffer b as a config file body and returns the Config.
func (*Config) FixupAndValidate ¶
FixupAndValidate applies defaults to config entries and validates the configuration sections.
func (*Config) UpstreamProxyConfig ¶
UpstreamProxyConfig returns the configured upstream proxy, suitable for internal use. Most people should not use this.
type Debug ¶
type Debug struct {
DisableDecoyTraffic bool
// SessionDialTimeout is the number of seconds that a session dial
// is allowed to take until it is canceled.
SessionDialTimeout int
// InitialMaxPKIRetrievalDelay is the initial maximum number of seconds
// we are willing to wait for the retreival of the PKI document.
InitialMaxPKIRetrievalDelay int
// PollingInterval is the interval in seconds that will be used to
// poll the receive queue. By default this is 10 seconds. Reducing
// the value too far WILL result in unnecessary Gateway load, and
// increasing the value too far WILL adversely affect large message
// transmit performance.
PollingInterval int
// EnableTimeSync enables the use of skewed remote provider time
// instead of system time when available.
EnableTimeSync bool
}
Debug is the debug configuration.
type Gateway ¶
type Gateway struct {
// WireKEMScheme specifies which KEM to use with our PQ Noise based wire protocol.
WireKEMScheme string
// Name is the human readable (descriptive) node identifier.
Name string
// IdentityKey is the node's identity (signing) key.
IdentityKey sign.PublicKey
// LinkKey is the node's wire protocol public key.
LinkKey kem.PublicKey
// PKISignatureScheme specifies the signature scheme to use with the PKI protocol.
PKISignatureScheme string
// Addresses are the URLs specifying the endpoints that can be used to reach the node.
// Valid schemes are tcp:// and quic:// for TCP and quic (UDP)
Addresses []string
}
Gateway describes all necessary Gateway connection information so that clients can connect to the Gateway and use the mixnet and retrieve cached PKI documents.
func (*Gateway) UnmarshalTOML ¶
type Logging ¶
type Logging struct {
// Disable disables logging entirely.
Disable bool
// File specifies the log file, if omitted stdout will be used.
File string
// Level specifies the log level.
Level string
}
Logging is the logging configuration.
type UpstreamProxy ¶
type UpstreamProxy struct {
// Type is the proxy type (Eg: "none"," socks5").
Type string
// Network is the proxy address' network (`unix`, `tcp`).
Network string
// Address is the proxy's address.
Address string
// User is the optional proxy username.
User string
// Password is the optional proxy password.
Password string
}
UpstreamProxy is the outgoing connection proxy configuration.
type VotingAuthority ¶
type VotingAuthority struct {
Peers []*vServerConfig.Authority
}
VotingAuthority is a voting authority peer public configuration: key material, connection info etc.