Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateSecret(private, theirPublic []byte, t CurveType) ([]byte, error)
- func Curve25519CalculateSecret(private, theirPublic []byte) ([]byte, error)
- func Curve25519GenerateKey() ([]byte, []byte, error)
- func GenerateKeyPair(t CurveType) ([]byte, []byte, error)
- type AEADType
- type Client
- type ClientHelloData
- type CurveType
- type DHPubKey
- type Endpoint
- type MacAddr
- type PacketType
- type QueuedPacket
- type Server
- type ServerHelloData
- type SharedKey
- type SymmetricCryptoContext
- type VpnPacket
Constants ¶
View Source
const ClientHelloDataLength = 7
View Source
const (
EthernetMACHeaderLength = 14 //2 * 6 for MAC-addresses + 2 for ethertype
)
View Source
const ServerHelloDataLength = 8
View Source
const VPNPacketLength = 9
Variables ¶
View Source
var ( ErrInvalidClientHello = errors.New("core: invalid ClientHello packet") ErrInvalidServerHello = errors.New("core: invalid ServerHello packet") ErrInvalidCertificate = errors.New("core: unsupported certificate") ErrInvalidSignature = errors.New("core: invalid signature") ErrInvalidVPNPacket = errors.New("core: invalid vpn packet") ErrInvalidAEAD = errors.New("core: invalid aead specified") )
View Source
var (
ErrInvalidCurve = errors.New("core: invalid curve type")
)
View Source
var (
GoVPNAEADData = []byte("govpn-aead-data")
)
View Source
var (
MACBroadcastAddr = MacAddr{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
)
Functions ¶
func CalculateSecret ¶
func Curve25519GenerateKey ¶
Types ¶
type Client ¶
type Client struct {
sync.Mutex
ServerAddress string
SendQueue chan<- []byte
ReceiveQueue <-chan []byte
// contains filtered or unexported fields
}
func (*Client) PerformHandshake ¶
func (*Client) RunBackground ¶
func (c *Client) RunBackground()
type ClientHelloData ¶
type ClientHelloData struct {
Type PacketType
CurveSelection CurveType
AEADSelection AEADType
ClientSessionKeyLength int //sent as LittleEndian uint16
ClientCertificateLength int //sent as LittleEndian uint16
ClientSessionKey []byte
ClientCertificate *x509.Certificate //returned for server
Signature []byte //not used in code
}
type PacketType ¶
type PacketType byte
const ( VpnPacketType PacketType = iota ClientHelloPacketType ServerHelloPacketType )
type QueuedPacket ¶
type Server ¶
type Server struct {
ServerMACAddress MacAddr
ReceiveQueue <-chan []byte
SendQueue chan<- []byte
// contains filtered or unexported fields
}
type ServerHelloData ¶
type ServerHelloData struct {
Type PacketType
SessionNonce [5]byte
ServerSessionKeyLength int
ServerSessionKey DHPubKey
Signature []byte
}
type SymmetricCryptoContext ¶
Click to show internal directories.
Click to hide internal directories.