From 402a5fe833e14f9bd71a1f388ae198d10a6cf80c Mon Sep 17 00:00:00 2001 From: Igor Milavec Date: Tue, 4 May 2021 02:07:18 +0200 Subject: [PATCH] Fix ArgumentException usage in BlockCipher --- src/Renci.SshNet/Security/Cryptography/BlockCipher.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Renci.SshNet/Security/Cryptography/BlockCipher.cs b/src/Renci.SshNet/Security/Cryptography/BlockCipher.cs index 18cf81cb6..aa0134a83 100644 --- a/src/Renci.SshNet/Security/Cryptography/BlockCipher.cs +++ b/src/Renci.SshNet/Security/Cryptography/BlockCipher.cs @@ -77,7 +77,7 @@ public override byte[] Encrypt(byte[] data, int offset, int length) { if (_padding == null) { - throw new ArgumentException("data"); + throw new ArgumentException(string.Format("The data block size is incorrect for {0}.", GetType().Name), "data"); } var paddingLength = _blockSize - (length % _blockSize); data = _padding.Pad(data, offset, length, paddingLength); @@ -133,7 +133,7 @@ public override byte[] Decrypt(byte[] data, int offset, int length) { if (_padding == null) { - throw new ArgumentException("data"); + throw new ArgumentException(string.Format("The data block size is incorrect for {0}.", GetType().Name), "data"); } data = _padding.Pad(_blockSize, data, offset, length); offset = 0;