diff --git a/.gitignore b/.gitignore index 3b9566f..e865571 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ /qpdf-11.2.0-doc.zip /qpdf-11.3.0-doc.zip /qpdf-11.3.0.tar.gz +/qpdf-11.4.0.tar.gz +/qpdf-11.4.0-doc.zip diff --git a/qpdf-relax.patch b/qpdf-relax.patch index 3c72c35..a5a18bf 100644 --- a/qpdf-relax.patch +++ b/qpdf-relax.patch @@ -1,8 +1,8 @@ -diff -up qpdf-11.3.0/libqpdf/QPDF.cc.relax qpdf-11.3.0/libqpdf/QPDF.cc ---- qpdf-11.3.0/libqpdf/QPDF.cc.relax 2023-02-25 22:24:41.000000000 +0100 -+++ qpdf-11.3.0/libqpdf/QPDF.cc 2023-03-02 08:19:28.200881077 +0100 +diff -up qpdf-11.4.0/libqpdf/QPDF.cc.relax qpdf-11.4.0/libqpdf/QPDF.cc +--- qpdf-11.4.0/libqpdf/QPDF.cc.relax 2023-05-22 17:31:18.991888284 +0200 ++++ qpdf-11.4.0/libqpdf/QPDF.cc 2023-05-22 17:33:28.134747199 +0200 @@ -13,6 +13,10 @@ - #include + #include #include +#ifdef USE_CRYPTO_GNUTLS @@ -12,10 +12,10 @@ diff -up qpdf-11.3.0/libqpdf/QPDF.cc.relax qpdf-11.3.0/libqpdf/QPDF.cc #include #include #include -@@ -264,7 +268,13 @@ void +@@ -258,14 +262,26 @@ void QPDF::processFile(char const* filename, char const* password) { - FileInputSource* fi = new FileInputSource(filename); + auto* fi = new FileInputSource(filename); +#ifdef USE_CRYPTO_GNUTLS + GNUTLS_FIPS140_SET_LAX_MODE(); +#endif @@ -26,10 +26,9 @@ diff -up qpdf-11.3.0/libqpdf/QPDF.cc.relax qpdf-11.3.0/libqpdf/QPDF.cc } void -@@ -272,7 +282,13 @@ QPDF::processFile( - char const* description, FILE* filep, bool close_file, char const* password) + QPDF::processFile(char const* description, FILE* filep, bool close_file, char const* password) { - FileInputSource* fi = new FileInputSource(description, filep, close_file); + auto* fi = new FileInputSource(description, filep, close_file); +#ifdef USE_CRYPTO_GNUTLS + GNUTLS_FIPS140_SET_LAX_MODE(); +#endif @@ -40,9 +39,9 @@ diff -up qpdf-11.3.0/libqpdf/QPDF.cc.relax qpdf-11.3.0/libqpdf/QPDF.cc } void -diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_encryption.cc ---- qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax 2023-02-25 22:24:41.000000000 +0100 -+++ qpdf-11.3.0/libqpdf/QPDF_encryption.cc 2023-03-02 08:19:28.200881077 +0100 +diff -up qpdf-11.4.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.4.0/libqpdf/QPDF_encryption.cc +--- qpdf-11.4.0/libqpdf/QPDF_encryption.cc.relax 2023-05-21 20:42:37.000000000 +0200 ++++ qpdf-11.4.0/libqpdf/QPDF_encryption.cc 2023-05-22 17:36:24.816923148 +0200 @@ -3,6 +3,8 @@ #include @@ -54,16 +53,16 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e #include @@ -19,6 +21,10 @@ #include - #include + #include +#ifdef USE_CRYPTO_GNUTLS +# include +#endif + static unsigned char const padding_string[] = { - 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, - 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, -@@ -367,10 +373,21 @@ QPDF::compute_data_key( + 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, + 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a}; +@@ -359,10 +365,21 @@ QPDF::compute_data_key( result += "sAlT"; } @@ -82,10 +81,10 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e + gnutls_fips140_set_mode(static_cast(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD); +#endif + - return std::string( - reinterpret_cast(digest), std::min(result.length(), toS(16))); + return std::string(reinterpret_cast(digest), std::min(result.length(), toS(16))); } -@@ -1076,6 +1093,12 @@ QPDF::getKeyForObject( + +@@ -1003,6 +1020,12 @@ QPDF::getKeyForObject( void QPDF::decryptString(std::string& str, QPDFObjGen const& og) { @@ -98,9 +97,9 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e if (!og.isIndirect()) { return; } -@@ -1142,6 +1165,10 @@ QPDF::decryptString(std::string& str, QP - "error decrypting string for object " + og.unparse() + ": " + - e.what()); +@@ -1065,6 +1088,10 @@ QPDF::decryptString(std::string& str, QP + } catch (std::runtime_error& e) { + throw damagedPDF("error decrypting string for object " + og.unparse() + ": " + e.what()); } + +#ifdef USE_CRYPTO_GNUTLS @@ -109,7 +108,7 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e } void -@@ -1154,6 +1181,12 @@ QPDF::decryptStream( +@@ -1077,6 +1104,12 @@ QPDF::decryptStream( QPDFObjectHandle& stream_dict, std::vector>& heap) { @@ -122,7 +121,7 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e std::string type; if (stream_dict.getKey("/Type").isName()) { type = stream_dict.getKey("/Type").getName(); -@@ -1262,6 +1295,10 @@ QPDF::decryptStream( +@@ -1181,6 +1214,10 @@ QPDF::decryptStream( } pipeline = new_pipeline.get(); heap.push_back(new_pipeline); @@ -133,12 +132,12 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e } void -diff -up qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax qpdf-11.3.0/libqpdf/QPDFWriter.cc ---- qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax 2023-02-25 22:24:41.000000000 +0100 -+++ qpdf-11.3.0/libqpdf/QPDFWriter.cc 2023-03-02 08:56:48.559215611 +0100 +diff -up qpdf-11.4.0/libqpdf/QPDFWriter.cc.relax qpdf-11.4.0/libqpdf/QPDFWriter.cc +--- qpdf-11.4.0/libqpdf/QPDFWriter.cc.relax 2023-05-22 17:31:18.992888290 +0200 ++++ qpdf-11.4.0/libqpdf/QPDFWriter.cc 2023-05-22 17:38:49.596889049 +0200 @@ -26,6 +26,10 @@ + #include #include - #include +#ifdef USE_CRYPTO_GNUTLS +#include @@ -147,10 +146,10 @@ diff -up qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax qpdf-11.3.0/libqpdf/QPDFWriter. QPDFWriter::ProgressReporter::~ProgressReporter() { // Must be explicit and not inline -- see QPDF_DLL_CLASS in -@@ -343,6 +347,13 @@ void +@@ -288,6 +292,13 @@ void QPDFWriter::setDeterministicID(bool val) { - this->m->deterministic_id = val; + m->deterministic_id = val; + +#ifdef USE_CRYPTO_GNUTLS + if (val) @@ -161,10 +160,10 @@ diff -up qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax qpdf-11.3.0/libqpdf/QPDFWriter. } void -@@ -363,6 +374,13 @@ void +@@ -308,6 +319,13 @@ void QPDFWriter::setPreserveEncryption(bool val) { - this->m->preserve_encryption = val; + m->preserve_encryption = val; + +#ifdef USE_CRYPTO_GNUTLS + if (val) @@ -175,7 +174,7 @@ diff -up qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax qpdf-11.3.0/libqpdf/QPDFWriter. } void -@@ -2100,12 +2118,23 @@ QPDFWriter::generateID() +@@ -1940,11 +1958,21 @@ QPDFWriter::generateID() } } @@ -189,13 +188,11 @@ diff -up qpdf-11.3.0/libqpdf/QPDFWriter.cc.relax qpdf-11.3.0/libqpdf/QPDFWriter. m.encodeString(seed.c_str()); MD5::Digest digest; m.digest(digest); - result = - std::string(reinterpret_cast(digest), sizeof(MD5::Digest)); + result = std::string(reinterpret_cast(digest), sizeof(MD5::Digest)); + +#ifdef USE_CRYPTO_GNUTLS + gnutls_fips140_set_mode(static_cast(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD); +#endif -+ } // If /ID already exists, follow the spec: use the original first diff --git a/qpdf-s390x-disable-streamtest.patch b/qpdf-s390x-disable-streamtest.patch index 6be86b1..de7d473 100644 --- a/qpdf-s390x-disable-streamtest.patch +++ b/qpdf-s390x-disable-streamtest.patch @@ -1,20 +1,18 @@ -diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc -index ab02371..ce5f7ff 100644 ---- a/libqpdf/QPDFWriter.cc -+++ b/libqpdf/QPDFWriter.cc -@@ -1926,7 +1926,6 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) +diff -up qpdf-11.4.0/libqpdf/QPDFWriter.cc.s390x-disable-streamtest qpdf-11.4.0/libqpdf/QPDFWriter.cc +--- qpdf-11.4.0/libqpdf/QPDFWriter.cc.s390x-disable-streamtest 2023-05-22 17:39:20.908097940 +0200 ++++ qpdf-11.4.0/libqpdf/QPDFWriter.cc 2023-05-22 17:40:22.782510735 +0200 +@@ -1763,7 +1763,6 @@ QPDFWriter::writeObjectStream(QPDFObject // This condition occurred in a fuzz input. Ideally we // should block it at at parse time, but it's not // clear to me how to construct a case for this. - QTC::TC("qpdf", "QPDFWriter stream in ostream"); - obj_to_write.warnIfPossible( - "stream found inside object stream; treating as null"); + obj_to_write.warnIfPossible("stream found inside object stream; treating as null"); obj_to_write = QPDFObjectHandle::newNull(); -diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov -index e89f63a..6e3582c 100644 ---- a/qpdf/qpdf.testcov -+++ b/qpdf/qpdf.testcov -@@ -427,7 +427,6 @@ QPDF xref skipped space 0 + } +diff -up qpdf-11.4.0/qpdf/qpdf.testcov.s390x-disable-streamtest qpdf-11.4.0/qpdf/qpdf.testcov +--- qpdf-11.4.0/qpdf/qpdf.testcov.s390x-disable-streamtest 2023-05-21 20:42:37.000000000 +0200 ++++ qpdf-11.4.0/qpdf/qpdf.testcov 2023-05-22 17:39:20.908097940 +0200 +@@ -428,7 +428,6 @@ QPDF xref skipped space 0 QPDF eof skipping spaces before xref 1 QPDF_encryption user matches owner V < 5 0 QPDF_encryption same password 1 @@ -22,10 +20,9 @@ index e89f63a..6e3582c 100644 QPDFParser duplicate dict key 0 QPDFWriter no encryption sig contents 0 QPDFPageObjectHelper colorspace lookup 0 -diff --git a/qpdf/qtest/specific-bugs.test b/qpdf/qtest/specific-bugs.test -index 326b3e9..f9665cb 100644 ---- a/qpdf/qtest/specific-bugs.test -+++ b/qpdf/qtest/specific-bugs.test +diff -up qpdf-11.4.0/qpdf/qtest/specific-bugs.test.s390x-disable-streamtest qpdf-11.4.0/qpdf/qtest/specific-bugs.test +--- qpdf-11.4.0/qpdf/qtest/specific-bugs.test.s390x-disable-streamtest 2023-05-21 20:42:37.000000000 +0200 ++++ qpdf-11.4.0/qpdf/qtest/specific-bugs.test 2023-05-22 17:39:20.908097940 +0200 @@ -38,7 +38,6 @@ my @bug_tests = ( ["263", "empty xref stream", 2], ["335a", "ozz-fuzz-12152", 2], diff --git a/qpdf.spec b/qpdf.spec index 3853a32..cadaf14 100644 --- a/qpdf.spec +++ b/qpdf.spec @@ -1,7 +1,7 @@ Summary: Command-line tools and library for transforming PDF files Name: qpdf -Version: 11.3.0 -Release: 2%{?dist} +Version: 11.4.0 +Release: 1%{?dist} # MIT: e.g. libqpdf/sha2.c # upstream uses ASL 2.0 now, but he allowed other to distribute qpdf under # old license (see README) @@ -138,7 +138,7 @@ install -m 0644 completions/zsh/_qpdf %{buildroot}%{zsh_completions_dir}/_qpdf %doc README.md TODO ChangeLog %license Artistic-2.0 %{_libdir}/libqpdf.so.29 -%{_libdir}/libqpdf.so.29.3.0 +%{_libdir}/libqpdf.so.29.4.0 %files devel %doc examples/*.cc examples/*.c @@ -151,6 +151,9 @@ install -m 0644 completions/zsh/_qpdf %{buildroot}%{zsh_completions_dir}/_qpdf %changelog +* Mon May 22 2023 Zdenek Dohnal - 11.4.0-1 +- 2208892 - qpdf-11.4.0 is available + * Mon Mar 27 2023 Zdenek Dohnal - 11.3.0-2 - 2181519 - qpdf bash and zsh completion files are missing diff --git a/sources b/sources index 48bb9d6..4dce71a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (qpdf-11.3.0-doc.zip) = c652ba56b4c740af74889579732e18336910b09edbe125783ad4b6b1556df0cc3f32e2514c9bb611aebe233a8708d58701ed466ba6b4f3ff652ed56527650b9c -SHA512 (qpdf-11.3.0.tar.gz) = 1c8a0b62d50efb4c09885f36244048797dea44f28917aefe0266e2b158858ea19d477bbc445abbd3b7180a3de56d6a819ff44275cdc0979827effba9739b53d2 +SHA512 (qpdf-11.4.0.tar.gz) = 6f31a37a9a52752c89d319e0d29d8e6c1e4885ca494de47a65f9374cdb5672497ab93f754481300c8e6c68fc2874860997b778dc05386b6f3e6a5a70a3f9f754 +SHA512 (qpdf-11.4.0-doc.zip) = 25aab31b8481034bba876411eab2034375a9ffed97666c221b211400b1a7e60cfc11b5237406733058fbbbd2412baad7aa6029ad4303d0ddd879f6d7aff3b2b0