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/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h" | 7 #include "core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h" |
8 | 8 |
9 #include <time.h> | 9 #include <time.h> |
10 | 10 |
11 #include "core/fdrm/crypto/include/fx_crypt.h" | 11 #include "core/fdrm/crypto/include/fx_crypt.h" |
12 #include "core/include/fpdfapi/cpdf_parser.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
13 #include "core/include/fpdfapi/cpdf_simple_parser.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" |
14 #include "core/include/fpdfapi/ipdf_security_handler.h" | 14 #include "core/fpdfapi/fpdf_parser/ipdf_security_handler.h" |
15 | 15 |
16 IPDF_CryptoHandler::~IPDF_CryptoHandler() {} | 16 IPDF_CryptoHandler::~IPDF_CryptoHandler() {} |
17 | 17 |
18 void IPDF_CryptoHandler::Decrypt(FX_DWORD objnum, | 18 void IPDF_CryptoHandler::Decrypt(FX_DWORD objnum, |
19 FX_DWORD gennum, | 19 FX_DWORD gennum, |
20 CFX_ByteString& str) { | 20 CFX_ByteString& str) { |
21 CFX_BinaryBuf dest_buf; | 21 CFX_BinaryBuf dest_buf; |
22 void* context = DecryptStart(objnum, gennum); | 22 void* context = DecryptStart(objnum, gennum); |
23 DecryptStream(context, (const uint8_t*)str, str.GetLength(), dest_buf); | 23 DecryptStream(context, (const uint8_t*)str, str.GetLength(), dest_buf); |
24 DecryptFinish(context, dest_buf); | 24 DecryptFinish(context, dest_buf); |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 return TRUE; | 333 return TRUE; |
334 } | 334 } |
335 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { | 335 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { |
336 m_pAESContext = NULL; | 336 m_pAESContext = NULL; |
337 m_Cipher = FXCIPHER_NONE; | 337 m_Cipher = FXCIPHER_NONE; |
338 m_KeyLen = 0; | 338 m_KeyLen = 0; |
339 } | 339 } |
340 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { | 340 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { |
341 FX_Free(m_pAESContext); | 341 FX_Free(m_pAESContext); |
342 } | 342 } |
OLD | NEW |