summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-12-05 15:43:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-12-05 15:43:04 +0700
commit1d10c41689109e9aadc0d5e5b458cc943fd702a0 (patch)
tree5f500430de8de5f558043e031479d2bad1be498b /crypto/src
parentFix rounding issue with FF1 (diff)
downloadBouncyCastle.NET-ed25519-1d10c41689109e9aadc0d5e5b458cc943fd702a0.tar.xz
Rfc3394WrapEngine: check input length in Unwrap
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/engines/RFC3394WrapEngine.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/src/crypto/engines/RFC3394WrapEngine.cs b/crypto/src/crypto/engines/RFC3394WrapEngine.cs
index e68e45365..ff3a4e0a0 100644
--- a/crypto/src/crypto/engines/RFC3394WrapEngine.cs
+++ b/crypto/src/crypto/engines/RFC3394WrapEngine.cs
@@ -128,6 +128,10 @@ namespace Org.BouncyCastle.Crypto.Engines
 			{
 				throw new InvalidOperationException("not set for unwrapping");
 			}
+            if (inLen < iv.Length)
+            {
+                throw new InvalidCipherTextException("unwrap data too short");
+            }
 
 			int n = inLen / 8;