net-snmp 3.8.0 → 3.8.3

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.
Files changed (3) hide show
  1. package/README.md +13 -1
  2. package/index.js +5 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -3213,7 +3213,19 @@ Example programs are included under the module's `example` directory.
3213
3213
 
3214
3214
  ## Version 3.8.0 - 07/06/2022
3215
3215
 
3216
- * Fix 32-bit unsigned integer writing
3216
+ * Fix 32-bit unsigned integer writing and add integer range checking
3217
+
3218
+ ## Version 3.8.1 - 07/06/2022
3219
+
3220
+ * Add bit string type to varbind reading
3221
+
3222
+ ## Version 3.8.2 - 21/06/2022
3223
+
3224
+ * Fix PDU error status field writing
3225
+
3226
+ ## Version 3.8.3 - 12/09/2022
3227
+
3228
+ * Fix incorrect user level assignment
3217
3229
 
3218
3230
  # License
3219
3231
 
package/index.js CHANGED
@@ -62,6 +62,7 @@ _expandConstantObject (ErrorStatus);
62
62
  var ObjectType = {
63
63
  1: "Boolean",
64
64
  2: "Integer",
65
+ 3: "BitString",
65
66
  4: "OctetString",
66
67
  5: "Null",
67
68
  6: "OID",
@@ -425,6 +426,8 @@ function readVarbindValue (buffer, type) {
425
426
  value = buffer.readBoolean ();
426
427
  } else if (type == ObjectType.Integer) {
427
428
  value = readInt32 (buffer);
429
+ } else if (type == ObjectType.BitString) {
430
+ value = buffer.readBitString();
428
431
  } else if (type == ObjectType.OctetString) {
429
432
  value = buffer.readString (null, true);
430
433
  } else if (type == ObjectType.Null) {
@@ -796,7 +799,7 @@ SimpleResponsePdu.prototype.toBuffer = function (writer) {
796
799
  writer.startSequence (this.type);
797
800
 
798
801
  writeInt32 (writer, ObjectType.Integer, this.id);
799
- writeInt32 (writer, this.errorStatus || 0);
802
+ writeInt32 (writer, ObjectType.Integer, this.errorStatus || 0);
800
803
  writeInt32 (writer, ObjectType.Integer, this.errorIndex || 0);
801
804
  writeVarbinds (writer, this.varbinds);
802
805
  writer.endSequence ();
@@ -1563,7 +1566,7 @@ Message.prototype.createCommunityResponseFromRequest = function (responsePdu) {
1563
1566
  Message.prototype.createV3ResponseFromRequest = function (responsePdu) {
1564
1567
  var responseUser = {
1565
1568
  name: this.user.name,
1566
- level: this.user.name,
1569
+ level: this.user.level,
1567
1570
  authProtocol: this.user.authProtocol,
1568
1571
  authKey: this.user.authKey,
1569
1572
  privProtocol: this.user.privProtocol,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.8.0",
3
+ "version": "3.8.3",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "main": "index.js",
6
6
  "directories": {
7
7
  "example": "example"
8
8
  },
9
9
  "dependencies": {
10
- "asn1-ber": "^1.2.0",
10
+ "asn1-ber": "^1.2.1",
11
11
  "smart-buffer": "^4.1.0"
12
12
  },
13
13
  "devDependencies": {