2208892 - qpdf-11.4.0 is available

This commit is contained in:
Zdenek Dohnal 2023-05-23 12:08:53 +02:00
parent 78982ad67c
commit 59496076e0
5 changed files with 56 additions and 57 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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 <string.h>
#include <sstream>
#include <vector>
+#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 <qpdf/BufferInputSource.hh>
#include <qpdf/FileInputSource.hh>
#include <qpdf/OffsetInputSource.hh>
@@ -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 <qpdf/assert_debug.h>
@ -54,16 +53,16 @@ diff -up qpdf-11.3.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.3.0/libqpdf/QPDF_e
#include <qpdf/QPDFExc.hh>
@@ -19,6 +21,10 @@
#include <algorithm>
#include <string.h>
#include <cstring>
+#ifdef USE_CRYPTO_GNUTLS
+# include <gnutls/crypto.h>
+#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<gnutls_fips_mode_t>(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD);
+#endif
+
return std::string(
reinterpret_cast<char*>(digest), std::min(result.length(), toS(16)));
return std::string(reinterpret_cast<char*>(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<std::shared_ptr<Pipeline>>& 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 <cstdlib>
#include <stdexcept>
#include <stdlib.h>
+#ifdef USE_CRYPTO_GNUTLS
+#include <gnutls/crypto.h>
@ -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<char*>(digest), sizeof(MD5::Digest));
result = std::string(reinterpret_cast<char*>(digest), sizeof(MD5::Digest));
+
+#ifdef USE_CRYPTO_GNUTLS
+ gnutls_fips140_set_mode(static_cast<gnutls_fips_mode_t>(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD);
+#endif
+
}
// If /ID already exists, follow the spec: use the original first

View File

@ -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],

View File

@ -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 <zdohnal@redhat.com> - 11.4.0-1
- 2208892 - qpdf-11.4.0 is available
* Mon Mar 27 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.3.0-2
- 2181519 - qpdf bash and zsh completion files are missing

View File

@ -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