Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_security_handler.h

Issue 2392603004: Move core/fpdfapi/fpdf_parser to core/fpdfapi/parser (Closed)
Patch Set: Rebase to master Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_reference.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_security_handler.h
diff --git a/core/fpdfapi/fpdf_parser/cpdf_security_handler.h b/core/fpdfapi/fpdf_parser/cpdf_security_handler.h
deleted file mode 100644
index 33c4c0c17da7f12642b1305425cb1279ac10b289..0000000000000000000000000000000000000000
--- a/core/fpdfapi/fpdf_parser/cpdf_security_handler.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_SECURITY_HANDLER_H_
-#define CORE_FPDFAPI_FPDF_PARSER_CPDF_SECURITY_HANDLER_H_
-
-#include "core/fxcrt/fx_string.h"
-#include "core/fxcrt/fx_system.h"
-
-#define FXCIPHER_NONE 0
-#define FXCIPHER_RC4 1
-#define FXCIPHER_AES 2
-#define FXCIPHER_AES2 3
-
-#define PDF_ENCRYPT_CONTENT 0
-
-class CPDF_Array;
-class CPDF_CryptoHandler;
-class CPDF_Dictionary;
-class CPDF_Parser;
-
-class CPDF_SecurityHandler {
- public:
- CPDF_SecurityHandler();
- ~CPDF_SecurityHandler();
-
- FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);
- uint32_t GetPermissions();
- FX_BOOL GetCryptInfo(int& cipher, const uint8_t*& buffer, int& keylen);
- bool IsMetadataEncrypted() const;
- CPDF_CryptoHandler* CreateCryptoHandler();
-
- void OnCreate(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
- const uint8_t* user_pass,
- uint32_t user_size,
- const uint8_t* owner_pass,
- uint32_t owner_size,
- uint32_t type = PDF_ENCRYPT_CONTENT);
-
- void OnCreate(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
- const uint8_t* user_pass,
- uint32_t user_size,
- uint32_t type = PDF_ENCRYPT_CONTENT);
-
- CFX_ByteString GetUserPassword(const uint8_t* owner_pass,
- uint32_t pass_size,
- int32_t key_len);
- int CheckPassword(const uint8_t* password,
- uint32_t pass_size,
- FX_BOOL bOwner,
- uint8_t* key,
- int key_len);
-
- private:
- FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict);
- FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict,
- uint32_t type,
- int& cipher,
- int& key_len);
-
- FX_BOOL CheckUserPassword(const uint8_t* password,
- uint32_t pass_size,
- FX_BOOL bIgnoreEncryptMeta,
- uint8_t* key,
- int32_t key_len);
-
- FX_BOOL CheckOwnerPassword(const uint8_t* password,
- uint32_t pass_size,
- uint8_t* key,
- int32_t key_len);
- FX_BOOL AES256_CheckPassword(const uint8_t* password,
- uint32_t size,
- FX_BOOL bOwner,
- uint8_t* key);
- void AES256_SetPassword(CPDF_Dictionary* pEncryptDict,
- const uint8_t* password,
- uint32_t size,
- FX_BOOL bOwner,
- const uint8_t* key);
- void AES256_SetPerms(CPDF_Dictionary* pEncryptDict,
- uint32_t permission,
- FX_BOOL bEncryptMetadata,
- const uint8_t* key);
- void OnCreate(CPDF_Dictionary* pEncryptDict,
- CPDF_Array* pIdArray,
- const uint8_t* user_pass,
- uint32_t user_size,
- const uint8_t* owner_pass,
- uint32_t owner_size,
- FX_BOOL bDefault,
- uint32_t type);
- FX_BOOL CheckSecurity(int32_t key_len);
-
- int m_Version;
- int m_Revision;
- CPDF_Parser* m_pParser;
- CPDF_Dictionary* m_pEncryptDict;
- uint32_t m_Permissions;
- int m_Cipher;
- uint8_t m_EncryptKey[32];
- int m_KeyLen;
- bool m_bOwnerUnlocked;
-};
-
-#endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_SECURITY_HANDLER_H_
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_reference.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698