node-opcua-secure-channel
Advanced tools
Comparing version 2.137.0 to 2.139.0
@@ -38,14 +38,19 @@ "use strict"; | ||
// calculate message size ( with its encodingDefaultBinary) | ||
const chunkManager = __classPrivateFieldGet(this, _MessageChunker_instances, "m", _MessageChunker__build_chunk_manager).call(this, msgType, params); | ||
const { chunkCount, totalLength } = chunkManager.evaluateTotalLengthAndChunks(messageLength); | ||
if (this.maxChunkCount > 0 && chunkCount > this.maxChunkCount) { | ||
errorLog(`[NODE-OPCUA-E10] message chunkCount ${chunkCount} exceeds the negotiated maximum chunk count ${this.maxChunkCount}, message current size is ${totalLength}`); | ||
errorLog(`[NODE-OPCUA-E10] ${messageLength} totalLength = ${totalLength} chunkManager.maxBodySize = ${this.maxMessageSize}`); | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
try { | ||
const chunkManager = __classPrivateFieldGet(this, _MessageChunker_instances, "m", _MessageChunker__build_chunk_manager).call(this, msgType, params); | ||
const { chunkCount, totalLength } = chunkManager.evaluateTotalLengthAndChunks(messageLength); | ||
if (this.maxChunkCount > 0 && chunkCount > this.maxChunkCount) { | ||
errorLog(`[NODE-OPCUA-E10] message chunkCount ${chunkCount} exceeds the negotiated maximum chunk count ${this.maxChunkCount}, message current size is ${totalLength}`); | ||
errorLog(`[NODE-OPCUA-E10] ${messageLength} totalLength = ${totalLength} chunkManager.maxBodySize = ${this.maxMessageSize}`); | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
} | ||
if (this.maxMessageSize > 0 && totalLength > this.maxMessageSize) { | ||
errorLog(`[NODE-OPCUA-E11] message size ${totalLength} exceeds the negotiated message size ${this.maxMessageSize} nb chunks ${chunkCount}`); | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
} | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.Good, chunkManager: chunkManager }; | ||
} | ||
if (this.maxMessageSize > 0 && totalLength > this.maxMessageSize) { | ||
errorLog(`[NODE-OPCUA-E11] message size ${totalLength} exceeds the negotiated message size ${this.maxMessageSize} nb chunks ${chunkCount}`); | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
catch (err) { | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.BadTcpInternalError, chunkManager: null }; | ||
} | ||
return { statusCode: node_opcua_basic_types_1.StatusCodes.Good, chunkManager: chunkManager }; | ||
} | ||
@@ -52,0 +57,0 @@ chunkSecureMessage(msgType, params, message, messageChunkCallback) { |
@@ -106,3 +106,3 @@ import { EventEmitter } from "events"; | ||
timeout: number; | ||
get clientCertificate(): Buffer | null; | ||
get clientCertificate(): Buffer<ArrayBufferLike> | null; | ||
/** | ||
@@ -116,3 +116,3 @@ * the channel message security mode | ||
securityPolicy: SecurityPolicy; | ||
get status(): "closed" | "connecting" | "new" | "open" | "closing"; | ||
get status(): "new" | "connecting" | "open" | "closing" | "closed"; | ||
constructor(options: ServerSecureChannelLayerOptions); | ||
@@ -119,0 +119,0 @@ getTransportSettings(): { |
import "should"; | ||
export declare const makeMessageChunkSignatureForTest: (chunk: Buffer) => Buffer; | ||
export declare const makeMessageChunkSignatureForTest: (chunk: Buffer) => Buffer<ArrayBufferLike>; | ||
export declare function construct_verifyMessageChunkSignatureForTest(): (chunk: Buffer) => boolean; | ||
export declare const verifyMessageChunkSignatureForTest: (chunk: Buffer) => boolean; |
{ | ||
"name": "node-opcua-secure-channel", | ||
"version": "2.137.0", | ||
"version": "2.139.0", | ||
"description": "pure nodejs OPCUA SDK - module secure-channel", | ||
@@ -11,3 +11,3 @@ "main": "./dist/source/index.js", | ||
"test": "mocha", | ||
"clean": "npx rimraf node_modules dist *.tsbuildinfo" | ||
"clean": "npx rimraf -g node_modules dist *.tsbuildinfo" | ||
}, | ||
@@ -17,29 +17,29 @@ "dependencies": { | ||
"chalk": "4.1.2", | ||
"node-opcua-assert": "2.120.0", | ||
"node-opcua-basic-types": "2.134.0", | ||
"node-opcua-binary-stream": "2.133.0", | ||
"node-opcua-certificate-manager": "2.134.0", | ||
"node-opcua-chunkmanager": "2.137.0", | ||
"node-opcua-common": "2.137.0", | ||
"node-opcua-crypto": "4.12.0", | ||
"node-opcua-debug": "2.133.0", | ||
"node-opcua-factory": "2.137.0", | ||
"node-opcua-nodeid": "2.133.0", | ||
"node-opcua-object-registry": "2.133.0", | ||
"node-opcua-packet-analyzer": "2.137.0", | ||
"node-opcua-service-endpoints": "2.137.0", | ||
"node-opcua-service-secure-channel": "2.137.0", | ||
"node-opcua-status-code": "2.133.0", | ||
"node-opcua-transport": "2.137.0", | ||
"node-opcua-types": "2.137.0", | ||
"node-opcua-utils": "2.133.0" | ||
"node-opcua-assert": "2.139.0", | ||
"node-opcua-basic-types": "2.139.0", | ||
"node-opcua-binary-stream": "2.139.0", | ||
"node-opcua-certificate-manager": "2.139.0", | ||
"node-opcua-chunkmanager": "2.139.0", | ||
"node-opcua-common": "2.139.0", | ||
"node-opcua-crypto": "4.15.0", | ||
"node-opcua-debug": "2.139.0", | ||
"node-opcua-factory": "2.139.0", | ||
"node-opcua-nodeid": "2.139.0", | ||
"node-opcua-object-registry": "2.139.0", | ||
"node-opcua-packet-analyzer": "2.139.0", | ||
"node-opcua-service-endpoints": "2.139.0", | ||
"node-opcua-service-secure-channel": "2.139.0", | ||
"node-opcua-status-code": "2.139.0", | ||
"node-opcua-transport": "2.139.0", | ||
"node-opcua-types": "2.139.0", | ||
"node-opcua-utils": "2.139.0" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-buffer-utils": "2.133.0", | ||
"node-opcua-leak-detector": "2.133.0", | ||
"node-opcua-service-browse": "2.137.0", | ||
"node-opcua-service-read": "2.137.0", | ||
"node-opcua-service-session": "2.137.0", | ||
"node-opcua-test-fixtures": "2.137.0", | ||
"node-opcua-test-helpers": "2.128.0" | ||
"node-opcua-buffer-utils": "2.139.0", | ||
"node-opcua-leak-detector": "2.139.0", | ||
"node-opcua-service-browse": "2.139.0", | ||
"node-opcua-service-read": "2.139.0", | ||
"node-opcua-service-session": "2.139.0", | ||
"node-opcua-test-fixtures": "2.139.0", | ||
"node-opcua-test-helpers": "2.139.0" | ||
}, | ||
@@ -61,3 +61,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "e88e4f20d5436dd68084d2a6d447f170330b373d", | ||
"gitHead": "b7a01d31c7602d323e60a5f4a54428199a266f29", | ||
"files": [ | ||
@@ -64,0 +64,0 @@ "dist", |
@@ -128,22 +128,26 @@ /** | ||
// calculate message size ( with its encodingDefaultBinary) | ||
const chunkManager = this.#_build_chunk_manager(msgType, params); | ||
try { | ||
const chunkManager = this.#_build_chunk_manager(msgType, params); | ||
const { chunkCount, totalLength } = chunkManager.evaluateTotalLengthAndChunks(messageLength); | ||
const { chunkCount, totalLength } = chunkManager.evaluateTotalLengthAndChunks(messageLength); | ||
if (this.maxChunkCount > 0 && chunkCount > this.maxChunkCount) { | ||
errorLog( | ||
`[NODE-OPCUA-E10] message chunkCount ${chunkCount} exceeds the negotiated maximum chunk count ${this.maxChunkCount}, message current size is ${totalLength}` | ||
); | ||
errorLog( | ||
`[NODE-OPCUA-E10] ${messageLength} totalLength = ${totalLength} chunkManager.maxBodySize = ${this.maxMessageSize}` | ||
); | ||
return { statusCode: StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
if (this.maxChunkCount > 0 && chunkCount > this.maxChunkCount) { | ||
errorLog( | ||
`[NODE-OPCUA-E10] message chunkCount ${chunkCount} exceeds the negotiated maximum chunk count ${this.maxChunkCount}, message current size is ${totalLength}` | ||
); | ||
errorLog( | ||
`[NODE-OPCUA-E10] ${messageLength} totalLength = ${totalLength} chunkManager.maxBodySize = ${this.maxMessageSize}` | ||
); | ||
return { statusCode: StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
} | ||
if (this.maxMessageSize > 0 && totalLength > this.maxMessageSize) { | ||
errorLog( | ||
`[NODE-OPCUA-E11] message size ${totalLength} exceeds the negotiated message size ${this.maxMessageSize} nb chunks ${chunkCount}` | ||
); | ||
return { statusCode: StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
} | ||
return { statusCode: StatusCodes.Good, chunkManager: chunkManager }; | ||
} catch (err) { | ||
return { statusCode: StatusCodes.BadTcpInternalError, chunkManager: null }; | ||
} | ||
if (this.maxMessageSize > 0 && totalLength > this.maxMessageSize) { | ||
errorLog( | ||
`[NODE-OPCUA-E11] message size ${totalLength} exceeds the negotiated message size ${this.maxMessageSize} nb chunks ${chunkCount}` | ||
); | ||
return { statusCode: StatusCodes.BadTcpMessageTooLarge, chunkManager: null }; | ||
} | ||
return { statusCode: StatusCodes.Good, chunkManager: chunkManager }; | ||
} | ||
@@ -177,6 +181,6 @@ public chunkSecureMessage( | ||
chunkManager.on("chunk", (messageChunk: Buffer) => { | ||
nbChunks++; | ||
totalSize += messageChunk.length; | ||
messageChunkCallback(messageChunk); | ||
}) | ||
nbChunks++; | ||
totalSize += messageChunk.length; | ||
messageChunkCallback(messageChunk); | ||
}) | ||
.on("finished", () => { | ||
@@ -183,0 +187,0 @@ if (doTraceChunk) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
875995
86
11917
+ Added@types/long@4.0.2(transitive)
+ Addednode-opcua-assert@2.139.0(transitive)
+ Addednode-opcua-basic-types@2.139.0(transitive)
+ Addednode-opcua-binary-stream@2.139.0(transitive)
+ Addednode-opcua-buffer-utils@2.139.0(transitive)
+ Addednode-opcua-certificate-manager@2.139.0(transitive)
+ Addednode-opcua-chunkmanager@2.139.0(transitive)
+ Addednode-opcua-common@2.139.0(transitive)
+ Addednode-opcua-constants@2.139.0(transitive)
+ Addednode-opcua-crypto@4.15.0(transitive)
+ Addednode-opcua-data-model@2.139.0(transitive)
+ Addednode-opcua-data-value@2.139.0(transitive)
+ Addednode-opcua-date-time@2.139.0(transitive)
+ Addednode-opcua-debug@2.139.0(transitive)
+ Addednode-opcua-enum@2.139.0(transitive)
+ Addednode-opcua-extension-object@2.139.0(transitive)
+ Addednode-opcua-factory@2.139.0(transitive)
+ Addednode-opcua-generator@2.139.0(transitive)
+ Addednode-opcua-guid@2.139.0(transitive)
+ Addednode-opcua-nodeid@2.139.0(transitive)
+ Addednode-opcua-numeric-range@2.139.0(transitive)
+ Addednode-opcua-object-registry@2.139.0(transitive)
+ Addednode-opcua-packet-analyzer@2.139.0(transitive)
+ Addednode-opcua-packet-assembler@2.139.0(transitive)
+ Addednode-opcua-pki@4.17.0(transitive)
+ Addednode-opcua-schemas@2.139.0(transitive)
+ Addednode-opcua-service-endpoints@2.139.0(transitive)
+ Addednode-opcua-service-secure-channel@2.139.0(transitive)
+ Addednode-opcua-status-code@2.139.0(transitive)
+ Addednode-opcua-transport@2.139.0(transitive)
+ Addednode-opcua-types@2.139.0(transitive)
+ Addednode-opcua-utils@2.139.0(transitive)
+ Addednode-opcua-variant@2.139.0(transitive)
+ Addednode-opcua-xml2json@2.139.0(transitive)
- Removed@types/long@4.0.0(transitive)
- Removednode-opcua-assert@2.120.0(transitive)
- Removednode-opcua-basic-types@2.134.0(transitive)
- Removednode-opcua-binary-stream@2.133.0(transitive)
- Removednode-opcua-buffer-utils@2.133.0(transitive)
- Removednode-opcua-certificate-manager@2.134.0(transitive)
- Removednode-opcua-chunkmanager@2.137.0(transitive)
- Removednode-opcua-common@2.137.0(transitive)
- Removednode-opcua-constants@2.125.0(transitive)
- Removednode-opcua-crypto@4.12.0(transitive)
- Removednode-opcua-data-model@2.137.0(transitive)
- Removednode-opcua-data-value@2.137.0(transitive)
- Removednode-opcua-date-time@2.134.0(transitive)
- Removednode-opcua-debug@2.133.0(transitive)
- Removednode-opcua-enum@2.133.0(transitive)
- Removednode-opcua-extension-object@2.137.0(transitive)
- Removednode-opcua-factory@2.137.0(transitive)
- Removednode-opcua-generator@2.137.0(transitive)
- Removednode-opcua-guid@2.133.0(transitive)
- Removednode-opcua-nodeid@2.133.0(transitive)
- Removednode-opcua-numeric-range@2.137.0(transitive)
- Removednode-opcua-object-registry@2.133.0(transitive)
- Removednode-opcua-packet-analyzer@2.137.0(transitive)
- Removednode-opcua-packet-assembler@2.133.0(transitive)
- Removednode-opcua-pki@4.16.0(transitive)
- Removednode-opcua-schemas@2.137.0(transitive)
- Removednode-opcua-service-endpoints@2.137.0(transitive)
- Removednode-opcua-service-secure-channel@2.137.0(transitive)
- Removednode-opcua-status-code@2.133.0(transitive)
- Removednode-opcua-transport@2.137.0(transitive)
- Removednode-opcua-types@2.137.0(transitive)
- Removednode-opcua-utils@2.133.0(transitive)
- Removednode-opcua-variant@2.137.0(transitive)
- Removednode-opcua-xml2json@2.137.0(transitive)
Updatednode-opcua-assert@2.139.0
Updatednode-opcua-common@2.139.0
Updatednode-opcua-crypto@4.15.0
Updatednode-opcua-debug@2.139.0
Updatednode-opcua-factory@2.139.0
Updatednode-opcua-nodeid@2.139.0
Updatednode-opcua-transport@2.139.0
Updatednode-opcua-types@2.139.0
Updatednode-opcua-utils@2.139.0