diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-09 12:58:17 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-09 12:58:17 +0700 |
commit | b5b1ad3e9abdaada947513b5a4940e93c4aae210 (patch) | |
tree | 60ef6c08160cfecd581a1a2a906b1836d0e454ab /crypto/src | |
parent | Comments (diff) | |
download | BouncyCastle.NET-ed25519-b5b1ad3e9abdaada947513b5a4940e93c4aae210.tar.xz |
Add explicit length check on OAEP input
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/crypto/encodings/OaepEncoding.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/src/crypto/encodings/OaepEncoding.cs b/crypto/src/crypto/encodings/OaepEncoding.cs index cb23b1710..9f5c563c2 100644 --- a/crypto/src/crypto/encodings/OaepEncoding.cs +++ b/crypto/src/crypto/encodings/OaepEncoding.cs @@ -137,6 +137,8 @@ namespace Org.BouncyCastle.Crypto.Encodings int inOff, int inLen) { + Check.DataLength(inLen > GetInputBlockSize(), "input data too long"); + byte[] block = new byte[GetInputBlockSize() + 1 + 2 * defHash.Length]; // |