Skip to content

Fix SNMPv3 credential handling - #80

Open
triantos wants to merge 1 commit into
jaroschek:mainfrom
triantos:fix/snmpv3-credential-handling
Open

Fix SNMPv3 credential handling#80
triantos wants to merge 1 commit into
jaroschek:mainfrom
triantos:fix/snmpv3-credential-handling

Conversation

@triantos

Copy link
Copy Markdown

Summary

  • Create a dedicated PySNMP engine for each config entry.
  • Normalize an empty SNMPv3 privacy key to None.

Problem

Home Assistant's shared SNMP engine can retain USM credentials by security
name. When multiple devices use the same SNMPv3 username with different
authentication or privacy settings, their credentials can collide.

Additionally, the config flow stores the optional privacy key as an empty
string for AuthNoPriv configurations. Current PySNMP releases validate that
empty string as a privacy key and reject it for being too short, even though
privacy is disabled.

Testing

Tested with:

  • Home Assistant 2026.8.3
  • PySNMP 7.1.27
  • Eaton 9PX 6000 with a Network-MS card
  • SNMPv3 using MD5 and AuthNoPriv
  • Another Eaton integration using the same username with SHA/AES AuthPriv

Before this change, setup failed with a PySNMP USM WrongValueError.
Afterward, the config entry loads and its entities update normally.

python3 -m compileall -q custom_components and git diff --check both pass.

Create a dedicated PySNMP engine for each config entry so credentials for the same SNMPv3 username do not collide across devices.

Treat an empty privacy key as unset so AuthNoPriv configurations work with current PySNMP releases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant