summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_security_handler.h
AgeCommit message (Collapse)Author
2018-04-03Re-arrange so inline vectors come last in structs.Tom Sepez
This might make the memory tools more effective in finding OOBs. Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf Reviewed-on: https://pdfium-review.googlesource.com/29550 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-11-03Simplify CPDF_SecurityHandler.Lei Zhang
Remove unused method params, impossible code, and mark methods const. Change-Id: Iee95c7b931461e2aadcf2422650a0cd48c8f7696 Reviewed-on: https://pdfium-review.googlesource.com/17790 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-10-10Fix dangling pointer to ID array in CPDF_SecurityHandler.chromium/3238chromium/3237Henrique Nakashima
This was caused by breaking the reference from CPDF_SecurityHandler to CPDF_Parser in https://pdfium-review.googlesource.com/c/pdfium/+/15290 The reference was replaced with a reference to the ID Array and a copy of the password. The issue is that when parsing PDFs with multiple trailers, the trailer containing the ID array may be replaced and destroyed in CPDF_Parser::TrailerData::SetMainTrailer() after being passed to CPDF_SecurityHandler, which would then have a dangling pointer to it. This CL changes the CPDF_SecurityHandler to hold a copy of the original file ID instead of all the ID Array. Bug: chromium:771479,chromium:772376 Change-Id: Id98100502093d890fc2fe6a3da139f910daf38f4 Reviewed-on: https://pdfium-review.googlesource.com/15910 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2017-10-03Improve CPDF_SecurityHandler code style.Artem Strygin
Make m_pEncryptDict as constant value. Change-Id: I4f65578e936eae5bd6afe9bfed20da3ab8e20de3 Reviewed-on: https://pdfium-review.googlesource.com/15350 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-10-03Move initialization of CPDF_CryptoHandler into CPDF_SytnaxParser initialization.Artem Strygin
Change-Id: I70d04f38767f2c17c41407fc9b4fc25519ba32f4 Reviewed-on: https://pdfium-review.googlesource.com/15330 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-03Use ByteString instead raw string for password in CPDF_SecurityHandler.Artem Strygin
Change-Id: I598d42027d033b250134429dfdf92ba043a523a3 Reviewed-on: https://pdfium-review.googlesource.com/15310 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-03Move the CryptoHandler into the SecurityHandlerArtem Strygin
Change-Id: Idb5928e65833641d0443d955e4f2866d0f94cf5f Reviewed-on: https://pdfium-review.googlesource.com/15291 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-10-03Remove the parser from the CPDF_SecurityHandler .Artem Strygin
Change-Id: I9fb651285c158e0f61d19e1aaf0d8bcfd302a22f Reviewed-on: https://pdfium-review.googlesource.com/15290 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-18Convert string class namesRyan Harrison
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-05-24Convert to CFX_UnownedPtr, part 3.Tom Sepez
Remove an explicit clear to re-order the member destruction order. Change-Id: I33da3f3de4b8e8e0cfbdceaf5140e98f5d6f904a Reviewed-on: https://pdfium-review.googlesource.com/5791 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-13Refcount CPDF_CryptoHandlerchromium/3076chromium/3075chromium/3074chromium/3073chromium/3072Tom Sepez
Avoid tracking ownership via m_bLocalCryptoHandler. Also remove m_bEncryptCloned, as it is always false. Replace some methods with direct calls to underlying code. Change-Id: Ifa9d6f721c59d07e3b8e258f76832ca9f2ea0fc9 Reviewed-on: https://pdfium-review.googlesource.com/4111 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2016-11-02Remove FX_BOOL from coretsepez
Review-Url: https://codereview.chromium.org/2477443002
2016-10-26Fix some bool/int mismatches.tsepez
Found by winxfa bot when fx_bool defined to bool. Review-Url: https://codereview.chromium.org/2449293002
2016-10-04Move core/fpdfapi/fpdf_parser to core/fpdfapi/parserdsinclair
BUG=pdfium:603 Review-Url: https://codereview.chromium.org/2392603004