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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp

Issue 1769273002: Reland "Fix chromium-style errors." (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/include/fpdfapi/fpdf_parser.h" 7 #include "core/include/fpdfapi/fpdf_parser.h"
8 8
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 copy_len = sizeof(digest); 49 copy_len = sizeof(digest);
50 } 50 }
51 if (revision >= 3) { 51 if (revision >= 3) {
52 for (int i = 0; i < 50; i++) { 52 for (int i = 0; i < 50; i++) {
53 CRYPT_MD5Generate(digest, copy_len, digest); 53 CRYPT_MD5Generate(digest, copy_len, digest);
54 } 54 }
55 } 55 }
56 FXSYS_memset(key, 0, keylen); 56 FXSYS_memset(key, 0, keylen);
57 FXSYS_memcpy(key, digest, copy_len); 57 FXSYS_memcpy(key, digest, copy_len);
58 } 58 }
59
59 CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() { 60 CPDF_CryptoHandler* CPDF_StandardSecurityHandler::CreateCryptoHandler() {
60 return new CPDF_StandardCryptoHandler; 61 return new CPDF_StandardCryptoHandler;
61 } 62 }
62 63
63 struct PDF_CRYPTOITEM { 64 struct PDF_CRYPTOITEM {
64 int32_t m_Cipher; 65 int32_t m_Cipher;
65 int32_t m_KeyLen; 66 int32_t m_KeyLen;
66 FX_BOOL m_bChecked; 67 FX_BOOL m_bChecked;
67 CPDF_StandardCryptoHandler* m_pCryptoHandler; 68 CPDF_StandardCryptoHandler* m_pCryptoHandler;
68 }; 69 };
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 str = dest_buf; 1027 str = dest_buf;
1027 } 1028 }
1028 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() { 1029 CPDF_StandardCryptoHandler::CPDF_StandardCryptoHandler() {
1029 m_pAESContext = NULL; 1030 m_pAESContext = NULL;
1030 m_Cipher = FXCIPHER_NONE; 1031 m_Cipher = FXCIPHER_NONE;
1031 m_KeyLen = 0; 1032 m_KeyLen = 0;
1032 } 1033 }
1033 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() { 1034 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() {
1034 FX_Free(m_pAESContext); 1035 FX_Free(m_pAESContext);
1035 } 1036 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698