diff options
Diffstat (limited to 'src/lib/pk_pad/eme_oaep/oaep.cpp')
-rw-r--r-- | src/lib/pk_pad/eme_oaep/oaep.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/pk_pad/eme_oaep/oaep.cpp b/src/lib/pk_pad/eme_oaep/oaep.cpp index 0ae0d8554..1ae1068a7 100644 --- a/src/lib/pk_pad/eme_oaep/oaep.cpp +++ b/src/lib/pk_pad/eme_oaep/oaep.cpp @@ -35,8 +35,10 @@ secure_vector<byte> OAEP::pad(const byte in[], size_t in_length, { key_length /= 8; - if(key_length < in_length + 2*m_Phash.size() + 1) + if(in_length > maximum_input_size(key_length * 8)) + { throw Invalid_Argument("OAEP: Input is too large"); + } secure_vector<byte> out(key_length); |