OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <time.h> | 7 #include <time.h> |
8 #include "../../../include/fpdfapi/fpdf_parser.h" | 8 #include "../../../include/fpdfapi/fpdf_parser.h" |
9 #include "../../../include/fdrm/fx_crypt.h" | 9 #include "../../../include/fdrm/fx_crypt.h" |
10 const FX_BYTE defpasscode[32] = { | 10 const FX_BYTE defpasscode[32] = { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 CRYPT_MD5Generate(digest, copy_len, digest); | 47 CRYPT_MD5Generate(digest, copy_len, digest); |
48 } | 48 } |
49 } | 49 } |
50 FXSYS_memset32(key, 0, keylen); | 50 FXSYS_memset32(key, 0, keylen); |
51 FXSYS_memcpy32(key, digest, copy_len); | 51 FXSYS_memcpy32(key, digest, copy_len); |
52 } | 52 } |
53 CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() | 53 CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() |
54 { | 54 { |
55 return FX_NEW CPDF_StandardCryptoHandler; | 55 return FX_NEW CPDF_StandardCryptoHandler; |
56 } | 56 } |
57 typedef struct _PDF_CRYPTOITEM : public CFX_Object { | 57 typedef struct _PDF_CRYPTOITEM { |
58 FX_INT32 m_Cipher; | 58 FX_INT32 m_Cipher; |
59 FX_INT32 m_KeyLen; | 59 FX_INT32 m_KeyLen; |
60 FX_BOOL m_bChecked; | 60 FX_BOOL m_bChecked; |
61 CPDF_StandardCryptoHandler* m_pCryptoHandler; | 61 CPDF_StandardCryptoHandler* m_pCryptoHandler; |
62 } PDF_CRYPTOITEM; | 62 } PDF_CRYPTOITEM; |
63 CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler() | 63 CPDF_StandardSecurityHandler::CPDF_StandardSecurityHandler() |
64 { | 64 { |
65 m_Version = 0; | 65 m_Version = 0; |
66 m_Revision = 0; | 66 m_Revision = 0; |
67 m_pParser = NULL; | 67 m_pParser = NULL; |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 m_pAESContext = NULL; | 950 m_pAESContext = NULL; |
951 m_Cipher = FXCIPHER_NONE; | 951 m_Cipher = FXCIPHER_NONE; |
952 m_KeyLen = 0; | 952 m_KeyLen = 0; |
953 } | 953 } |
954 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() | 954 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() |
955 { | 955 { |
956 if (m_pAESContext) { | 956 if (m_pAESContext) { |
957 FX_Free(m_pAESContext); | 957 FX_Free(m_pAESContext); |
958 } | 958 } |
959 } | 959 } |
OLD | NEW |