diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-10 21:54:45 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-10 21:54:45 +0700 |
commit | 87e1351939f4f5f03770a4bb4a261ecdbc10545f (patch) | |
tree | 555a1dd836163c7b39940f2a600595ea71b2e814 | |
parent | Address various compiler warnings (diff) | |
download | BouncyCastle.NET-ed25519-87e1351939f4f5f03770a4bb4a261ecdbc10545f.tar.xz |
Add sanity check on input length
-rw-r--r-- | crypto/src/crypto/engines/IesEngine.cs | 4 |
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 |