Documentation
¶
Overview ¶
Package ike provides shared IKE (Internet Key Exchange) protocol parsing and packet-building utilities used by both the discover and enumerate modules.
Index ¶
- func AppendUnique(slice []string, item string) []string
- func BuildIKEv2SAInitRequest() []byte
- func BuildNATTIKEv2SAInitRequest() []byte
- func GetDHGroupName(id uint16) string
- func GetEncryptionAlgorithmName(id uint16) string
- func GetExchangeTypeName(t byte) string
- func GetIntegrityAlgorithmName(id uint16) string
- func GetPRFName(id uint16) string
- func ParseSAPayload(data []byte, proposals *SecurityProposals)
- type IKEHeader
- type SecurityProposals
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUnique ¶
AppendUnique appends item to slice only if it is not already present.
func BuildIKEv2SAInitRequest ¶
func BuildIKEv2SAInitRequest() []byte
BuildIKEv2SAInitRequest creates a minimal IKEv2 IKE_SA_INIT request packet. Use this for the standard IKE port (UDP 500).
func BuildNATTIKEv2SAInitRequest ¶
func BuildNATTIKEv2SAInitRequest() []byte
BuildNATTIKEv2SAInitRequest creates an IKEv2 IKE_SA_INIT request framed for UDP port 4500 per RFC 3948 §2.3: a 4-byte Non-ESP marker (0x00000000) is prepended so the receiver can distinguish IKE traffic from ESP packets.
func GetDHGroupName ¶
GetDHGroupName returns the IANA name for an IKEv2 Diffie-Hellman group ID (RFC 7296 / IANA "IKEv2 Transform Type 4" registry).
func GetEncryptionAlgorithmName ¶
GetEncryptionAlgorithmName returns the IANA name for an IKEv2 encryption transform ID (RFC 7296 / IANA "IKEv2 Transform Type 1" registry).
func GetExchangeTypeName ¶
GetExchangeTypeName returns the human-readable name for an IKE exchange type.
func GetIntegrityAlgorithmName ¶
GetIntegrityAlgorithmName returns the IANA name for an IKEv2 integrity transform ID (RFC 7296 / IANA "IKEv2 Transform Type 3" registry).
func GetPRFName ¶
GetPRFName returns the IANA name for an IKEv2 PRF transform ID (RFC 7296 / IANA "IKEv2 Transform Type 2" registry).
func ParseSAPayload ¶
func ParseSAPayload(data []byte, proposals *SecurityProposals)
ParseSAPayload extracts transform attributes from an IKEv2 SA payload, correctly skipping any per-proposal SPI bytes before the transform list.
Types ¶
type IKEHeader ¶
type IKEHeader struct {
InitiatorSPI [8]byte
ResponderSPI [8]byte
NextPayload byte
MajorVersion byte
MinorVersion byte
ExchangeType byte
Flags byte
MessageID uint32
Length uint32
}
IKEHeader represents the parsed 28-byte IKE message header.
func ParseIKEHeader ¶
ParseIKEHeader parses the 28-byte IKE message header.
type SecurityProposals ¶
type SecurityProposals struct {
EncryptionAlgs []string
HashAlgs []string
AuthMethods []string
DHGroups []string
}
SecurityProposals holds parsed IKE security association proposals.
func ParseIKEPayloads ¶
func ParseIKEPayloads(data []byte, nextPayload byte) ([]string, *SecurityProposals)
ParseIKEPayloads extracts vendor IDs (hex-encoded) and SA proposals from the payload section of an IKE message. nextPayload is taken from the IKE header.