slayercat / GoSNMPServer

GoSNMPServer is an SNMP server library fully written in Go. It provides Server Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv2c or SNMPv3.
BSD 2-Clause "Simplified" License
95 stars 50 forks source link

Disabling privacy triggers authentication errors #10

Open vincentbernat opened 2 years ago

vincentbernat commented 2 years ago

Hey!

Applying this patch:

diff --git a/cmd/gosnmpserver/main.go b/cmd/gosnmpserver/main.go
index 1a6c7f4c8faf..3b27dfff29e5 100644
--- a/cmd/gosnmpserver/main.go
+++ b/cmd/gosnmpserver/main.go
@@ -60,9 +62,8 @@ func runServer(c *cli.Context) error {
                                {
                                        UserName:                 c.String("v3Username"),
                                        AuthenticationProtocol:   gosnmp.MD5,
-                                       PrivacyProtocol:          gosnmp.DES,
+                                       PrivacyProtocol:          gosnmp.NoPriv,
                                        AuthenticationPassphrase: c.String("v3AuthenticationPassphrase"),
-                                       PrivacyPassphrase:        c.String("v3PrivacyPassphrase"),
                                },
                        },
                },

We get this:

$ snmpwalk -v 3 -l authNoPriv  -n public -u testuser   -a md5 -A testauth 127.0.0.1:1161 1
Authentication failed for testuser
iso.3.6.1.2.1.1.3.0 = Timeticks: (176926) 0:29:29.26
Authentication failed for testuser
iso.3.6.1.2.1.2.2.1.1.0 = INTEGER: 2