Documentation
¶
Index ¶
- Variables
- func Base32Decode(in []byte) (out []byte, err error)
- func Base32Encode(in []byte) (out []byte)
- func DecodePrivateKeyString(privateKeyString string) [32]byte
- func DecodePublicKeyString(pubKeyString string) [32]byte
- func HashPassword(password []byte) (passwordHash [32]byte)
- func HashPublicKey(publicKey [32]byte) []byte
- func HashPublicKeyString(pk string) []byte
- type Challenge
- type Connection
- func (c *Connection) CanDecodeDataPacket() error
- func (c *Connection) CanSendHelloPacket(e *fsm.Event)
- func (c *Connection) CanSendKeyPacket(e *fsm.Event)
- func (c *Connection) DecodeHelloPacket(e *fsm.Event)
- func (c *Connection) HandlePacket(p []byte) (data []byte, err error)
- func (c *Connection) HandshakeComplete(e *fsm.Event)
- func (c *Connection) NewChallenge() (*Challenge, error)
- func (c *Connection) NewHelloPacket(e *fsm.Event)
- func (c *Connection) NewKeyPacket(e *fsm.Event)
- func (c *Connection) SetPassword(password string)
- func (c *Connection) ValidateHelloPacket(e *fsm.Event)
- func (c *Connection) ValidateKeyPacket(e *fsm.Event)
- type Credential
- type CryptoAuthError
- type CryptoState
- type Handshake
- type Identity
- type KeyPair
- type Node
- type Passwd
- type ReplayProtection
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthType uint8 = 1
By default, the authentication/challenge type is always 1
Functions ¶
func Base32Decode ¶
func Base32Encode ¶
func DecodePrivateKeyString ¶
func DecodePublicKeyString ¶
func HashPassword ¶
func HashPublicKey ¶
func HashPublicKeyString ¶
Types ¶
type Connection ¶
type Connection struct { Incoming chan []byte // Buffered channel to store decrypted data packets Outbound chan []byte // contains filtered or unexported fields }
Each session is represented by a connection
func NewConnection ¶
func NewConnection(conn *net.UDPConn, raddr *net.UDPAddr, local, remote *CryptoState) *Connection
func (*Connection) CanDecodeDataPacket ¶
func (c *Connection) CanDecodeDataPacket() error
func (*Connection) CanSendHelloPacket ¶
func (c *Connection) CanSendHelloPacket(e *fsm.Event)
func (*Connection) CanSendKeyPacket ¶
func (c *Connection) CanSendKeyPacket(e *fsm.Event)
func (*Connection) DecodeHelloPacket ¶
func (c *Connection) DecodeHelloPacket(e *fsm.Event)
func (*Connection) HandlePacket ¶
func (c *Connection) HandlePacket(p []byte) (data []byte, err error)
func (*Connection) HandshakeComplete ¶
func (c *Connection) HandshakeComplete(e *fsm.Event)
func (*Connection) NewChallenge ¶
func (c *Connection) NewChallenge() (*Challenge, error)
func (*Connection) NewHelloPacket ¶
func (c *Connection) NewHelloPacket(e *fsm.Event)
func (*Connection) NewKeyPacket ¶
func (c *Connection) NewKeyPacket(e *fsm.Event)
func (*Connection) SetPassword ¶
func (c *Connection) SetPassword(password string)
func (*Connection) ValidateHelloPacket ¶
func (c *Connection) ValidateHelloPacket(e *fsm.Event)
func (*Connection) ValidateKeyPacket ¶
func (c *Connection) ValidateKeyPacket(e *fsm.Event)
type Credential ¶
type CryptoAuthError ¶
type CryptoAuthError struct { Code int Class string // the class of error - authentication, undeliverable Info string // extra info about the error }
func (*CryptoAuthError) Error ¶
func (err *CryptoAuthError) Error() string
type CryptoState ¶
type CryptoState struct {
// contains filtered or unexported fields
}
func NewCryptoState ¶
func NewCryptoState(perm, temp *KeyPair, initiator bool) *CryptoState
func (*CryptoState) NewTempKeys ¶
func (c *CryptoState) NewTempKeys() (err error)
type Identity ¶
func NewIdentity ¶
type Node ¶
type Node struct { Identity *Identity Bind string Conn *net.UDPConn Servers []*Credential // remote servers Credentials []*Credential // credentials for incoming clients Password string // for testing just one password at a time Connections map[string]*Connection }
type ReplayProtection ¶
type ReplayProtection struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.