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

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

Issue 429593005: Fix a few more warnings in chromium_code mode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 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 <time.h> 7 #include <time.h>
8 #include "../../../include/fpdfapi/fpdf_parser.h" 8 #include "../../../include/fpdfapi/fpdf_parser.h"
9 #include "../../../include/fdrm/fx_crypt.h" 9 #include "../../../include/fdrm/fx_crypt.h"
10 const FX_BYTE defpasscode[32] = { 10 const FX_BYTE defpasscode[32] = {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, ke y_len); 100 return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey, ke y_len);
101 } 101 }
102 FX_DWORD CPDF_StandardSecurityHandler::GetPermissions() 102 FX_DWORD CPDF_StandardSecurityHandler::GetPermissions()
103 { 103 {
104 return m_Permissions; 104 return m_Permissions;
105 } 105 }
106 static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, FX_BSTR name, int& cipher, int& keylen) 106 static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict, FX_BSTR name, int& cipher, int& keylen)
107 { 107 {
108 int Version = pEncryptDict->GetInteger(FX_BSTRC("V")); 108 int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
109 int Revision = pEncryptDict->GetInteger(FX_BSTRC("R"));
110 cipher = FXCIPHER_RC4; 109 cipher = FXCIPHER_RC4;
111 keylen = 0; 110 keylen = 0;
112 if (Version >= 4) { 111 if (Version >= 4) {
113 CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF")); 112 CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF"));
114 if (pCryptFilters == NULL) { 113 if (pCryptFilters == NULL) {
115 return FALSE; 114 return FALSE;
116 } 115 }
117 if (name == FX_BSTRC("Identity")) { 116 if (name == FX_BSTRC("Identity")) {
118 cipher = FXCIPHER_NONE; 117 cipher = FXCIPHER_NONE;
119 } else { 118 } else {
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 m_pAESContext = NULL; 950 m_pAESContext = NULL;
952 m_Cipher = FXCIPHER_NONE; 951 m_Cipher = FXCIPHER_NONE;
953 m_KeyLen = 0; 952 m_KeyLen = 0;
954 } 953 }
955 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler() 954 CPDF_StandardCryptoHandler::~CPDF_StandardCryptoHandler()
956 { 955 {
957 if (m_pAESContext) { 956 if (m_pAESContext) {
958 FX_Free(m_pAESContext); 957 FX_Free(m_pAESContext);
959 } 958 }
960 } 959 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser.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