Skip to content

Commit

Permalink
Caught more general exceptions during data decryption.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Feb 5, 2024
1 parent be9fb5a commit 331e0cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SharpSnmpLib/Messaging/MessageFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ private static ISnmpMessage ParseMessage(int first, Stream stream, UserRegistry
{
scope = new Scope((Sequence)privacy.Decrypt(body[3], parameters));
}
catch (DecryptionException)
catch (SnmpException)
{
// handle decryption exception.
// If decryption failed or gave back invalid data, handle parsing exceptions.
return new MalformedMessage(header.MessageId, parameters.UserName, body[3]);
}
}
Expand Down

0 comments on commit 331e0cc

Please sign in to comment.