summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_crypto_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_crypto_handler.h')
-rw-r--r--core/fpdfapi/parser/cpdf_crypto_handler.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.h b/core/fpdfapi/parser/cpdf_crypto_handler.h
index d815e786f6..60f32b70ba 100644
--- a/core/fpdfapi/parser/cpdf_crypto_handler.h
+++ b/core/fpdfapi/parser/cpdf_crypto_handler.h
@@ -17,6 +17,7 @@
#include "core/fxcrt/retain_ptr.h"
class CPDF_Dictionary;
+class CPDF_Object;
class CPDF_SecurityHandler;
class CPDF_CryptoHandler : public Retainable {
@@ -24,16 +25,14 @@ class CPDF_CryptoHandler : public Retainable {
template <typename T, typename... Args>
friend RetainPtr<T> pdfium::MakeRetain(Args&&... args);
+ static bool IsSignatureDictionary(const CPDF_Dictionary* dictionary);
+
bool Init(CPDF_Dictionary* pEncryptDict,
CPDF_SecurityHandler* pSecurityHandler);
- uint32_t DecryptGetSize(uint32_t src_size);
- void* DecryptStart(uint32_t objnum, uint32_t gennum);
- ByteString Decrypt(uint32_t objnum, uint32_t gennum, const ByteString& str);
- bool DecryptStream(void* context,
- const uint8_t* src_buf,
- uint32_t src_size,
- CFX_BinaryBuf& dest_buf);
- bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf);
+
+ std::unique_ptr<CPDF_Object> DecryptObjectTree(
+ std::unique_ptr<CPDF_Object> object);
+
uint32_t EncryptGetSize(uint32_t objnum,
uint32_t version,
const uint8_t* src_buf,
@@ -52,6 +51,15 @@ class CPDF_CryptoHandler : public Retainable {
CPDF_CryptoHandler();
~CPDF_CryptoHandler() override;
+ uint32_t DecryptGetSize(uint32_t src_size);
+ void* DecryptStart(uint32_t objnum, uint32_t gennum);
+ ByteString Decrypt(uint32_t objnum, uint32_t gennum, const ByteString& str);
+ bool DecryptStream(void* context,
+ const uint8_t* src_buf,
+ uint32_t src_size,
+ CFX_BinaryBuf& dest_buf);
+ bool DecryptFinish(void* context, CFX_BinaryBuf& dest_buf);
+
void PopulateKey(uint32_t objnum, uint32_t gennum, uint8_t* key);
void CryptBlock(bool bEncrypt,
uint32_t objnum,