summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-10 21:56:16 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-10 21:56:16 +0700
commiteb9c7a42dff89fbc88d5dc0075565b837bda7675 (patch)
tree834a44e5143348c1b66851d3866fad6ca8e3fa6e /crypto/src
parentMerge branch 'master' of git.bouncycastle.org:bc-csharp into pcl (diff)
parentAdd sanity check on input length (diff)
downloadBouncyCastle.NET-ed25519-eb9c7a42dff89fbc88d5dc0075565b837bda7675.tar.xz
Merge branch 'master' of git.bouncycastle.org:bc-csharp into pcl
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/engines/IesEngine.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/src/crypto/engines/IesEngine.cs b/crypto/src/crypto/engines/IesEngine.cs

index a2004a9d6..9139f3ffc 100644 --- a/crypto/src/crypto/engines/IesEngine.cs +++ b/crypto/src/crypto/engines/IesEngine.cs
@@ -97,6 +97,10 @@ namespace Org.BouncyCastle.Crypto.Engines kdf.Init(kParam); + // Ensure that the length of the input is greater than the MAC in bytes + if (inLen <= mac.GetMacSize()) + throw new InvalidCipherTextException("Length of input must be greater than the MAC"); + inLen -= mac.GetMacSize(); if (cipher == null) // stream mode