Skip to content

Commit

Permalink
Merge pull request #656 from theunisbotha/privprotocol-aes-cisco
Browse files Browse the repository at this point in the history
added support for aes192c and aes256c privacy protocol
  • Loading branch information
SuperQ authored May 24, 2021
2 parents b67ebe0 + ff8dd64 commit ebd489e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *Module) UnmarshalYAML(unmarshal func(interface{}) error) error {
if wp.Auth.PrivPassword == "" {
return fmt.Errorf("priv password is missing, required for SNMPv3 with priv")
}
if wp.Auth.PrivProtocol != "DES" && wp.Auth.PrivProtocol != "AES" && wp.Auth.PrivProtocol != "AES192" && wp.Auth.PrivProtocol != "AES256" {
if wp.Auth.PrivProtocol != "DES" && wp.Auth.PrivProtocol != "AES" && wp.Auth.PrivProtocol != "AES192" && wp.Auth.PrivProtocol != "AES192C" && wp.Auth.PrivProtocol != "AES256" && wp.Auth.PrivProtocol != "AES256C" {
return fmt.Errorf("priv protocol must be DES or AES")
}
fallthrough
Expand Down Expand Up @@ -174,8 +174,12 @@ func (c WalkParams) ConfigureSNMP(g *gosnmp.GoSNMP) {
usm.PrivacyProtocol = gosnmp.AES
case "AES192":
usm.PrivacyProtocol = gosnmp.AES192
case "AES192C":
usm.PrivacyProtocol = gosnmp.AES192C
case "AES256":
usm.PrivacyProtocol = gosnmp.AES256
case "AES256C":
usm.PrivacyProtocol = gosnmp.AES256C
}
}
g.SecurityParameters = usm
Expand Down

0 comments on commit ebd489e

Please sign in to comment.