Skip to content

Commit 8e1e6e5

Browse files
committed
feat(snmp v3): add support for skipping message verification
1 parent 53efbd8 commit 8e1e6e5

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

shard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: snmp
2-
version: 0.9.5
2+
version: 0.9.6
33

44
dependencies:
55
bindata:

src/snmp/v3/message.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SNMP::V3::Message < SNMP::Message
3535
else
3636
ScopedPDU.new(snmp[3])
3737
end
38-
verify(security, snmp[3]) if @flags.authentication?
38+
verify(security, snmp[3]) if security.verify_messages && @flags.authentication?
3939
elsif snmp[3].tag == UniversalTags::Sequence
4040
# This will read authenticated requests even if we don't have security details
4141
@scoped_pdu = ScopedPDU.new(snmp[3])

src/snmp/v3/security.cr

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class SNMP::V3::Security
2424
getter security_level : MessageFlags
2525
getter auth_protocol : AuthProtocol
2626
getter priv_protocol : PrivacyProtocol
27+
getter verify_messages : Bool
2728
@auth_pass_key : Bytes = Bytes.new(0)
2829
@priv_pass_key : Bytes = Bytes.new(0)
2930
@digest : OpenSSL::Digest
@@ -34,7 +35,8 @@ class SNMP::V3::Security
3435
@auth_protocol = AuthProtocol::MD5,
3536
@auth_password = "",
3637
@priv_protocol = PrivacyProtocol::DES,
37-
@priv_password = ""
38+
@priv_password = "",
39+
@verify_messages = true
3840
)
3941
@security_level = if !@priv_password.empty?
4042
MessageFlags::Authentication | MessageFlags::Privacy

0 commit comments

Comments
 (0)