node-ikev2 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/payload.js +5 -1
- package/package.json +1 -1
package/lib/src/payload.js
CHANGED
|
@@ -830,7 +830,8 @@ class PayloadAUTH extends Payload {
|
|
|
830
830
|
static parse(buffer) {
|
|
831
831
|
const genericPayload = Payload.parse(buffer);
|
|
832
832
|
const authMethod = buffer.readUInt8(4);
|
|
833
|
-
|
|
833
|
+
// Skip 3 reserved bytes
|
|
834
|
+
const authData = buffer.subarray(8, genericPayload.length);
|
|
834
835
|
return new PayloadAUTH(genericPayload.nextPayload, authMethod, authData, genericPayload.critical, genericPayload.length);
|
|
835
836
|
}
|
|
836
837
|
/**
|
|
@@ -1592,6 +1593,9 @@ class PayloadSK extends Payload {
|
|
|
1592
1593
|
throw new Error(`Insufficient data for payload header at offset ${offset}`);
|
|
1593
1594
|
}
|
|
1594
1595
|
const payload = nextPayloadClass.parse(inClearData.subarray(offset, inClearData.length));
|
|
1596
|
+
// Some extended types set NONE in type from the constructor on parse, when there are multiple types with the same
|
|
1597
|
+
// encoding - e.g. PayloadID with IDi and IDr
|
|
1598
|
+
payload.type = nextPayload;
|
|
1595
1599
|
payloads.push(payload);
|
|
1596
1600
|
offset += payload.length;
|
|
1597
1601
|
nextPayload = payload.nextPayload;
|