lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

Trap V3 authentication fails when system uptime over 25 days #255

Closed lextudio-support closed 3 hours ago

lextudio-support commented 3 hours ago

SNMP v3 trap authentication uses EngineGroup.EngineTime, which returns Environment.TickCount. When the system has been up for 25 days or more TickCount is a large negative number. Because of this all v3 trap authentication fails because of this comparison in SecureSnmpContext.HandleMemership:

return parameters.EngineTime.ToInt32() <= Group.EngineTime + 500;

This will almost always return false after 25 days. This is an issue if you want your trap listener to run on a system that's been up for more than 25 days.

Original Reported Date: 2012-04-10T11:15:43.64-07:00 Planned For Release: TritonMate (8.0) Original CodePlex ID: 7232

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

Changed the check in master branch,

https://github.com/lextm/sharpsnmplib/tree/075a2ffb950ba055ab01c01da90487ff1f1116eb

The changes should work in most cases. Please test it.

Will see how to merge this fix back to 7.0 and 6.1.1 releases.

Original Posted Date: 2012-04-13T23:55:46.67-07:00

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

Oops, I should have tagged this as a 7.0 issue. That's the one I'm working with. But I'll try to test this change in the next few days.

Original Posted Date: 2012-04-16T05:49:26.083-07:00

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

Is the "SNMPv3 trap" here means "SNMPv3 Inform"?

A trap message requires no response, so the security parameters contained in the trap is the engine group settings of the trap sender. Why should the trap sender's security parameter be compared with that of the "trap listener"?

Please correct me if anything wrong.

Thanks

Original Posted Date: 2012-08-27T00:40:15.913-07:00

lextudio-support commented 3 hours ago

Original Closed Date: 2013-04-19T17:19:41.497-07:00