diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-05 18:41:24 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-05 18:41:24 +0700 |
commit | 04443c312ab6c592449d77d7fb5753bd0cf3324d (patch) | |
tree | ade69637449cb0237e08c2f0b89c7684de9a07a9 | |
parent | Add guard in OID parsing (diff) | |
download | BouncyCastle.NET-ed25519-04443c312ab6c592449d77d7fb5753bd0cf3324d.tar.xz |
added argument check for bit block size
-rw-r--r-- | crypto/src/crypto/modes/CfbBlockCipher.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/src/crypto/modes/CfbBlockCipher.cs b/crypto/src/crypto/modes/CfbBlockCipher.cs index 433716535..ed0be407a 100644 --- a/crypto/src/crypto/modes/CfbBlockCipher.cs +++ b/crypto/src/crypto/modes/CfbBlockCipher.cs @@ -29,6 +29,9 @@ namespace Org.BouncyCastle.Crypto.Modes IBlockCipher cipher, int bitBlockSize) { + if (bitBlockSize < 8 || (bitBlockSize & 7) != 0) + throw new ArgumentException("CFB" + bitBlockSize + " not supported", "bitBlockSize"); + this.cipher = cipher; this.blockSize = bitBlockSize / 8; this.IV = new byte[cipher.GetBlockSize()]; |