1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00
serenity/Userland/Libraries/LibPDF
Nico Weber 0428308420 LibPDF: Implement 7.6.4.3.3 Algorithm 2.A: Retrieve file encryption key
...for handlers of revision 6.

The spec for this algorithm has several quirks:

1. It describes how to authenticate a password as an owner password,
   but it redundantly inlines the description of algorithm 12 instead
   of referring to it. We just call that algorithm here.

2. It does _not_ describe how to authenticate a password as a user
   password before using the password to compute the file encryption
   key using an intermediate user key, despite the latter step that
   computes the file encryption key refers to the password as
   "user password". I added a call to algorithm 11 to check if the
   password is the user password that isn't in the spec. Maybe I'm
   misunderstanding the spec, but this looks like a spec bug to me.

3. It says "using AES-256 in ECB mode with an initialization vector
   of zero". ECB mode has no initialization vector. CBC mode with
   initialization vector of zero for message length 16 is the same
   as ECB mode though, so maybe that's meant? (In addition to the
   spec being a bit wobbly, using EBC in new software isn't
   recommended, but too late for that.)

SASLprep / stringprep still aren't implemented. For ASCII passwords
(including the important empty password), this is good enough.
2023-07-21 11:55:20 +02:00
..
Fonts LibPDF: Include width in Type1Font glyph cache key 2023-07-21 07:01:09 +02:00
CMakeLists.txt LibPDF: Move code to compute full page contents into Page 2023-07-12 18:22:35 -04:00
ColorSpace.cpp LibPDF: Propogate errors from ColorSpace::color() 2023-07-20 06:56:41 +01:00
ColorSpace.h LibPDF: Propogate errors from ColorSpace::color() 2023-07-20 06:56:41 +01:00
CommonNames.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
CommonNames.h LibPDF: Plumb OE, UE, Perms values to StandardSecurityHandler 2023-07-21 11:55:20 +02:00
Document.cpp LibPDF: Add method to Document to dump a Page and all related objects 2023-07-13 20:29:58 +02:00
Document.h LibPDF: Add method to Document to dump a Page and all related objects 2023-07-13 20:29:58 +02:00
DocumentParser.cpp LibPDF: Fix incorrectly parsing subsections in xref stream 2023-07-18 00:51:23 +02:00
DocumentParser.h LibPDF: Make PDF version accessible on Document 2023-07-11 13:49:17 -04:00
Encoding.cpp LibPDF: Avoid unnecessary HashMap copy, mark other copies 2023-05-19 22:33:57 +02:00
Encoding.h LibPDF: Add char_code -> name mapping function 2023-02-08 19:47:15 +01:00
Encryption.cpp LibPDF: Implement 7.6.4.3.3 Algorithm 2.A: Retrieve file encryption key 2023-07-21 11:55:20 +02:00
Encryption.h LibPDF: Implement 7.6.4.3.3 Algorithm 2.A: Retrieve file encryption key 2023-07-21 11:55:20 +02:00
Error.h LibPDF: Mark PDF::Error nodiscard 2023-07-12 17:03:14 +02:00
Filter.cpp LibGfx: Remove ImageDecoderPlugin::initialize() 2023-07-18 14:34:35 +01:00
Filter.h LibPDF: Improve error support for Filter class 2023-03-02 12:18:53 +01:00
Forward.h Everywhere: Remove unused includes of AK/StdLibExtras.h 2023-01-02 20:27:20 -05:00
Interpolation.cpp LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Interpolation.h LibPDF: Add first interpolation methods 2022-12-10 10:49:03 +01:00
Object.h LibPDF: Make Object::cast<T>() non-const 2023-02-21 00:54:04 +01:00
ObjectDerivatives.cpp LibPDF: Fix quadratic runtime in stream dumping 2023-07-14 09:50:30 -04:00
ObjectDerivatives.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
Operator.h Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
Page.cpp LibPDF: Tweak Page::page_contents() implementation for brevity 2023-07-12 18:22:35 -04:00
Page.h LibPDF: Move code to compute full page contents into Page 2023-07-12 18:22:35 -04:00
Parser.cpp LibPDF: Do not crash on encrypted files that start unluckily 2023-07-12 06:28:15 +02:00
Parser.h LibPDF: Make encrypted object streams work 2023-07-12 17:16:25 +02:00
Reader.cpp LibPDF: Don't consume anything other than EOL in Reader::consume_eol() 2023-03-22 09:04:00 +01:00
Reader.h LibPDF: Fix off-by-one in Reader 2023-07-12 14:19:14 -04:00
Reference.h LibPDF: Make Reference store two u32s instead of one 2023-07-10 17:48:15 +01:00
Renderer.cpp LibPDF: Add a few FIXMEs to set_graphics_state_from_dict 2023-07-21 08:17:12 +02:00
Renderer.h LibPDF: Implement set_flatness_tolerance 2023-07-12 18:22:52 -04:00
Value.cpp Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
Value.h Everywhere: Stop shoving things into ::std and mentioning them as such 2022-12-14 11:44:32 +01:00
XRefTable.h LibPDF: Allow reading documents with incremental updates 2023-02-12 10:55:37 +00:00