diff options
Diffstat (limited to 'libqpdf/QPDF_encryption.cc')
-rw-r--r-- | libqpdf/QPDF_encryption.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc index 00bd697e..2ff48df9 100644 --- a/libqpdf/QPDF_encryption.cc +++ b/libqpdf/QPDF_encryption.cc @@ -1022,6 +1022,20 @@ QPDF::initializeEncryption() this->m->encp->cf_string = interpretCF(this->m->encp, StrF); if (EFF.isName()) { + // qpdf does not use this for anything other than + // informational purposes. This is intended to instruct + // conforming writers on which crypt filter should be used + // when new file attachments are added to a PDF file, but + // qpdf never generates encrypted files with non-default + // crypt filters. Prior to 10.2, I was under the mistaken + // impression that this was supposed to be used for + // decrypting attachments, but the code was wrong in a way + // that turns out not to have mattered because no writers + // were generating files the way I was imagining. Still, + // providing this information could be useful when looking + // at a file generated by something else, such as Acrobat + // when specifying that only attachments should be + // encrypted. this->m->encp->cf_file = interpretCF(this->m->encp, EFF); } else @@ -1224,7 +1238,6 @@ QPDF::decryptStream(PointerHolder<EncryptionParameters> encp, QPDF& qpdf_for_warning, Pipeline*& pipeline, int objid, int generation, QPDFObjectHandle& stream_dict, - bool is_attachment_stream, std::vector<PointerHolder<Pipeline> >& heap) { std::string type; @@ -1296,15 +1309,7 @@ QPDF::decryptStream(PointerHolder<EncryptionParameters> encp, } else { - if (is_attachment_stream) - { - QTC::TC("qpdf", "QPDF_encryption attachment stream"); - method = encp->cf_file; - } - else - { - method = encp->cf_stream; - } + method = encp->cf_stream; } } use_aes = false; |