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

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.cpp

Issue 1800523005: Move core/src/ up to core/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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/src/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h" 7 #include "core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h"
8 8
9 #include <time.h> 9 #include <time.h>
10 10
11 #include "core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h"
11 #include "core/include/fdrm/fx_crypt.h" 12 #include "core/include/fdrm/fx_crypt.h"
12 #include "core/include/fpdfapi/cpdf_array.h" 13 #include "core/include/fpdfapi/cpdf_array.h"
13 #include "core/include/fpdfapi/cpdf_dictionary.h" 14 #include "core/include/fpdfapi/cpdf_dictionary.h"
15 #include "core/include/fpdfapi/cpdf_object.h"
14 #include "core/include/fpdfapi/cpdf_parser.h" 16 #include "core/include/fpdfapi/cpdf_parser.h"
15 #include "core/include/fpdfapi/cpdf_object.h"
16 #include "core/src/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h"
17 17
18 namespace { 18 namespace {
19 19
20 const uint8_t defpasscode[32] = { 20 const uint8_t defpasscode[32] = {
21 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 21 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e,
22 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 22 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68,
23 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a}; 23 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a};
24 24
25 void CalcEncryptKey(CPDF_Dictionary* pEncrypt, 25 void CalcEncryptKey(CPDF_Dictionary* pEncrypt,
26 const uint8_t* password, 26 const uint8_t* password,
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 buf[11] = 'b'; 705 buf[11] = 'b';
706 uint8_t* aes = FX_Alloc(uint8_t, 2048); 706 uint8_t* aes = FX_Alloc(uint8_t, 2048);
707 CRYPT_AESSetKey(aes, 16, key, 32, TRUE); 707 CRYPT_AESSetKey(aes, 16, key, 32, TRUE);
708 uint8_t iv[16], buf1[16]; 708 uint8_t iv[16], buf1[16];
709 FXSYS_memset(iv, 0, 16); 709 FXSYS_memset(iv, 0, 16);
710 CRYPT_AESSetIV(aes, iv); 710 CRYPT_AESSetIV(aes, iv);
711 CRYPT_AESEncrypt(aes, buf1, buf, 16); 711 CRYPT_AESEncrypt(aes, buf1, buf, 16);
712 FX_Free(aes); 712 FX_Free(aes);
713 pEncryptDict->SetAtString("Perms", CFX_ByteString(buf1, 16)); 713 pEncryptDict->SetAtString("Perms", CFX_ByteString(buf1, 16));
714 } 714 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h ('k') | core/fpdfapi/fpdf_parser/cpdf_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698