From 3f36f20e0df8c4fbc10769bf3d65d284f462f844 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 2 Oct 2025 10:01:51 +0100 Subject: [PATCH] Bump snmp lib and add extra SHAtypes --- io/snmp/package.json | 4 ++-- io/snmp/snmp.html | 4 ++++ io/snmp/snmp.js | 24 ++++++++++++++++++++++-- parsers/markdown/package.json | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/io/snmp/package.json b/io/snmp/package.json index 9eeefad8..e56a7e3c 100644 --- a/io/snmp/package.json +++ b/io/snmp/package.json @@ -1,9 +1,9 @@ { "name" : "node-red-node-snmp", - "version" : "2.0.1", + "version" : "2.1.0", "description" : "A Node-RED node that gets and sets SNMP oid values. Supports v1, v2c and v3", "dependencies" : { - "net-snmp" : "^3.9.0" + "net-snmp" : "^3.26.0" }, "repository" : { "type":"git", diff --git a/io/snmp/snmp.html b/io/snmp/snmp.html index 7287079e..59b12ef2 100644 --- a/io/snmp/snmp.html +++ b/io/snmp/snmp.html @@ -93,6 +93,10 @@
diff --git a/io/snmp/snmp.js b/io/snmp/snmp.js index 3853e5fa..49a03730 100644 --- a/io/snmp/snmp.js +++ b/io/snmp/snmp.js @@ -77,14 +77,34 @@ module.exports = function (RED) { } else if (node.version === "3") { user.name = node.username || msg.username || ""; user.level = SNMP.SecurityLevel.noAuthNoPriv; - user.authProtocol = SNMP.AuthProtocols.none; + switch (node.authprot) { + case "MD5": + user.authProtocol = SNMP.AuthProtocols.md5; + break; + case "SHA": + user.authProtocol = SNMP.AuthProtocols.sha; + break; + case "SHA224": + user.authProtocol = SNMP.AuthProtocols.sha224; + break; + case "SHA256": + user.authProtocol = SNMP.AuthProtocols.sha256; + break; + case "SHA384": + user.authProtocol = SNMP.AuthProtocols.sha384; + break; + case "SHA512": + user.authProtocol = SNMP.AuthProtocols.sha512; + break; + default: + user.authProtocol = SNMP.AuthProtocols.none; + } user.authKey = ""; user.privProtocol = SNMP.PrivProtocols.none; user.privKey = ""; options.version = SNMP.Version3; if (node.auth === "authNoPriv" || node.auth === "authPriv") { user.level = SNMP.SecurityLevel.authNoPriv; - user.authProtocol = (node.authprot === "SHA") ? SNMP.AuthProtocols.sha : SNMP.AuthProtocols.md5; user.authKey = node.authkey || msg.authkey || ""; if (node.auth === "authPriv") { user.level = SNMP.SecurityLevel.authPriv; diff --git a/parsers/markdown/package.json b/parsers/markdown/package.json index 8f9e9c9f..8feb7a9e 100644 --- a/parsers/markdown/package.json +++ b/parsers/markdown/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-markdown", - "version": "0.5.1", + "version": "0.6.0", "description": "A Node-RED node to convert a markdown string to html.", "dependencies": { "markdown-it": "^14.1.0"