Bump snmp lib and add extra SHAtypes

This commit is contained in:
Dave Conway-Jones
2025-10-02 10:01:51 +01:00
parent e9f9b11cf9
commit 3f36f20e0d
4 changed files with 29 additions and 5 deletions

View File

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

View File

@@ -93,6 +93,10 @@
<select type="text" id="node-input-authprot" style="width:150px;">
<option value="MD5">MD5</option>
<option value="SHA">SHA</option>
<option value="SHA224">SHA224</option>
<option value="SHA256">SHA256</option>
<option value="SHA384">SHA384</option>
<option value="SHA512">SHA512</option>
</select>
</div>
<div class="form-row form-row-snmpv3 form-row-snmpv3-auth">

View File

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

View File

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