Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/generated/ts/ikev2.ts
2070 views
1
2
3
4
export const IKE_EXCHANGE_AUTH = 35;
5
6
7
export const IKE_EXCHANGE_CREATE_CHILD_SA = 36;
8
9
10
export const IKE_EXCHANGE_INFORMATIONAL = 37;
11
12
13
export const IKE_EXCHANGE_SA_INIT = 34;
14
15
16
export const IKE_FLAGS_InitiatorBitCheck = 0x08;
17
18
19
export const IKE_NOTIFY_NO_PROPOSAL_CHOSEN = 14;
20
21
22
export const IKE_NOTIFY_USE_TRANSPORT_MODE = 16391;
23
24
25
export const IKE_VERSION_2 = 0x20;
26
27
/**
28
* IKEMessage is the IKEv2 message
29
* IKEv2 implements a limited subset of IKEv2 Protocol, specifically
30
* the IKE_NOTIFY and IKE_NONCE payloads and the IKE_SA_INIT exchange.
31
*/
32
export class IKEMessage {
33
34
35
36
public InitiatorSPI?: number;
37
38
39
40
public Version?: number;
41
42
43
44
public ExchangeType?: number;
45
46
47
48
public Flags?: number;
49
50
51
// Constructor of IKEMessage
52
constructor() {}
53
/**
54
* AppendPayload appends a payload to the IKE message
55
* payload can be any of the payloads like IKENotification, IKENonce, etc.
56
* @example
57
* ```javascript
58
* const ikev2 = require('nuclei/ikev2');
59
* const message = new ikev2.IKEMessage();
60
* const nonce = new ikev2.IKENonce();
61
* nonce.NonceData = [1, 2, 3];
62
* message.AppendPayload(nonce);
63
* ```
64
*/
65
public AppendPayload(payload: any): void {
66
return;
67
}
68
69
70
/**
71
* Encode encodes the final IKE message
72
* @example
73
* ```javascript
74
* const ikev2 = require('nuclei/ikev2');
75
* const message = new ikev2.IKEMessage();
76
* const nonce = new ikev2.IKENonce();
77
* nonce.NonceData = [1, 2, 3];
78
* message.AppendPayload(nonce);
79
* log(message.Encode());
80
* ```
81
*/
82
public Encode(): Uint8Array | null {
83
return null;
84
}
85
86
87
}
88
89
90
91
/**
92
* IKENonce is the IKEv2 Nonce payload
93
* this implements the IKEPayload interface
94
* @example
95
* ```javascript
96
* const ikev2 = require('nuclei/ikev2');
97
* const nonce = new ikev2.IKENonce();
98
* nonce.NonceData = [1, 2, 3];
99
* ```
100
*/
101
export interface IKENonce {
102
103
NonceData?: Uint8Array,
104
}
105
106
107
108
/**
109
* IKEv2Notify is the IKEv2 Notification payload
110
* this implements the IKEPayload interface
111
* @example
112
* ```javascript
113
* const ikev2 = require('nuclei/ikev2');
114
* const notify = new ikev2.IKENotification();
115
* notify.NotifyMessageType = ikev2.IKE_NOTIFY_NO_PROPOSAL_CHOSEN;
116
* notify.NotificationData = [1, 2, 3];
117
* ```
118
*/
119
export interface IKENotification {
120
121
NotifyMessageType?: number,
122
123
NotificationData?: Uint8Array,
124
}
125
126
127