summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2024-05-31 16:25:16 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2024-05-31 16:25:16 +0700
commit8be1a99cbe06647e70a931ac21e35113cb1dbf21 (patch)
treec1ca066ee0252d2bed35d26a8d63fa52b3d7a498 /crypto
parentTLS: Improve default server DH group selection (diff)
downloadBouncyCastle.NET-ed25519-8be1a99cbe06647e70a931ac21e35113cb1dbf21.tar.xz
Fix data length check
Diffstat (limited to '')
-rw-r--r--crypto/src/crypto/BufferedAsymmetricBlockCipher.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs b/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs
index be933a028..382d6a2cb 100644
--- a/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs
+++ b/crypto/src/crypto/BufferedAsymmetricBlockCipher.cs
@@ -131,7 +131,7 @@ namespace Org.BouncyCastle.Crypto
 #if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
         public override int ProcessBytes(ReadOnlySpan<byte> input, Span<byte> output)
 		{
-			Check.DataLength(input, buffer.Length - bufOff, "attempt to process message too long for cipher");
+            Check.DataLength(input.Length > buffer.Length - bufOff, "attempt to process message too long for cipher");
 
 			input.CopyTo(buffer.AsSpan(bufOff));
             bufOff += input.Length;