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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_parser.cpp

Issue 2005653002: Distinguish between user and owner passwords. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_document.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_parser.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index acf51de1eafcfc39c3845451a2438b78754756bf..a6b99e5ddb8cb22d401f12f5e6b9077f447a0746 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -1479,16 +1479,15 @@ CPDF_Dictionary* CPDF_Parser::LoadTrailerV4() {
return pObj.release()->AsDictionary();
}
-uint32_t CPDF_Parser::GetPermissions(FX_BOOL bCheckRevision) {
+uint32_t CPDF_Parser::GetPermissions() const {
if (!m_pSecurityHandler)
- return (uint32_t)-1;
+ return 0xFFFFFFFF;
uint32_t dwPermission = m_pSecurityHandler->GetPermissions();
if (m_pEncryptDict && m_pEncryptDict->GetStringBy("Filter") == "Standard") {
+ // See PDF Reference 1.7, page 123, table 3.20.
dwPermission &= 0xFFFFFFFC;
dwPermission |= 0xFFFFF0C0;
- if (bCheckRevision && m_pEncryptDict->GetIntegerBy("R") == 2)
- dwPermission &= 0xFFFFF0FF;
}
return dwPermission;
}
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_document.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698