Documentation ¶
Index ¶
- Constants
- func GetTorV3Hostname(pub ed25519.PublicKey) string
- func IsValidHostname(address string) bool
- func NewTorACN(appDirectory string, bundledTorPath string) (connectivity.ACN, error)
- func NewTorACNWithAuth(appDirectory string, bundledTorPath string, controlPort int, ...) (connectivity.ACN, error)
- type Authenticator
- type HashedPasswordAuthenticator
- type NoTorrcError
- type NullAuthenticator
- type TorrcBuilder
- func (tb *TorrcBuilder) Build(path string) error
- func (tb *TorrcBuilder) WithControlPort(port int) *TorrcBuilder
- func (tb *TorrcBuilder) WithHashedPassword(password string) *TorrcBuilder
- func (tb *TorrcBuilder) WithOnionTrafficOnly() *TorrcBuilder
- func (tb *TorrcBuilder) WithSocksPort(port int) *TorrcBuilder
Constants ¶
const ( // CannotDialRicochetAddressError is thrown when a connection to a ricochet address fails. CannotDialRicochetAddressError = connectivity.Error("CannotDialRicochetAddressError") )
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 ¶
GetTorV3Hostname converts an ed25519 public key to a valid tor onion hostname
func IsValidHostname ¶ added in v1.1.1
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
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.
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 (*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