From 5a842792b69550cf441d4598feb1daff2fa8c83f Mon Sep 17 00:00:00 2001 From: Masamichi Hosoda Date: Fri, 18 Oct 2019 19:41:53 +0900 Subject: Parse Contents in signature dictionary without encryption Various PDF digital signing tools do not encrypt /Contents value in signature dictionary. Adobe Acrobat Reader DC can handle a PDF with the /Contents value not encrypted. Write Contents in signature dictionary without encryption Tests ensure that string /Contents are not handled specially when not found in sig dicts. --- libqpdf/QPDFWriter.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libqpdf/QPDFWriter.cc') diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index e7eae5c6..a31f5da9 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -1695,7 +1695,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level, { QTC::TC("qpdf", "QPDFWriter no encryption sig contents"); unparseChild(object.getKey(key), level + 1, - child_flags | f_hex_string); + child_flags | f_hex_string | f_no_encryption); } else { @@ -1866,6 +1866,7 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level, std::string val; if (this->m->encrypted && (! (flags & f_in_ostream)) && + (! (flags & f_no_encryption)) && (! this->m->cur_data_key.empty())) { val = object.getStringValue(); -- cgit v1.2.3-54-g00ecf