mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +00:00
LibPDF: Make encrypted object streams work
There were two problems: 1. parse_compressed_object_with_index() parses indirect objects without going through Parser::parse_indirect_value(), so push_reference() / pop_reference() weren't called. Manually call them, both for the indirect object containing the object stream and for the indirect object within the object stream. 2. The indirect object within the object stream got decrypted twice: Once when the object stream data itself got decrypted, and then incorrectly a second time when the object data within the stream was read. To fix, disable encryption while parsing object stream data (since it's already decrypted). The test is from http://opf-labs.org/format-corpus/pdfCabinetOfHorrors/ which according to readme.md at the same location is CC0.
This commit is contained in:
parent
6200097bcc
commit
323d76fbb9
5 changed files with 31 additions and 2 deletions
|
@ -62,10 +62,15 @@ public:
|
|||
m_enable_filters = enabled;
|
||||
}
|
||||
|
||||
protected:
|
||||
void set_encryption_enabled(bool enabled)
|
||||
{
|
||||
m_enable_encryption = enabled;
|
||||
}
|
||||
|
||||
void push_reference(Reference const& ref) { m_current_reference_stack.append(ref); }
|
||||
void pop_reference() { m_current_reference_stack.take_last(); }
|
||||
|
||||
protected:
|
||||
Error error(
|
||||
DeprecatedString const& message
|
||||
#ifdef PDF_DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue