summaryrefslogtreecommitdiff
path: root/pysnmp/proto
diff options
context:
space:
mode:
authorelie <elie>2013-05-18 13:26:49 +0000
committerelie <elie>2013-05-18 13:26:49 +0000
commitdafca9628cd4db7fb34baacc2022106b2b55f711 (patch)
tree4a7b838c39176c75c34ddc4a412c87df9c442043 /pysnmp/proto
parente389f5d736b4cd6f56d2bc5d80244c6819472ff1 (diff)
downloadpysnmp-dafca9628cd4db7fb34baacc2022106b2b55f711.tar.gz
SNMP credentials management reworked to allow multiple securityNames's in
snmpCommunityEntry and usmUserEntry tables. Changes made to addV1System(), addV3User() functions as well as to their oneliner's wrappers.
Diffstat (limited to 'pysnmp/proto')
-rw-r--r--pysnmp/proto/secmod/rfc3414/service.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/pysnmp/proto/secmod/rfc3414/service.py b/pysnmp/proto/secmod/rfc3414/service.py
index 281c491..bc44b15 100644
--- a/pysnmp/proto/secmod/rfc3414/service.py
+++ b/pysnmp/proto/secmod/rfc3414/service.py
@@ -98,6 +98,9 @@ class SnmpUSMSecurityModel(AbstractSecurityModel):
snmpEngineID.syntax, securityName
)
# Get proto protocols
+ usmUserName = usmUserEntry.getNode(
+ usmUserEntry.name + (2,) + tblIdx1
+ )
usmUserSecurityName = usmUserEntry.getNode(
usmUserEntry.name + (3,) + tblIdx1
)
@@ -131,22 +134,28 @@ class SnmpUSMSecurityModel(AbstractSecurityModel):
mibInstrumController.writeVars(
((usmUserEntry.name + (13,) + tblIdx2, 4),)
)
- # Set protocols
+
+ # Set usernames
+ usmUserEntry.getNode(
+ usmUserEntry.name + (2,) + tblIdx2
+ ).syntax = usmUserName.syntax
usmUserEntry.getNode(
usmUserEntry.name + (3,) + tblIdx2
).syntax = usmUserSecurityName.syntax
+
+ # Store a reference to original row
+ usmUserEntry.getNode(
+ usmUserEntry.name + (4,) + tblIdx2
+ ).syntax = usmUserCloneFrom.syntax.clone(tblIdx1)
+
+ # Set protocols
usmUserEntry.getNode(
usmUserEntry.name + (5,) + tblIdx2
).syntax = usmUserAuthProtocol.syntax
usmUserEntry.getNode(
usmUserEntry.name + (8,) + tblIdx2
).syntax = usmUserPrivProtocol.syntax
-
- # Store a reference to original row
- usmUserEntry.getNode(
- usmUserEntry.name + (4,) + tblIdx2
- ).syntax = usmUserCloneFrom.syntax.clone(tblIdx1)
-
+
# Localize and set keys
pysnmpUsmKeyEntry, = mibInstrumController.mibBuilder.importSymbols(
'PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry'