From 4e1e2436af54fbd29da313c747b72823c9b47765 Mon Sep 17 00:00:00 2001 From: Igor Milavec Date: Sat, 27 Apr 2024 20:52:34 +0200 Subject: [PATCH] Fix ArgumentException usage in BlockCipher (#818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Wojciech Nagórski Co-authored-by: Rob Hague --- 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 3e7e6541..26aa6d1b 100644 --- a/src/Renci.SshNet/Security/Cryptography/BlockCipher.cs +++ b/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);