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
90 stars 51 forks source link

SNMPv3 AES192 AES256 not work #5

Closed efancier-cn closed 6 months ago

efancier-cn commented 3 years ago

I am using SnmpB(windows exe application) and Pysnmp with Python3, I created an usm as following:

master := GoSNMPServer.MasterAgent{
    Logger: GoSNMPServer.NewDefaultLogger(),
    SecurityConfig: GoSNMPServer.SecurityConfig{
        AuthoritativeEngineBoots: 0,
        Users: []gosnmp.UsmSecurityParameters{
            {
                UserName:                 "admin", //c.String("v3Username"),
                AuthenticationProtocol:   gosnmp.MD5,
                PrivacyProtocol:          gosnmp.AES,
                AuthenticationPassphrase: "12345678", //c.String("v3AuthenticationPassphrase"),
                PrivacyPassphrase:        "12345678", //c.String("v3PrivacyPassphrase"),
            },
        },
    },
    SubAgents: []*GoSNMPServer.SubAgent{
        {
            //CommunityIDs: []string{c.String("community")},
            CommunityIDs: []string{"public"},
            OIDs:         mibImps.All(),
        },
    },
}

the snmp agent work well, while if change priv protocol to AES192 or AES256, SnmpB and Pysnmp can not get correct data, wireshark shows malf package. Tried AES192C and AES256C the result is the same.

efancier-cn commented 3 years ago

Did a little search and found related problem - GoSNMPServer refer to the slayercat/gosnmp module ( v 1.24), which forked from gosnmp/gosnmp ( v1.30.0 as last release) - Can we update the gosnmp module used by GoSNMPServer ?

adenis78 commented 1 year ago

It's not so hard to embed new version. I did so.

slayercat commented 6 months ago

I believe that with the release of the new version, this issue has been resolved. Your feedback is welcome. If the problem persists, please feel free to reopen this issue or create a new one.