summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/parser/cpdf_security_handler.cpp10
-rw-r--r--core/fpdfapi/parser/cpdf_security_handler.h8
2 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp
index 4a33de116f..26202ec3ee 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_security_handler.cpp
@@ -26,7 +26,7 @@ const uint8_t defpasscode[32] = {
0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68,
0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a};
-void CalcEncryptKey(CPDF_Dictionary* pEncrypt,
+void CalcEncryptKey(const CPDF_Dictionary* pEncrypt,
const ByteString& password,
uint8_t* key,
int keylen,
@@ -99,7 +99,7 @@ CPDF_SecurityHandler::CPDF_SecurityHandler()
CPDF_SecurityHandler::~CPDF_SecurityHandler() {}
-bool CPDF_SecurityHandler::OnInit(CPDF_Dictionary* pEncryptDict,
+bool CPDF_SecurityHandler::OnInit(const CPDF_Dictionary* pEncryptDict,
const CPDF_Array* pIdArray,
const ByteString& password) {
m_pIdArray = pIdArray;
@@ -129,7 +129,7 @@ uint32_t CPDF_SecurityHandler::GetPermissions() {
return m_bOwnerUnlocked ? 0xFFFFFFFF : m_Permissions;
}
-static bool LoadCryptInfo(CPDF_Dictionary* pEncryptDict,
+static bool LoadCryptInfo(const CPDF_Dictionary* pEncryptDict,
const ByteString& name,
int& cipher,
int& keylen) {
@@ -175,7 +175,7 @@ static bool LoadCryptInfo(CPDF_Dictionary* pEncryptDict,
return IsValidKeyLengthForCipher(cipher, keylen);
}
-bool CPDF_SecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict) {
+bool CPDF_SecurityHandler::LoadDict(const CPDF_Dictionary* pEncryptDict) {
m_pEncryptDict = pEncryptDict;
m_Version = pEncryptDict->GetIntegerFor("V");
m_Revision = pEncryptDict->GetIntegerFor("R");
@@ -191,7 +191,7 @@ bool CPDF_SecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict) {
return LoadCryptInfo(pEncryptDict, strf_name, m_Cipher, m_KeyLen);
}
-bool CPDF_SecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict,
+bool CPDF_SecurityHandler::LoadDict(const CPDF_Dictionary* pEncryptDict,
uint32_t type,
int& cipher,
int& key_len) {
diff --git a/core/fpdfapi/parser/cpdf_security_handler.h b/core/fpdfapi/parser/cpdf_security_handler.h
index c92dc46862..15be505705 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.h
+++ b/core/fpdfapi/parser/cpdf_security_handler.h
@@ -29,7 +29,7 @@ class CPDF_SecurityHandler {
CPDF_SecurityHandler();
~CPDF_SecurityHandler();
- bool OnInit(CPDF_Dictionary* pEncryptDict,
+ bool OnInit(const CPDF_Dictionary* pEncryptDict,
const CPDF_Array* pIdArray,
const ByteString& password);
uint32_t GetPermissions();
@@ -57,8 +57,8 @@ class CPDF_SecurityHandler {
}
private:
- bool LoadDict(CPDF_Dictionary* pEncryptDict);
- bool LoadDict(CPDF_Dictionary* pEncryptDict,
+ bool LoadDict(const CPDF_Dictionary* pEncryptDict);
+ bool LoadDict(const CPDF_Dictionary* pEncryptDict,
uint32_t type,
int& cipher,
int& key_len);
@@ -94,7 +94,7 @@ class CPDF_SecurityHandler {
int m_Version;
int m_Revision;
- UnownedPtr<CPDF_Dictionary> m_pEncryptDict;
+ UnownedPtr<const CPDF_Dictionary> m_pEncryptDict;
UnownedPtr<const CPDF_Array> m_pIdArray;
uint32_t m_Permissions;
int m_Cipher;