ikev2

package
v3.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT, Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Notify message types
	IKE_NOTIFY_NO_PROPOSAL_CHOSEN = 14
	IKE_NOTIFY_USE_TRANSPORT_MODE = 16391

	IKE_VERSION_2 = 0x20

	// Exchange Type
	IKE_EXCHANGE_SA_INIT         = 34
	IKE_EXCHANGE_AUTH            = 35
	IKE_EXCHANGE_CREATE_CHILD_SA = 36
	IKE_EXCHANGE_INFORMATIONAL   = 37

	// Flags
	IKE_FLAGS_InitiatorBitCheck = 0x08
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IKEMessage

type IKEMessage struct {
	InitiatorSPI uint64
	Version      uint8
	ExchangeType uint8
	Flags        uint8
	// contains filtered or unexported fields
}

IKEMessage is the IKEv2 message

IKEv2 implements a limited subset of IKEv2 Protocol, specifically the IKE_NOTIFY and IKE_NONCE payloads and the IKE_SA_INIT exchange.

func (*IKEMessage) AppendPayload

func (m *IKEMessage) AppendPayload(payload any) error

AppendPayload appends a payload to the IKE message payload can be any of the payloads like IKENotification, IKENonce, etc. @example ```javascript const ikev2 = require('nuclei/ikev2'); const message = new ikev2.IKEMessage(); const nonce = new ikev2.IKENonce(); nonce.NonceData = [1, 2, 3]; message.AppendPayload(nonce); ```

func (*IKEMessage) Encode

func (m *IKEMessage) Encode() ([]byte, error)

Encode encodes the final IKE message @example ```javascript const ikev2 = require('nuclei/ikev2'); const message = new ikev2.IKEMessage(); const nonce = new ikev2.IKENonce(); nonce.NonceData = [1, 2, 3]; message.AppendPayload(nonce); log(message.Encode()); ```

type IKENonce

type IKENonce struct {
	NonceData []byte
}

IKENonce is the IKEv2 Nonce payload this implements the IKEPayload interface @example ```javascript const ikev2 = require('nuclei/ikev2'); const nonce = new ikev2.IKENonce(); nonce.NonceData = [1, 2, 3]; ```

type IKENotification

type IKENotification struct {
	NotifyMessageType uint16
	NotificationData  []byte
}

IKEv2Notify is the IKEv2 Notification payload this implements the IKEPayload interface @example ```javascript const ikev2 = require('nuclei/ikev2'); const notify = new ikev2.IKENotification(); notify.NotifyMessageType = ikev2.IKE_NOTIFY_NO_PROPOSAL_CHOSEN; notify.NotificationData = [1, 2, 3]; ```

type IKEPayload

type IKEPayload interface {
	// contains filtered or unexported methods
}

IKEPayload is the IKEv2 payload interface All the payloads like IKENotification, IKENonce, etc. implement this interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL