mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:27:34 +00:00
LibCrypto: Fix Hash::MD5's movability
Because MD5 stored a "Bytes {}" wrapper to its internal data buffer, it was not actually movable. However, its use in several parts of the system (such as HashManager) assumed it was, leading to crashes. Fixes #8135
This commit is contained in:
parent
f29036dc98
commit
b205c9814a
2 changed files with 4 additions and 9 deletions
|
@ -57,11 +57,6 @@ class MD5 final : public HashFunction<512, MD5Digest> {
|
|||
public:
|
||||
using HashFunction::update;
|
||||
|
||||
MD5()
|
||||
{
|
||||
m_buffer = Bytes { m_data_buffer, sizeof(m_data_buffer) };
|
||||
}
|
||||
|
||||
virtual void update(const u8*, size_t) override;
|
||||
virtual DigestType digest() override;
|
||||
virtual DigestType peek() override;
|
||||
|
@ -98,7 +93,6 @@ private:
|
|||
|
||||
u32 m_A { MD5Constants::init_A }, m_B { MD5Constants::init_B }, m_C { MD5Constants::init_C }, m_D { MD5Constants::init_D };
|
||||
u32 m_count[2] { 0, 0 };
|
||||
Bytes m_buffer;
|
||||
|
||||
u8 m_data_buffer[64] {};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue