mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
LibPDF: Some preparatory work for AESV3
This detects AESV3, and copies over the spec comments explaining what needs to be done, but doesn't actually do it yet. AESV3 is technically PDF 2.0-only, but https://cipa.jp/std/documents/download_e.html?CIPA_DC-007-2021_E has a 1.7 PDF that uses it. Previously we'd claim that we need a password to decrypt it. Now, we cleanly crash with a TODO() \o/
This commit is contained in:
parent
b14d51ba1b
commit
281e3158c0
2 changed files with 152 additions and 21 deletions
|
@ -19,6 +19,7 @@ enum class CryptFilterMethod {
|
|||
None,
|
||||
V2, // RC4
|
||||
AESV2,
|
||||
AESV3,
|
||||
};
|
||||
|
||||
class SecurityHandler : public RefCounted<SecurityHandler> {
|
||||
|
@ -53,10 +54,15 @@ protected:
|
|||
private:
|
||||
void crypt(NonnullRefPtr<Object>, Reference reference, Crypto::Cipher::Intent) const;
|
||||
|
||||
ByteBuffer compute_user_password_value_v2(ByteBuffer password_string);
|
||||
ByteBuffer compute_user_password_value_v3_and_newer(ByteBuffer password_string);
|
||||
ByteBuffer compute_user_password_value_r2(ByteBuffer password_string);
|
||||
ByteBuffer compute_user_password_value_r3_to_r5(ByteBuffer password_string);
|
||||
|
||||
ByteBuffer compute_encryption_key(ByteBuffer password_string);
|
||||
bool authenticate_user_password_r2_to_r5(StringView password_string);
|
||||
bool authenticate_user_password_r6_and_later(StringView password_string);
|
||||
|
||||
ByteBuffer compute_encryption_key_r2_to_r5(ByteBuffer password_string);
|
||||
ByteBuffer compute_encryption_key_r6_and_later(ByteBuffer password_string);
|
||||
ByteBuffer computing_a_hash_r6_and_later(ByteBuffer password_string);
|
||||
|
||||
Document* m_document;
|
||||
size_t m_revision;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue