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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp

Issue 333753002: Enable security removal in FPDF_Doc_Save (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « core/include/fpdfapi/fpdf_serial.h ('k') | fpdfsdk/include/fpdfsave.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "../../../include/fpdfapi/fpdf_serial.h" 7 #include "../../../include/fpdfapi/fpdf_serial.h"
8 #include "editint.h" 8 #include "editint.h"
9 #define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024) 9 #define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024)
10 #define PDF_XREFSTREAM_MAXSIZE 10000 10 #define PDF_XREFSTREAM_MAXSIZE 10000
11 extern void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_data, FX_LPBYTE& de st_buf, FX_DWORD& dest_size); 11 extern void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_data, FX_LPBYTE& de st_buf, FX_DWORD& dest_size);
12 extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, in t Colors, int BitsPerComponent, int Columns, 12 extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, in t Colors, int BitsPerComponent, int Columns,
13 FX_LPBYTE& dest_buf, FX_DWORD& dest_size); 13 FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
14 extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict); 14 extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict);
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 return m_iStage; 2106 return m_iStage;
2107 } 2107 }
2108 FX_BOOL CPDF_Creator::SetFileVersion(FX_INT32 fileVersion ) 2108 FX_BOOL CPDF_Creator::SetFileVersion(FX_INT32 fileVersion )
2109 { 2109 {
2110 if (fileVersion < 10 || fileVersion > 17) { 2110 if (fileVersion < 10 || fileVersion > 17) {
2111 return FALSE; 2111 return FALSE;
2112 } 2112 }
2113 m_FileVersion = fileVersion; 2113 m_FileVersion = fileVersion;
2114 return TRUE; 2114 return TRUE;
2115 } 2115 }
2116 void CPDF_Creator::RemoveSecurity()
2117 {
2118 ResetStandardSecurity();
2119 m_bSecurityChanged = TRUE;
2120 m_pEncryptDict = NULL;
2121 m_pCryptoHandler = NULL;
2122 }
2116 void CPDF_Creator::ResetStandardSecurity() 2123 void CPDF_Creator::ResetStandardSecurity()
2117 { 2124 {
2118 if ((m_bStandardSecurity || m_bNewCrypto) && m_pCryptoHandler) { 2125 if ((m_bStandardSecurity || m_bNewCrypto) && m_pCryptoHandler) {
2119 delete m_pCryptoHandler; 2126 delete m_pCryptoHandler;
2120 m_pCryptoHandler = NULL; 2127 m_pCryptoHandler = NULL;
2121 } 2128 }
2122 m_bNewCrypto = FALSE; 2129 m_bNewCrypto = FALSE;
2123 if (!m_bStandardSecurity) { 2130 if (!m_bStandardSecurity) {
2124 return; 2131 return;
2125 } 2132 }
2126 if (m_pEncryptDict) { 2133 if (m_pEncryptDict) {
2127 m_pEncryptDict->Release(); 2134 m_pEncryptDict->Release();
2128 m_pEncryptDict = NULL; 2135 m_pEncryptDict = NULL;
2129 } 2136 }
2130 m_bStandardSecurity = FALSE; 2137 m_bStandardSecurity = FALSE;
2131 } 2138 }
OLDNEW
« no previous file with comments | « core/include/fpdfapi/fpdf_serial.h ('k') | fpdfsdk/include/fpdfsave.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698