Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-secure-channel

Package Overview
Dependencies
Maintainers
0
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-secure-channel - npm Package Compare versions

Comparing version 2.137.0 to 2.139.0

25

dist/source/message_chunker.js

@@ -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) {

4

dist/source/server/server_secure_channel_layer.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc