diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-05-31 16:25:16 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-05-31 16:25:16 +0700 |
commit | 8be1a99cbe06647e70a931ac21e35113cb1dbf21 (patch) | |
tree | c1ca066ee0252d2bed35d26a8d63fa52b3d7a498 /crypto | |
parent | TLS: Improve default server DH group selection (diff) | |
download | BouncyCastle.NET-ed25519-8be1a99cbe06647e70a931ac21e35113cb1dbf21.tar.xz |
Fix data length check
Diffstat (limited to '')
-rw-r--r-- | crypto/src/crypto/BufferedAsymmetricBlockCipher.cs | 2 |
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; |