mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibPDF: Fix calculation of encryption key
Before this patch, the generation of the encryption key was not working correctly since the lifetime of the underlying data was too short, same inputs would give random encryption keys. Fixes #16668
This commit is contained in:
parent
51f41ea997
commit
5fa8068580
Notes:
sideshowbarker
2024-07-17 04:49:48 +09:00
Author: https://github.com/danners Commit: https://github.com/SerenityOS/serenity/commit/5fa8068580 Pull-request: https://github.com/SerenityOS/serenity/pull/16812 Issue: https://github.com/SerenityOS/serenity/issues/16668 Reviewed-by: https://github.com/trflynn89
1 changed files with 3 additions and 3 deletions
|
@ -256,9 +256,9 @@ ByteBuffer StandardSecurityHandler::compute_encryption_key(ByteBuffer password_s
|
|||
n_bytes.ensure_capacity(m_length);
|
||||
|
||||
while (n_bytes.size() < m_length) {
|
||||
auto out = md5.peek().bytes();
|
||||
for (size_t j = 0; j < out.size() && n_bytes.size() < m_length; j++)
|
||||
n_bytes.append(out[j]);
|
||||
auto out = md5.peek();
|
||||
for (size_t j = 0; j < out.data_length() && n_bytes.size() < m_length; j++)
|
||||
n_bytes.append(out.data[j]);
|
||||
}
|
||||
|
||||
VERIFY(n_bytes.size() == m_length);
|
||||
|
|
Loading…
Reference in a new issue