tor

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 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 GenerateTorrc added in v1.2.0

func GenerateTorrc(password string, path string) error

GenerateTorrc generates a Tor config file with the control port bieng guarded by a hash of the given password.

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 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 Authenticator) (connectivity.ACN, error)

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

Types

type Authenticator added in v1.2.0

type Authenticator interface {
	Authenticate(controlport *control.Conn) error
}

Authenticator provides a facade over various Tor control port authentication methods.

func NewHashedPasswordAuthenticator added in v1.2.0

func NewHashedPasswordAuthenticator(password string) Authenticator

NewHashedPasswordAuthenticator creates a new hashed password authenticator

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.

Jump to

Keyboard shortcuts

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