Documentation
¶
Index ¶
- Constants
- Variables
- func UdpOneShot(payload []byte, destinationIpAddress string, destinationPort int, ...) ([]byte, error)
- type Configuration
- type CookieGenerator
- type Handshake
- type Keypair
- type MessageInitiation
- type MessageResponse
- type NoisePresharedKey
- type NoisePrivateKey
- type NoisePublicKey
- type Timestamp
Constants ¶
View Source
const ( WGLabelMAC1 = "mac1----" WGLabelCookie = "cookie--" )
View Source
const ( NoiseConstruction = "Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s" WGIdentifier = "WireGuard v1 zx2c4 Jason@zx2c4.com" )
View Source
const ( MessageInitiationType = 1 MessageResponseType = 2 MessageCookieReplyType = 3 MessageTransportType = 4 )
View Source
const ( MessageInitiationSize = 148 // size of handshake initiation message MessageResponseSize = 92 // size of response message MessageCookieReplySize = 64 // size of cookie reply message MessageTransportHeaderSize = 16 // size of data preceding content in transport message MessageTransportSize = MessageTransportHeaderSize + chacha20poly1305.Overhead // size of empty transport MessageKeepaliveSize = MessageTransportSize // size of keepalive MessageHandshakeSize = MessageInitiationSize // size of largest handshake related message )
View Source
const ( NoisePublicKeySize = 32 NoisePrivateKeySize = 32 )
View Source
const ( MessageTransportOffsetReceiver = 4 MessageTransportOffsetCounter = 8 MessageTransportOffsetContent = 16 )
View Source
const PaddingSize = 16
View Source
const UdpRecieveSize = 1500
Variables ¶
View Source
var ( InitialHash [blake2s.Size]byte ZeroNonce [chacha20poly1305.NonceSize]byte )
Functions ¶
func UdpOneShot ¶
Types ¶
type Configuration ¶
type CookieGenerator ¶
type CookieGenerator struct {
// contains filtered or unexported fields
}
type MessageInitiation ¶
type MessageInitiation struct { Type uint32 Sender uint32 Ephemeral NoisePublicKey Static [NoisePublicKeySize + chacha20poly1305.Overhead]byte Timestamp [timestampSize + chacha20poly1305.Overhead]byte MAC1 [blake2s.Size128]byte MAC2 [blake2s.Size128]byte }
type MessageResponse ¶
type NoisePresharedKey ¶
type NoisePresharedKey [NoisePresharedKeySize]byte
type NoisePrivateKey ¶
type NoisePrivateKey [NoisePrivateKeySize]byte
type NoisePublicKey ¶
type NoisePublicKey [NoisePublicKeySize]byte
Source Files
¶
Click to show internal directories.
Click to hide internal directories.