Fix crash on wrong SNMPv3 security model
Fixed crash caused by incoming SNMPv3 message requesting SNMPv1/v2c security modelpull/186/head
parent
59281af344
commit
7b28a4822c
|
@ -36,6 +36,8 @@ Revision 4.4.5, released 2018-07-XX
|
||||||
- Fixed possible infinite loop in GETBULK response PDU builder
|
- Fixed possible infinite loop in GETBULK response PDU builder
|
||||||
- Fixed memory leak in the `config.delContext()` VACM management harness
|
- Fixed memory leak in the `config.delContext()` VACM management harness
|
||||||
- Fixed `Bits` class initialization when enumeration values are given
|
- Fixed `Bits` class initialization when enumeration values are given
|
||||||
|
- Fixed crash caused by incoming SNMPv3 message requesting SNMPv1/v2c
|
||||||
|
security model
|
||||||
|
|
||||||
Revision 4.4.4, released 2018-01-03
|
Revision 4.4.4, released 2018-01-03
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
|
@ -271,7 +271,7 @@ class SnmpV1MessageProcessingModel(AbstractMessageProcessingModel):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
smHandler = snmpEngine.securityModels[int(securityModel)]
|
smHandler = snmpEngine.securityModels[securityModel]
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise error.StatusInformation(
|
raise error.StatusInformation(
|
||||||
|
|
|
@ -40,8 +40,11 @@ class HeaderData(univ.Sequence):
|
||||||
namedtype.NamedType('msgMaxSize',
|
namedtype.NamedType('msgMaxSize',
|
||||||
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(484, 2147483647))),
|
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(484, 2147483647))),
|
||||||
namedtype.NamedType('msgFlags', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 1))),
|
namedtype.NamedType('msgFlags', univ.OctetString().subtype(subtypeSpec=constraint.ValueSizeConstraint(1, 1))),
|
||||||
|
# NOTE (etingof): constrain SNMPv3 message to only USM+ security models
|
||||||
|
# because SNMPv1/v2c seems incompatible in pysnmp implementation, not sure
|
||||||
|
# if it's intended by the SNMP standard at all...
|
||||||
namedtype.NamedType('msgSecurityModel',
|
namedtype.NamedType('msgSecurityModel',
|
||||||
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(1, 2147483647)))
|
univ.Integer().subtype(subtypeSpec=constraint.ValueRangeConstraint(3, 2147483647)))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue