node-opcua-chunkmanager 2.155.0 → 2.157.0
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/dist/SequenceHeader.js +4 -2
- package/dist/SequenceHeader.js.map +1 -1
- package/dist/chunk_manager.js +156 -150
- package/dist/chunk_manager.js.map +1 -1
- package/package.json +9 -9
package/dist/SequenceHeader.js
CHANGED
|
@@ -19,6 +19,10 @@ const schemaSequenceHeader = (0, node_opcua_factory_1.buildStructuredType)({
|
|
|
19
19
|
name: "SequenceHeader"
|
|
20
20
|
});
|
|
21
21
|
class SequenceHeader extends node_opcua_factory_1.BaseUAObject {
|
|
22
|
+
static possibleFields = ["sequenceNumber", "requestId"];
|
|
23
|
+
static schema = schemaSequenceHeader;
|
|
24
|
+
sequenceNumber;
|
|
25
|
+
requestId;
|
|
22
26
|
constructor(options) {
|
|
23
27
|
options = options || {};
|
|
24
28
|
super();
|
|
@@ -42,7 +46,5 @@ class SequenceHeader extends node_opcua_factory_1.BaseUAObject {
|
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
exports.SequenceHeader = SequenceHeader;
|
|
45
|
-
SequenceHeader.possibleFields = ["sequenceNumber", "requestId"];
|
|
46
|
-
SequenceHeader.schema = schemaSequenceHeader;
|
|
47
49
|
SequenceHeader.prototype.schema = SequenceHeader.schema;
|
|
48
50
|
//# sourceMappingURL=SequenceHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceHeader.js","sourceRoot":"","sources":["../source/SequenceHeader.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAA4E;AAE5E,2DAO4B;AAE5B,MAAM,oBAAoB,GAA0B,IAAA,wCAAmB,EAAC;IACpE,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE;QACJ,4EAA4E;QAC5E,uDAAuD;QACvD,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE;QAC/C,wF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AgB,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;IAEM,MAAM,CAAC,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrB,IAAA,qCAAY,EAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAA,qCAAY,EAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,IAAA,qCAAY,EAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,SAAS,GAAG,IAAA,qCAAY,EAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;;AA5BL,wCA6BC;AAED,cAAc,CAAC,SAAS,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC"}
|
package/dist/chunk_manager.js
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _ChunkManager_instances, _ChunkManager_signBufferFunc, _ChunkManager_encryptBufferFunc, _ChunkManager_writeSequenceHeaderFunc, _ChunkManager_writeHeaderFunc, _ChunkManager_maxBlock, _ChunkManager_dataOffset, _ChunkManager_chunk, _ChunkManager_cursor, _ChunkManager_pendingChunk, _ChunkManager_dataEnd, _ChunkManager__write_signature, _ChunkManager__encrypt, _ChunkManager__push_pending_chunk, _ChunkManager__write_padding_bytes, _ChunkManager__post_process_current_chunk;
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.ChunkManager = exports.Mode = void 0;
|
|
16
4
|
exports.verify_message_chunk = verify_message_chunk;
|
|
@@ -37,45 +25,52 @@ var Mode;
|
|
|
37
25
|
Mode[Mode["SignAndEncrypt"] = 3] = "SignAndEncrypt";
|
|
38
26
|
})(Mode || (exports.Mode = Mode = {}));
|
|
39
27
|
class ChunkManager extends events_1.EventEmitter {
|
|
28
|
+
#signBufferFunc;
|
|
29
|
+
#encryptBufferFunc;
|
|
30
|
+
#writeSequenceHeaderFunc;
|
|
31
|
+
#writeHeaderFunc;
|
|
32
|
+
chunkSize;
|
|
33
|
+
headerSize;
|
|
34
|
+
maxBodySize;
|
|
35
|
+
signatureLength;
|
|
36
|
+
sequenceHeaderSize;
|
|
37
|
+
cipherBlockSize;
|
|
38
|
+
plainBlockSize;
|
|
39
|
+
// --------------
|
|
40
|
+
#maxBlock;
|
|
41
|
+
#dataOffset;
|
|
42
|
+
securityMode;
|
|
43
|
+
#chunk;
|
|
44
|
+
#cursor;
|
|
45
|
+
#pendingChunk;
|
|
46
|
+
#dataEnd;
|
|
40
47
|
constructor(securityMode, options) {
|
|
41
48
|
super();
|
|
42
|
-
_ChunkManager_instances.add(this);
|
|
43
|
-
_ChunkManager_signBufferFunc.set(this, void 0);
|
|
44
|
-
_ChunkManager_encryptBufferFunc.set(this, void 0);
|
|
45
|
-
_ChunkManager_writeSequenceHeaderFunc.set(this, void 0);
|
|
46
|
-
_ChunkManager_writeHeaderFunc.set(this, void 0);
|
|
47
|
-
// --------------
|
|
48
|
-
_ChunkManager_maxBlock.set(this, void 0);
|
|
49
|
-
_ChunkManager_dataOffset.set(this, void 0);
|
|
50
|
-
_ChunkManager_chunk.set(this, void 0);
|
|
51
|
-
_ChunkManager_cursor.set(this, void 0);
|
|
52
|
-
_ChunkManager_pendingChunk.set(this, void 0);
|
|
53
|
-
_ChunkManager_dataEnd.set(this, void 0);
|
|
54
49
|
this.securityMode = securityMode;
|
|
55
50
|
// { chunkSize : 32, headerSize : 10 ,signatureLength: 32 }
|
|
56
51
|
this.chunkSize = options.chunkSize;
|
|
57
52
|
this.headerSize = options.headerSize || 0;
|
|
58
53
|
if (this.headerSize) {
|
|
59
|
-
|
|
60
|
-
(0, node_opcua_assert_1.assert)(typeof
|
|
54
|
+
this.#writeHeaderFunc = options.writeHeaderFunc;
|
|
55
|
+
(0, node_opcua_assert_1.assert)(typeof this.#writeHeaderFunc === "function");
|
|
61
56
|
}
|
|
62
57
|
this.sequenceHeaderSize = options.sequenceHeaderSize === undefined ? 8 : options.sequenceHeaderSize;
|
|
63
58
|
if (this.sequenceHeaderSize > 0) {
|
|
64
|
-
|
|
65
|
-
(0, node_opcua_assert_1.assert)(typeof
|
|
59
|
+
this.#writeSequenceHeaderFunc = options.writeSequenceHeaderFunc;
|
|
60
|
+
(0, node_opcua_assert_1.assert)(typeof this.#writeSequenceHeaderFunc === "function");
|
|
66
61
|
}
|
|
67
62
|
this.signatureLength = options.signatureLength || 0;
|
|
68
|
-
|
|
63
|
+
this.#signBufferFunc = options.signBufferFunc;
|
|
69
64
|
this.plainBlockSize = options.plainBlockSize || 0; // 256-14;
|
|
70
65
|
this.cipherBlockSize = options.cipherBlockSize || 0; // 256;
|
|
71
|
-
|
|
66
|
+
this.#dataEnd = 0;
|
|
72
67
|
if (this.cipherBlockSize === 0) {
|
|
73
68
|
(0, node_opcua_assert_1.assert)(securityMode === Mode.None || securityMode === Mode.Sign);
|
|
74
69
|
// we don't encrypt,we just sign
|
|
75
70
|
(0, node_opcua_assert_1.assert)(this.plainBlockSize === 0);
|
|
76
71
|
// unencrypted block
|
|
77
72
|
this.maxBodySize = this.chunkSize - this.headerSize - this.signatureLength - this.sequenceHeaderSize;
|
|
78
|
-
|
|
73
|
+
this.#encryptBufferFunc = undefined;
|
|
79
74
|
}
|
|
80
75
|
else {
|
|
81
76
|
(0, node_opcua_assert_1.assert)(securityMode === Mode.SignAndEncrypt || securityMode === Mode.Sign);
|
|
@@ -83,26 +78,26 @@ class ChunkManager extends events_1.EventEmitter {
|
|
|
83
78
|
// During encryption a block with a size equal to PlainTextBlockSize is processed to produce a block
|
|
84
79
|
// with size equal to CipherTextBlockSize. These values depend on the encryption algorithm and may
|
|
85
80
|
// be the same.
|
|
86
|
-
|
|
87
|
-
(0, node_opcua_assert_1.assert)(typeof
|
|
81
|
+
this.#encryptBufferFunc = options.encryptBufferFunc;
|
|
82
|
+
(0, node_opcua_assert_1.assert)(typeof this.#encryptBufferFunc === "function", "an encryptBufferFunc is required");
|
|
88
83
|
// this is the formula proposed by OPCUA
|
|
89
84
|
this.maxBodySize =
|
|
90
85
|
this.plainBlockSize *
|
|
91
86
|
Math.floor((this.chunkSize - this.headerSize - this.signatureLength - 1) / this.cipherBlockSize) -
|
|
92
87
|
this.sequenceHeaderSize;
|
|
93
88
|
// this is the formula proposed by ERN
|
|
94
|
-
|
|
95
|
-
this.maxBodySize = this.plainBlockSize *
|
|
89
|
+
this.#maxBlock = Math.floor((this.chunkSize - this.headerSize) / this.cipherBlockSize);
|
|
90
|
+
this.maxBodySize = this.plainBlockSize * this.#maxBlock - this.sequenceHeaderSize - this.signatureLength - 1;
|
|
96
91
|
if (this.plainBlockSize > 256) {
|
|
97
92
|
this.maxBodySize -= 1;
|
|
98
93
|
}
|
|
99
94
|
}
|
|
100
95
|
(0, node_opcua_assert_1.assert)(this.maxBodySize > 0); // no space left to write data
|
|
101
96
|
// where the data starts in the block
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
this.#dataOffset = this.headerSize + this.sequenceHeaderSize;
|
|
98
|
+
this.#chunk = null;
|
|
99
|
+
this.#cursor = 0;
|
|
100
|
+
this.#pendingChunk = null;
|
|
106
101
|
}
|
|
107
102
|
evaluateTotalLengthAndChunks(bodySize) {
|
|
108
103
|
const chunkCount = Math.ceil(bodySize / this.maxBodySize);
|
|
@@ -117,137 +112,148 @@ class ChunkManager extends events_1.EventEmitter {
|
|
|
117
112
|
let inputCursor = 0;
|
|
118
113
|
while (l > 0) {
|
|
119
114
|
(0, node_opcua_assert_1.assert)(length - inputCursor !== 0);
|
|
120
|
-
if (
|
|
121
|
-
|
|
115
|
+
if (this.#cursor === 0) {
|
|
116
|
+
this.#_push_pending_chunk(false);
|
|
122
117
|
}
|
|
123
118
|
// space left in current chunk
|
|
124
|
-
const spaceLeft = this.maxBodySize -
|
|
119
|
+
const spaceLeft = this.maxBodySize - this.#cursor;
|
|
125
120
|
const nbToWrite = Math.min(length - inputCursor, spaceLeft);
|
|
126
|
-
|
|
121
|
+
this.#chunk = this.#chunk || (0, node_opcua_buffer_utils_1.createFastUninitializedBuffer)(this.chunkSize);
|
|
127
122
|
if (buffer) {
|
|
128
|
-
buffer.copy(
|
|
123
|
+
buffer.copy(this.#chunk, this.#cursor + this.#dataOffset, inputCursor, inputCursor + nbToWrite);
|
|
129
124
|
}
|
|
130
125
|
inputCursor += nbToWrite;
|
|
131
|
-
|
|
132
|
-
if (
|
|
133
|
-
|
|
126
|
+
this.#cursor += nbToWrite;
|
|
127
|
+
if (this.#cursor >= this.maxBodySize) {
|
|
128
|
+
this.#_post_process_current_chunk();
|
|
134
129
|
}
|
|
135
130
|
l -= nbToWrite;
|
|
136
131
|
}
|
|
137
132
|
}
|
|
138
133
|
end() {
|
|
139
|
-
if (
|
|
140
|
-
|
|
134
|
+
if (this.#cursor > 0) {
|
|
135
|
+
this.#_post_process_current_chunk();
|
|
141
136
|
}
|
|
142
|
-
|
|
137
|
+
this.#_push_pending_chunk(true);
|
|
143
138
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const sectionToSign = chunk.subarray(0, signatureStart);
|
|
156
|
-
const signature = __classPrivateFieldGet(this, _ChunkManager_signBufferFunc, "f").call(this, sectionToSign);
|
|
157
|
-
(0, node_opcua_assert_1.assert)(signature.length === this.signatureLength, "expecting signature length to match");
|
|
158
|
-
signature.copy(chunk, signatureStart);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
(0, node_opcua_assert_1.assert)(this.signatureLength === 0, "expecting NO SIGN");
|
|
162
|
-
}
|
|
163
|
-
}, _ChunkManager__encrypt = function _ChunkManager__encrypt(chunk) {
|
|
164
|
-
if (this.securityMode === Mode.None) {
|
|
165
|
-
// nothing todo
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (this.plainBlockSize > 0 && __classPrivateFieldGet(this, _ChunkManager_encryptBufferFunc, "f")) {
|
|
169
|
-
(0, node_opcua_assert_1.assert)(__classPrivateFieldGet(this, _ChunkManager_dataEnd, "f") !== undefined);
|
|
170
|
-
const startEncryptionPos = this.headerSize;
|
|
171
|
-
const endEncryptionPos = __classPrivateFieldGet(this, _ChunkManager_dataEnd, "f") + this.signatureLength;
|
|
172
|
-
const areaToEncrypt = chunk.subarray(startEncryptionPos, endEncryptionPos);
|
|
173
|
-
(0, node_opcua_assert_1.assert)(areaToEncrypt.length % this.plainBlockSize === 0); // padding should have been applied
|
|
174
|
-
const nbBlock = areaToEncrypt.length / this.plainBlockSize;
|
|
175
|
-
const encryptedBuffer = __classPrivateFieldGet(this, _ChunkManager_encryptBufferFunc, "f").call(this, areaToEncrypt);
|
|
176
|
-
(0, node_opcua_assert_1.assert)(encryptedBuffer.length % this.cipherBlockSize === 0);
|
|
177
|
-
(0, node_opcua_assert_1.assert)(encryptedBuffer.length === nbBlock * this.cipherBlockSize);
|
|
178
|
-
encryptedBuffer.copy(chunk, this.headerSize, 0);
|
|
179
|
-
}
|
|
180
|
-
}, _ChunkManager__push_pending_chunk = function _ChunkManager__push_pending_chunk(isLast) {
|
|
181
|
-
if (__classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f")) {
|
|
182
|
-
const expectedLength = __classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f").length;
|
|
183
|
-
if (this.headerSize > 0) {
|
|
184
|
-
// Release 1.02 39 OPC Unified Architecture, Part 6:
|
|
185
|
-
// The sequence header ensures that the first encrypted block of every Message sent over
|
|
186
|
-
// a channel will start with different data.
|
|
187
|
-
__classPrivateFieldGet(this, _ChunkManager_writeHeaderFunc, "f").call(this, __classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f").subarray(0, this.headerSize), isLast, expectedLength);
|
|
139
|
+
/**
|
|
140
|
+
* compute the signature of the chunk and append it at the end
|
|
141
|
+
* of the data block.
|
|
142
|
+
*
|
|
143
|
+
|
|
144
|
+
* @private
|
|
145
|
+
*/
|
|
146
|
+
#_write_signature(chunk) {
|
|
147
|
+
if (this.securityMode === Mode.None) {
|
|
148
|
+
(0, node_opcua_assert_1.assert)(this.signatureLength === 0, "expecting NO SIGN");
|
|
149
|
+
return;
|
|
188
150
|
}
|
|
189
|
-
if (this
|
|
190
|
-
|
|
151
|
+
if (this.#signBufferFunc) {
|
|
152
|
+
(0, node_opcua_assert_1.assert)(typeof this.#signBufferFunc === "function");
|
|
153
|
+
(0, node_opcua_assert_1.assert)(this.signatureLength !== 0);
|
|
154
|
+
const signatureStart = this.#dataEnd;
|
|
155
|
+
const sectionToSign = chunk.subarray(0, signatureStart);
|
|
156
|
+
const signature = this.#signBufferFunc.call(this, sectionToSign);
|
|
157
|
+
(0, node_opcua_assert_1.assert)(signature.length === this.signatureLength, "expecting signature length to match");
|
|
158
|
+
signature.copy(chunk, signatureStart);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
(0, node_opcua_assert_1.assert)(this.signatureLength === 0, "expecting NO SIGN");
|
|
191
162
|
}
|
|
192
|
-
__classPrivateFieldGet(this, _ChunkManager_instances, "m", _ChunkManager__write_signature).call(this, __classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f"));
|
|
193
|
-
__classPrivateFieldGet(this, _ChunkManager_instances, "m", _ChunkManager__encrypt).call(this, __classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f"));
|
|
194
|
-
/**
|
|
195
|
-
* @event chunk
|
|
196
|
-
* @param chunk {Buffer}
|
|
197
|
-
* @param isLast {Boolean} , true if final chunk
|
|
198
|
-
*/
|
|
199
|
-
this.emit("chunk", __classPrivateFieldGet(this, _ChunkManager_pendingChunk, "f"), isLast);
|
|
200
|
-
__classPrivateFieldSet(this, _ChunkManager_pendingChunk, null, "f");
|
|
201
163
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
164
|
+
#_encrypt(chunk) {
|
|
165
|
+
if (this.securityMode === Mode.None) {
|
|
166
|
+
// nothing todo
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (this.plainBlockSize > 0 && this.#encryptBufferFunc) {
|
|
170
|
+
(0, node_opcua_assert_1.assert)(this.#dataEnd !== undefined);
|
|
171
|
+
const startEncryptionPos = this.headerSize;
|
|
172
|
+
const endEncryptionPos = this.#dataEnd + this.signatureLength;
|
|
173
|
+
const areaToEncrypt = chunk.subarray(startEncryptionPos, endEncryptionPos);
|
|
174
|
+
(0, node_opcua_assert_1.assert)(areaToEncrypt.length % this.plainBlockSize === 0); // padding should have been applied
|
|
175
|
+
const nbBlock = areaToEncrypt.length / this.plainBlockSize;
|
|
176
|
+
const encryptedBuffer = this.#encryptBufferFunc.call(this, areaToEncrypt);
|
|
177
|
+
(0, node_opcua_assert_1.assert)(encryptedBuffer.length % this.cipherBlockSize === 0);
|
|
178
|
+
(0, node_opcua_assert_1.assert)(encryptedBuffer.length === nbBlock * this.cipherBlockSize);
|
|
179
|
+
encryptedBuffer.copy(chunk, this.headerSize, 0);
|
|
180
|
+
}
|
|
211
181
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
182
|
+
#_push_pending_chunk(isLast) {
|
|
183
|
+
if (this.#pendingChunk) {
|
|
184
|
+
const expectedLength = this.#pendingChunk.length;
|
|
185
|
+
if (this.headerSize > 0) {
|
|
186
|
+
// Release 1.02 39 OPC Unified Architecture, Part 6:
|
|
187
|
+
// The sequence header ensures that the first encrypted block of every Message sent over
|
|
188
|
+
// a channel will start with different data.
|
|
189
|
+
this.#writeHeaderFunc.call(this, this.#pendingChunk.subarray(0, this.headerSize), isLast, expectedLength);
|
|
190
|
+
}
|
|
191
|
+
if (this.sequenceHeaderSize > 0) {
|
|
192
|
+
this.#writeSequenceHeaderFunc.call(this, this.#pendingChunk.subarray(this.headerSize, this.headerSize + this.sequenceHeaderSize));
|
|
193
|
+
}
|
|
194
|
+
this.#_write_signature(this.#pendingChunk);
|
|
195
|
+
this.#_encrypt(this.#pendingChunk);
|
|
196
|
+
/**
|
|
197
|
+
* @event chunk
|
|
198
|
+
* @param chunk {Buffer}
|
|
199
|
+
* @param isLast {Boolean} , true if final chunk
|
|
200
|
+
*/
|
|
201
|
+
this.emit("chunk", this.#pendingChunk, isLast);
|
|
202
|
+
this.#pendingChunk = null;
|
|
203
|
+
}
|
|
216
204
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
// write padding
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
205
|
+
#_write_padding_bytes(nbPaddingByteTotal) {
|
|
206
|
+
const nbPaddingByte = nbPaddingByteTotal % 256;
|
|
207
|
+
const extraNbPaddingByte = Math.floor(nbPaddingByteTotal / 256);
|
|
208
|
+
(0, node_opcua_assert_1.assert)(extraNbPaddingByte === 0 || this.plainBlockSize > 256, "extraNbPaddingByte only requested when key size > 2048");
|
|
209
|
+
// write the padding byte
|
|
210
|
+
this.#chunk.writeUInt8(nbPaddingByte, this.#cursor + this.#dataOffset);
|
|
211
|
+
this.#cursor += 1;
|
|
212
|
+
for (let i = 0; i < nbPaddingByteTotal; i++) {
|
|
213
|
+
this.#chunk.writeUInt8(nbPaddingByte, this.#cursor + this.#dataOffset + i);
|
|
214
|
+
}
|
|
215
|
+
this.#cursor += nbPaddingByteTotal;
|
|
227
216
|
if (this.plainBlockSize > 256) {
|
|
228
|
-
|
|
217
|
+
this.#chunk.writeUInt8(extraNbPaddingByte, this.#cursor + this.#dataOffset);
|
|
218
|
+
this.#cursor += 1;
|
|
229
219
|
}
|
|
230
|
-
|
|
231
|
-
|
|
220
|
+
}
|
|
221
|
+
#_post_process_current_chunk() {
|
|
222
|
+
let extraEncryptionBytes = 0;
|
|
223
|
+
// add padding bytes if needed
|
|
224
|
+
if (this.plainBlockSize > 0) {
|
|
225
|
+
// write padding ( if encryption )
|
|
226
|
+
// let's calculate curLength = the length of the block to encrypt without padding yet
|
|
227
|
+
// +---------------+---------------+-------------+---------+--------------+------------+
|
|
228
|
+
// |SequenceHeader | data | paddingByte | padding | extraPadding | signature |
|
|
229
|
+
// +---------------+---------------+-------------+---------+--------------+------------+
|
|
230
|
+
let curLength = this.sequenceHeaderSize + this.#cursor + this.signatureLength;
|
|
231
|
+
if (this.plainBlockSize > 256) {
|
|
232
|
+
curLength += 2; // account for extraPadding Byte Number;
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
curLength += 1;
|
|
236
|
+
}
|
|
237
|
+
// let's calculate the required number of padding bytes
|
|
238
|
+
const n = curLength % this.plainBlockSize;
|
|
239
|
+
const nbPaddingByteTotal = (this.plainBlockSize - n) % this.plainBlockSize;
|
|
240
|
+
this.#_write_padding_bytes(nbPaddingByteTotal);
|
|
241
|
+
const adjustedLength = this.sequenceHeaderSize + this.#cursor + this.signatureLength;
|
|
242
|
+
(0, node_opcua_assert_1.assert)(adjustedLength % this.plainBlockSize === 0);
|
|
243
|
+
const nbBlock = adjustedLength / this.plainBlockSize;
|
|
244
|
+
extraEncryptionBytes = nbBlock * (this.cipherBlockSize - this.plainBlockSize);
|
|
232
245
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
this.#dataEnd = this.#dataOffset + this.#cursor;
|
|
247
|
+
// calculate the expected length of the chunk, once encrypted if encryption apply
|
|
248
|
+
const expectedLength = this.#dataEnd + this.signatureLength + extraEncryptionBytes;
|
|
249
|
+
this.#pendingChunk = this.#chunk.subarray(0, expectedLength);
|
|
250
|
+
// note :
|
|
251
|
+
// - this.pending_chunk has the correct size but is not signed nor encrypted yet
|
|
252
|
+
// as we don't know what to write in the header yet
|
|
253
|
+
// - as a result,
|
|
254
|
+
this.#chunk = null;
|
|
255
|
+
this.#cursor = 0;
|
|
241
256
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const expectedLength = __classPrivateFieldGet(this, _ChunkManager_dataEnd, "f") + this.signatureLength + extraEncryptionBytes;
|
|
245
|
-
__classPrivateFieldSet(this, _ChunkManager_pendingChunk, __classPrivateFieldGet(this, _ChunkManager_chunk, "f").subarray(0, expectedLength), "f");
|
|
246
|
-
// note :
|
|
247
|
-
// - this.pending_chunk has the correct size but is not signed nor encrypted yet
|
|
248
|
-
// as we don't know what to write in the header yet
|
|
249
|
-
// - as a result,
|
|
250
|
-
__classPrivateFieldSet(this, _ChunkManager_chunk, null, "f");
|
|
251
|
-
__classPrivateFieldSet(this, _ChunkManager_cursor, 0, "f");
|
|
252
|
-
};
|
|
257
|
+
}
|
|
258
|
+
exports.ChunkManager = ChunkManager;
|
|
253
259
|
//# sourceMappingURL=chunk_manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_manager.js","sourceRoot":"","sources":["../source/chunk_manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_manager.js","sourceRoot":"","sources":["../source/chunk_manager.ts"],"names":[],"mappings":";;;AAWA,oDAOC;AAlBD;;GAEG;AACH,mCAAsC;AAEtC,yDAA2C;AAC3C,uEAAwD;AACxD,qEAAwE;AAExE,+DAA0D;AAE1D,SAAgB,oBAAoB,CAAC,YAAoB;IACrD,IAAA,0BAAM,EAAC,YAAY,CAAC,CAAC;IACrB,IAAA,0BAAM,EAAC,YAAY,YAAY,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,IAAA,uCAAiB,EAAC,IAAI,uCAAY,CAAC,YAAY,CAAC,CAAC,CAAC;IACjE,IAAI,YAAY,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,YAAY,CAAC,MAAM,GAAG,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;AACL,CAAC;AAqDD,IAAY,IAIX;AAJD,WAAY,IAAI;IACZ,+BAAQ,CAAA;IACR,+BAAQ,CAAA;IACR,mDAAkB,CAAA;AACtB,CAAC,EAJW,IAAI,oBAAJ,IAAI,QAIf;AAED,MAAa,YAAa,SAAQ,qBAAY;IAC1C,eAAe,CAAkB;IACjC,kBAAkB,CAAqB;IACvC,wBAAwB,CAA2B;IACnD,gBAAgB,CAAmB;IAEnB,SAAS,CAAS;IAClB,UAAU,CAAS;IACnB,WAAW,CAAS;IACpB,eAAe,CAAS;IACxB,kBAAkB,CAAS;IAC3B,eAAe,CAAS;IACxB,cAAc,CAAS;IAEvC,iBAAiB;IACR,SAAS,CAAU;IAEnB,WAAW,CAAS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AAkB;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;CACJ;AA7RD,oCA6RC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-chunkmanager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.157.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module chunkmanager",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"lint": "eslint source/**/*.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"node-opcua-assert": "2.
|
|
15
|
-
"node-opcua-basic-types": "2.
|
|
16
|
-
"node-opcua-binary-stream": "2.
|
|
17
|
-
"node-opcua-buffer-utils": "2.
|
|
18
|
-
"node-opcua-factory": "2.
|
|
19
|
-
"node-opcua-packet-assembler": "2.
|
|
14
|
+
"node-opcua-assert": "2.157.0",
|
|
15
|
+
"node-opcua-basic-types": "2.157.0",
|
|
16
|
+
"node-opcua-binary-stream": "2.157.0",
|
|
17
|
+
"node-opcua-buffer-utils": "2.157.0",
|
|
18
|
+
"node-opcua-factory": "2.157.0",
|
|
19
|
+
"node-opcua-packet-assembler": "2.157.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"node-opcua-debug": "2.
|
|
22
|
+
"node-opcua-debug": "2.157.0"
|
|
23
23
|
},
|
|
24
24
|
"author": "Etienne Rossignon",
|
|
25
25
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"internet of things"
|
|
37
37
|
],
|
|
38
38
|
"homepage": "http://node-opcua.github.io/",
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "e0a948ac5379ae8d9cc8200a1b4a31515a35be37",
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
42
42
|
"source"
|