mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibCrypto: Do not silently ignore key size mismatch
Before, when the actually passed key was too long, the extra bytes were silently ignored. This can lead to all sorts of trouble, so ... don't do that. The original intention was maybe to support non-integer amounts of key bytes. But that doesn't happen anyway with AES.
This commit is contained in:
parent
e0b7833078
commit
1c60ea235e
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ void AESCipherKey::expand_encrypt_key(const ByteBuffer& user_key, size_t bits)
|
|||
|
||||
ASSERT(!user_key.is_null());
|
||||
ASSERT(is_valid_key_size(bits));
|
||||
ASSERT(user_key.size() >= bits / 8);
|
||||
ASSERT(user_key.size() == bits / 8);
|
||||
|
||||
round_key = round_keys();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue