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 "core/include/fpdfapi/fpdf_parser.h" |
| 8 |
7 #include <time.h> | 9 #include <time.h> |
8 #include "../../../include/fpdfapi/fpdf_parser.h" | 10 |
9 #include "../../../include/fdrm/fx_crypt.h" | 11 #include "core/include/fdrm/fx_crypt.h" |
| 12 |
10 const uint8_t defpasscode[32] = { | 13 const uint8_t defpasscode[32] = { |
11 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, | 14 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, |
12 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, | 15 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, |
13 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a}; | 16 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a}; |
14 void CalcEncryptKey(CPDF_Dictionary* pEncrypt, | 17 void CalcEncryptKey(CPDF_Dictionary* pEncrypt, |
15 const uint8_t* password, | 18 const uint8_t* password, |
16 FX_DWORD pass_size, | 19 FX_DWORD pass_size, |
17 uint8_t* key, | 20 uint8_t* key, |
18 int keylen, | 21 int keylen, |
19 FX_BOOL bIgnoreMeta, | 22 FX_BOOL bIgnoreMeta, |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 str = dest_buf; | 1038 str = dest_buf; |
1036 } | 1039 } |
1037 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { | 1040 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { |
1038 m_pAESContext = NULL; | 1041 m_pAESContext = NULL; |
1039 m_Cipher = FXCIPHER_NONE; | 1042 m_Cipher = FXCIPHER_NONE; |
1040 m_KeyLen = 0; | 1043 m_KeyLen = 0; |
1041 } | 1044 } |
1042 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { | 1045 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { |
1043 FX_Free(m_pAESContext); | 1046 FX_Free(m_pAESContext); |
1044 } | 1047 } |
OLD | NEW |