Documentation ¶
Index ¶
Constants ¶
View Source
const ( Poly1305TagSize int = 16 MessageInitiationBytesTotal int = 148 MessageResponseBytesTotal int = 92 MessageCookieReplyBytesTotal int = 64 MessageTransportBytesMin int = 32 MessageTypeInitiation uint32 = 1 MessageTypeResponse uint32 = 2 MessageTypeCookieReply uint32 = 3 MessageTypeTransport uint32 = 4 ReservedZeroFilter = ^(uint32(0)) >> 8 << 8 )
Refs:
https://www.wireguard.com/protocol/ https://www.wireguard.com/papers/wireguard.pdf https://github.com/pirate/wireguard-docs https://github.com/WireGuard/wireguard-go/blob/master/device/noise-protocol.go
Variables ¶
View Source
var (
MessageBytesOrder = binary.LittleEndian
)
Functions ¶
This section is empty.
Types ¶
type MatchWireGuard ¶
type MatchWireGuard struct { // Zero may be used to match reserved zero bytes of Type field when // they have non-zero values (e.g. for obfuscation purposes). E.g. it // may be set to 4,285,988,864 (0xFF770000) in order to match custom // handshake initiation messages starting with 0x010077FF byte sequence. // Note: any non-zero value is a violation of the WireGuard protocol. Zero uint32 `json:"zero,omitempty"` }
MatchWireGuard is able to match WireGuard connections.
func (*MatchWireGuard) CaddyModule ¶
func (m *MatchWireGuard) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*MatchWireGuard) Match ¶
func (m *MatchWireGuard) Match(cx *layer4.Connection) (bool, error)
Match returns true if the connection looks like WireGuard.
func (*MatchWireGuard) Provision ¶
func (m *MatchWireGuard) Provision(_ caddy.Context) error
Provision prepares m's internal structures.
func (*MatchWireGuard) UnmarshalCaddyfile ¶
func (m *MatchWireGuard) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile sets up the MatchWireGuard from Caddyfile tokens. Syntax:
wireguard [<zero>]
type MessageInitiation ¶
type MessageInitiation struct { Type uint32 Sender uint32 Ephemeral [32]uint8 Static [32 + Poly1305TagSize]uint8 Timestamp [12 + Poly1305TagSize]uint8 MAC1 [16]uint8 MAC2 [16]uint8 }
MessageInitiation is the first message which the initiator sends to the responder.
func (*MessageInitiation) FromBytes ¶
func (msg *MessageInitiation) FromBytes(src []byte) error
func (*MessageInitiation) ToBytes ¶
func (msg *MessageInitiation) ToBytes() ([]byte, error)
type MessageTransport ¶
MessageTransport is the message which the initiator and the responder exchange after a successful handshake.
func (*MessageTransport) FromBytes ¶
func (msg *MessageTransport) FromBytes(src []byte) error
func (*MessageTransport) ToBytes ¶
func (msg *MessageTransport) ToBytes() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.