#include "core/fpdfapi/parser/cpdf_crypto_handler.h"
#include <time.h>
#include <algorithm>
#include <stack>
#include <utility>
#include "constants/form_fields.h"
#include "core/fdrm/fx_crypt.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_object_walker.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fpdfapi/parser/cpdf_security_handler.h"
#include "core/fpdfapi/parser/cpdf_simple_parser.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/check_op.h"
#include "core/fxcrt/fx_memcpy_wrappers.h"
#include "core/fxcrt/stl_util.h"
namespace {
constexpr char kContentsKey[] = …;
constexpr char kTypeKey[] = …;
}
bool CPDF_CryptoHandler::IsSignatureDictionary(
const CPDF_Dictionary* dictionary) { … }
DataVector<uint8_t> CPDF_CryptoHandler::EncryptContent(
uint32_t objnum,
uint32_t gennum,
pdfium::span<const uint8_t> source) const { … }
struct AESCryptContext { … };
void* CPDF_CryptoHandler::DecryptStart(uint32_t objnum, uint32_t gennum) { … }
bool CPDF_CryptoHandler::DecryptStream(void* context,
pdfium::span<const uint8_t> source,
BinaryBuffer& dest_buf) { … }
bool CPDF_CryptoHandler::DecryptFinish(void* context, BinaryBuffer& dest_buf) { … }
ByteString CPDF_CryptoHandler::Decrypt(uint32_t objnum,
uint32_t gennum,
const ByteString& str) { … }
size_t CPDF_CryptoHandler::DecryptGetSize(size_t src_size) { … }
bool CPDF_CryptoHandler::IsCipherAES() const { … }
bool CPDF_CryptoHandler::DecryptObjectTree(RetainPtr<CPDF_Object> object) { … }
CPDF_CryptoHandler::CPDF_CryptoHandler(Cipher cipher,
pdfium::span<const uint8_t> key)
: … { … }
CPDF_CryptoHandler::~CPDF_CryptoHandler() = default;
void CPDF_CryptoHandler::PopulateKey(uint32_t objnum,
uint32_t gennum,
uint8_t* key) const { … }