aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_encryption.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2011-08-11 02:57:52 +0200
committerJay Berkenbilt <ejb@ql.org>2011-08-11 02:57:52 +0200
commit9a1fad40773439a104c25606869e47011351fd90 (patch)
treeb3719789536c222cc924dccc2c9dccba2e4d0362 /libqpdf/QPDF_encryption.cc
parenta42a4068b5ebdf557d2815ee1c72a27ebfefd3f5 (diff)
downloadqpdf-9a1fad40773439a104c25606869e47011351fd90.tar.zst
comments
Diffstat (limited to 'libqpdf/QPDF_encryption.cc')
-rw-r--r--libqpdf/QPDF_encryption.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc
index 7e191a27..d559388b 100644
--- a/libqpdf/QPDF_encryption.cc
+++ b/libqpdf/QPDF_encryption.cc
@@ -472,6 +472,18 @@ QPDF::initializeEncryption()
}
if (this->cf_file != this->cf_stream)
{
+ // The issue for qpdf is that it can't tell the difference
+ // between an embedded file stream and a regular stream.
+ // Search for a comment containing cf_file. To fix this,
+ // we need files with encrypted embedded files and
+ // non-encrypted native streams and vice versa. Also if
+ // it is possible for them to be encrypted in different
+ // ways, we should have some of those too. In cases where
+ // we can detect whether a stream is encrypted or not, we
+ // might want to try to detecet that automatically in
+ // defense of possible logic errors surrounding detection
+ // of embedded file streams, unless that's really clear
+ // from the specification.
throw QPDFExc(qpdf_e_unsupported, this->file->getName(),
"encryption dictionary", this->file->getLastOffset(),
"This document has embedded files that are"
@@ -649,7 +661,9 @@ QPDF::decryptStream(Pipeline*& pipeline, int objid, int generation,
{
// NOTE: We should should use cf_file if this is an
// embedded file, but we can't yet detect embedded
- // file streams as such.
+ // file streams as such. When fixing, search for all
+ // occurrences of cf_file to find a reference to this
+ // comment.
method = this->cf_stream;
}
}