tor

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 28 Imported by: 15

Documentation

Index

Constants

View Source
const (
	// CannotDialRicochetAddressError is thrown when a connection to a ricochet address fails.
	CannotDialRicochetAddressError = connectivity.Error("CannotDialRicochetAddressError")
)
View Source
const V3HostnameLength = 56

V3HostnameLength is the length of a Tor V3 Onion Address (without the .onion suffix)

Variables

This section is empty.

Functions

func GetTorV3Hostname

func GetTorV3Hostname(pub ed25519.PublicKey) string

GetTorV3Hostname converts an ed25519 public key to a valid tor onion hostname

func IsValidHostname added in v1.1.1

func IsValidHostname(address string) bool

IsValidHostname returns true if the given address is a valid onion v3 address

func NewHashedPasswordAuthenticator added in v1.2.0

func NewHashedPasswordAuthenticator(password string) tor.Authenticator

NewHashedPasswordAuthenticator creates a new hashed password authenticator

func NewTorACN

func NewTorACN(appDirectory string, bundledTorPath string) (connectivity.ACN, error)

NewTorACN creates/starts a Tor ACN and returns a usable ACN object with a NullAuthenticator - this will fail.

func NewTorACNWithAuth added in v1.2.0

func NewTorACNWithAuth(appDirectory string, bundledTorPath string, controlPort int, authenticator tor.Authenticator) (connectivity.ACN, error)

NewTorACNWithAuth creates/starts a Tor ACN and returns a usable ACN object

Types

type HashedPasswordAuthenticator added in v1.2.0

type HashedPasswordAuthenticator struct {
	Password string
}

HashedPasswordAuthenticator authenticates to a Tor control port using a hashed password. Note: This method is vulnerable to replay attacks by the host system (but so is cookie auth)

func (HashedPasswordAuthenticator) Authenticate added in v1.2.0

func (h HashedPasswordAuthenticator) Authenticate(controlport *control.Conn) error

Authenticate uses the given hashed password to authenticate to the control port

type NoTorrcError added in v1.2.1

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

NoTorrcError is a typed error thrown to indicate start could not complete due to lack of a torrc file

func (*NoTorrcError) Error added in v1.2.1

func (e *NoTorrcError) Error() string

type NullAuthenticator added in v1.2.0

type NullAuthenticator struct {
}

NullAuthenticator exists to force always authenticating to a system tor.

func (NullAuthenticator) Authenticate added in v1.2.0

func (n NullAuthenticator) Authenticate(controlport *control.Conn) error

Authenticate on a NullAuthenticator always results in failure.

type TorrcBuilder added in v1.2.2

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

TorrcBuilder is a a helper for building torrc files

func NewTorrc added in v1.2.2

func NewTorrc() *TorrcBuilder

NewTorrc creates a new torrc builder

func (*TorrcBuilder) Build added in v1.2.2

func (tb *TorrcBuilder) Build(path string) error

Build finalizes the torrc contents and write a file

func (*TorrcBuilder) WithControlPort added in v1.2.2

func (tb *TorrcBuilder) WithControlPort(port int) *TorrcBuilder

WithControlPort sets the control port of the tor process

func (*TorrcBuilder) WithHashedPassword added in v1.2.2

func (tb *TorrcBuilder) WithHashedPassword(password string) *TorrcBuilder

WithHashedPassword sets a password for the control port.

func (*TorrcBuilder) WithOnionTrafficOnly added in v1.2.2

func (tb *TorrcBuilder) WithOnionTrafficOnly() *TorrcBuilder

WithOnionTrafficOnly ensures that the tor process only routes tor onion traffic.

func (*TorrcBuilder) WithSocksPort added in v1.2.2

func (tb *TorrcBuilder) WithSocksPort(port int) *TorrcBuilder

WithSocksPort sets the SOCKS port of the tor process

Jump to

Keyboard shortcuts

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