Переглянути джерело

Fix ArgumentException usage in BlockCipher (#818)

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Igor Milavec 1 рік тому
батько
коміт
4e1e2436af

+ 2 - 2
src/Renci.SshNet/Security/Cryptography/BlockCipher.cs

@@ -78,7 +78,7 @@ namespace Renci.SshNet.Security.Cryptography
             {
                 if (_padding is 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);
@@ -125,7 +125,7 @@ namespace Renci.SshNet.Security.Cryptography
             {
                 if (_padding is null)
                 {
-                    throw new ArgumentException("data");
+                    throw new ArgumentException(string.Format("The data block size is incorrect for {0}.", GetType().Name), "data");
                 }
 
                 input = _padding.Pad(_blockSize, input, offset, length);