summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_security_handler.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-03 18:40:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-03 18:40:04 +0000
commite18ac44ddc7eb98e5301e40b5cb19c88215cda13 (patch)
tree10858784f8acadfc48ac38c11a53bc4f566d80c3 /core/fpdfapi/parser/cpdf_security_handler.h
parentff63663ce08c31efa416bc797c2d3ef96759f780 (diff)
downloadpdfium-e18ac44ddc7eb98e5301e40b5cb19c88215cda13.tar.xz
Simplify CPDF_SecurityHandler.
Remove unused method params, impossible code, and mark methods const. Change-Id: Iee95c7b931461e2aadcf2422650a0cd48c8f7696 Reviewed-on: https://pdfium-review.googlesource.com/17790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_security_handler.h')
-rw-r--r--core/fpdfapi/parser/cpdf_security_handler.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/core/fpdfapi/parser/cpdf_security_handler.h b/core/fpdfapi/parser/cpdf_security_handler.h
index 0ae2cfe66c..eb9574386e 100644
--- a/core/fpdfapi/parser/cpdf_security_handler.h
+++ b/core/fpdfapi/parser/cpdf_security_handler.h
@@ -17,8 +17,6 @@
#define FXCIPHER_AES 2
#define FXCIPHER_AES2 3
-#define PDF_ENCRYPT_CONTENT 0
-
class CPDF_Array;
class CPDF_CryptoHandler;
class CPDF_Dictionary;
@@ -32,21 +30,19 @@ class CPDF_SecurityHandler {
bool OnInit(const CPDF_Dictionary* pEncryptDict,
const CPDF_Array* pIdArray,
const ByteString& password);
- uint32_t GetPermissions();
- bool IsMetadataEncrypted() const;
-
void OnCreate(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
+ const CPDF_Array* pIdArray,
const ByteString& user_password,
- const ByteString& owner_password,
- uint32_t type = PDF_ENCRYPT_CONTENT);
-
+ const ByteString& owner_password);
void OnCreate(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
- const ByteString& user_password,
- uint32_t type = PDF_ENCRYPT_CONTENT);
+ const CPDF_Array* pIdArray,
+ const ByteString& user_password);
+
+ uint32_t GetPermissions() const;
+ bool IsMetadataEncrypted() const;
- ByteString GetUserPassword(const ByteString& owner_password, int32_t key_len);
+ ByteString GetUserPassword(const ByteString& owner_password,
+ int32_t key_len) const;
bool CheckPassword(const ByteString& user_password,
bool bOwner,
uint8_t* key,
@@ -59,7 +55,6 @@ class CPDF_SecurityHandler {
private:
bool LoadDict(const CPDF_Dictionary* pEncryptDict);
bool LoadDict(const CPDF_Dictionary* pEncryptDict,
- uint32_t type,
int& cipher,
int& key_len);
@@ -83,11 +78,10 @@ class CPDF_SecurityHandler {
bool bEncryptMetadata,
const uint8_t* key);
void OnCreateInternal(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
+ const CPDF_Array* pIdArray,
const ByteString& user_password,
const ByteString& owner_password,
- bool bDefault,
- uint32_t type);
+ bool bDefault);
bool CheckSecurity(const ByteString& password);
void InitCryptoHandler();