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

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

Issue 1801973002: Move fx_crypto.h and fpdf_text.h out of core/include. (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/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/fdrm/crypto/include/fx_crypt.h"
11 #include "core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h" 12 #include "core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h"
12 #include "core/include/fdrm/fx_crypt.h"
13 #include "core/include/fpdfapi/cpdf_array.h" 13 #include "core/include/fpdfapi/cpdf_array.h"
14 #include "core/include/fpdfapi/cpdf_dictionary.h" 14 #include "core/include/fpdfapi/cpdf_dictionary.h"
15 #include "core/include/fpdfapi/cpdf_object.h" 15 #include "core/include/fpdfapi/cpdf_object.h"
16 #include "core/include/fpdfapi/cpdf_parser.h" 16 #include "core/include/fpdfapi/cpdf_parser.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,
(...skipping 682 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

Powered by Google App Engine
This is Rietveld 408576698