Compare commits

...

No commits in common. 'c9' and 'i10c-beta' have entirely different histories.

3
.gitignore vendored

@ -1 +1,2 @@
SOURCES/qpdf-10.3.1.tar.gz
SOURCES/qpdf-11.8.0-doc.zip
SOURCES/qpdf-11.8.0.tar.gz

@ -1 +1,2 @@
36a4d60a330e658b2a525f20636080b73a9c6b4e SOURCES/qpdf-10.3.1.tar.gz
f508875056a12e197a1db3d0f938654963febfd4 SOURCES/qpdf-11.8.0-doc.zip
703457ad536108c031bbdde9ea3306f6c3c91d5f SOURCES/qpdf-11.8.0.tar.gz

@ -1,30 +0,0 @@
diff -up qpdf-8.2.1/manual/fix-qdf.1.in.doc qpdf-8.2.1/manual/fix-qdf.1.in
--- qpdf-8.2.1/manual/fix-qdf.1.in.doc 2018-08-18 16:56:19.000000000 +0200
+++ qpdf-8.2.1/manual/fix-qdf.1.in 2018-09-24 14:24:26.340341484 +0200
@@ -14,5 +14,4 @@ the same file with stream lengths, cross
object stream offset tables regenerated.
.PP
For details about fix-qdf and about PDF files in QDF mode, please see
-the qpdf manual, which can be found in @docdir@/qpdf-manual.html or
-@docdir@/qpdf-manual.pdf.
+the qpdf manual, which can be found in qpdf-doc package.
diff -up qpdf-8.2.1/manual/qpdf.1.in.doc qpdf-8.2.1/manual/qpdf.1.in
--- qpdf-8.2.1/manual/qpdf.1.in.doc 2018-09-24 14:24:26.340341484 +0200
+++ qpdf-8.2.1/manual/qpdf.1.in 2018-09-24 14:26:18.171462618 +0200
@@ -16,4 +16,4 @@ useful primarily to PDF developers.
.PP
For a summary of qpdf's options, please run
\fBqpdf \-\-help\fR. A complete manual can be found in
-@docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
+qpdf-doc package.
diff -up qpdf-8.2.1/manual/zlib-flate.1.in.doc qpdf-8.2.1/manual/zlib-flate.1.in
--- qpdf-8.2.1/manual/zlib-flate.1.in.doc 2018-08-18 16:56:19.000000000 +0200
+++ qpdf-8.2.1/manual/zlib-flate.1.in 2018-09-24 14:24:26.340341484 +0200
@@ -21,6 +21,6 @@ This program should not be used as a gen
tool. Use something like gzip(1) instead.
.PP
For details about qpdf, please see the qpdf manual, which can be found
-in @docdir@/qpdf-manual.html or @docdir@/qpdf-manual.pdf.
+in qpdf-doc package.
.SH "SEE ALSO"
qpdf(1), gzip(1)

@ -1,147 +0,0 @@
diff -up qpdf-10.2.0/examples/qtest/filter-tokens.test.erase-tests-with-generated-object-stream qpdf-10.2.0/examples/qtest/filter-tokens.test
--- qpdf-10.2.0/examples/qtest/filter-tokens.test.erase-tests-with-generated-object-stream 2021-02-24 12:45:32.347357149 +0100
+++ qpdf-10.2.0/examples/qtest/filter-tokens.test 2021-02-24 12:47:01.379611993 +0100
@@ -15,13 +15,9 @@ $td->runtest("filter tokens",
{$td->COMMAND => "pdf-filter-tokens in.pdf a.pdf"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
-$td->runtest("check output",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "out.pdf"});
-
cleanup();
-$td->report(2);
+$td->report(1);
sub cleanup
{
diff -up qpdf-10.2.0/examples/qtest/invert-images.test.erase-tests-with-generated-object-stream qpdf-10.2.0/examples/qtest/invert-images.test
--- qpdf-10.2.0/examples/qtest/invert-images.test.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/examples/qtest/invert-images.test 2021-02-24 12:45:32.347357149 +0100
@@ -19,13 +19,13 @@ $td->runtest("invert images",
$td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
-$td->runtest("check output",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "out.pdf"});
+#$td->runtest("check output",
+# {$td->FILE => "a.pdf"},
+# {$td->FILE => "out.pdf"});
cleanup();
-$td->report(2);
+$td->report(1);
sub cleanup
{
diff -up qpdf-10.2.0/examples/qtest/set-form-values.test.erase-tests-with-generated-object-stream qpdf-10.2.0/examples/qtest/set-form-values.test
--- qpdf-10.2.0/examples/qtest/set-form-values.test.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/examples/qtest/set-form-values.test 2021-02-24 12:45:32.347357149 +0100
@@ -14,13 +14,10 @@ cleanup();
$td->runtest("set form values",
{$td->COMMAND => "pdf-set-form-values form-in.pdf a.pdf soup"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
-$td->runtest("compare files",
- {$td->FILE => "a.pdf"},
- {$td->FILE => "form-out.pdf"});
cleanup();
-$td->report(2);
+$td->report(1);
sub cleanup
{
diff -up qpdf-10.2.0/libqpdf/qpdf-c.cc.erase-tests-with-generated-object-stream qpdf-10.2.0/libqpdf/qpdf-c.cc
--- qpdf-10.2.0/libqpdf/qpdf-c.cc.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/libqpdf/qpdf-c.cc 2021-02-24 12:45:32.348357141 +0100
@@ -331,7 +331,6 @@ QPDF_ERROR_CODE qpdf_read_memory(qpdf_da
qpdf->size = size;
qpdf->password = password;
status = trap_errors(qpdf, &call_read_memory);
- QTC::TC("qpdf", "qpdf-c called qpdf_read_memory", status);
return status;
}
@@ -542,7 +541,6 @@ unsigned char const* qpdf_get_buffer(qpd
void qpdf_set_object_stream_mode(qpdf_data qpdf, qpdf_object_stream_e mode)
{
- QTC::TC("qpdf", "qpdf-c called qpdf_set_object_stream_mode");
qpdf->qpdf_writer->setObjectStreamMode(mode);
}
diff -up qpdf-10.2.0/libqpdf/QPDFWriter.cc.erase-tests-with-generated-object-stream qpdf-10.2.0/libqpdf/QPDFWriter.cc
--- qpdf-10.2.0/libqpdf/QPDFWriter.cc.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/libqpdf/QPDFWriter.cc 2021-02-24 12:45:32.348357141 +0100
@@ -3445,8 +3445,6 @@ QPDFWriter::writeLinearized()
{
if (this->m->deterministic_id)
{
- QTC::TC("qpdf", "QPDFWriter linearized deterministic ID",
- need_xref_stream ? 0 : 1);
computeDeterministicIDData();
pp_md5 = 0;
assert(this->m->md5_pipeline == 0);
@@ -3654,8 +3652,6 @@ QPDFWriter::writeStandard()
if (this->m->deterministic_id)
{
- QTC::TC("qpdf", "QPDFWriter standard deterministic ID",
- this->m->object_stream_to_objects.empty() ? 0 : 1);
pp_md5 = 0;
assert(this->m->md5_pipeline == 0);
}
diff -up qpdf-10.2.0/qpdf/qpdf.testcov.erase-tests-with-generated-object-stream qpdf-10.2.0/qpdf/qpdf.testcov
--- qpdf-10.2.0/qpdf/qpdf.testcov.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/qpdf/qpdf.testcov 2021-02-24 12:45:32.348357141 +0100
@@ -123,7 +123,6 @@ qpdf-c called qpdf_get_user_password 0
qpdf-c called qpdf_is_linearized 0
qpdf-c called qpdf_is_encrypted 0
qpdf-c called qpdf_init_write 3
-qpdf-c called qpdf_set_object_stream_mode 0
qpdf-c called qpdf_set_stream_data_mode 0
qpdf-c called qpdf_set_content_normalization 0
qpdf-c called qpdf_set_qdf_mode 0
@@ -177,7 +176,6 @@ QPDFObjectHandle append page contents 0
QPDF_Stream getRawStreamData 0
QPDF_Stream getStreamData 0
QPDF_Stream expand filter abbreviation 0
-qpdf-c called qpdf_read_memory 0
QPDF stream without newline 0
QPDF stream with CR only 0
QPDF stream with CRNL 0
@@ -260,8 +258,6 @@ qpdf pages range omitted at end 0
qpdf pages range omitted in middle 0
qpdf npages 0
QPDF already reserved object 0
-QPDFWriter standard deterministic ID 1
-QPDFWriter linearized deterministic ID 1
QPDFWriter deterministic with no data 0
qpdf-c called qpdf_set_deterministic_ID 0
QPDFObjectHandle indirect with 0 objid 0
diff -up qpdf-10.2.0/qpdf/qtest/qpdf.test.erase-tests-with-generated-object-stream qpdf-10.2.0/qpdf/qtest/qpdf.test
--- qpdf-10.2.0/qpdf/qtest/qpdf.test.erase-tests-with-generated-object-stream 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/qpdf/qtest/qpdf.test 2021-02-24 12:45:32.349357133 +0100
@@ -3254,7 +3254,6 @@ my @capi = (
[3, 'normalized content'],
[4, 'ignore xref streams'],
[5, 'linearized'],
- [6, 'object streams'],
[7, 'qdf'],
[8, 'no original object ids'],
[9, 'uncompressed streams'],
@@ -3298,8 +3297,8 @@ $td->runtest("write damaged",
show_ntests();
# ----------
$td->notify("--- Deterministic ID Tests ---");
-$n_tests += 11;
-foreach my $d ('nn', 'ny', 'yn', 'yy')
+$n_tests += 7;
+foreach my $d ('nn', 'yn')
{
my $linearize = ($d =~ m/^y/);
my $ostream = ($d =~ m/y$/);

@ -1,138 +1,68 @@
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 3eeea86..2a6923c 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -11,6 +11,10 @@
#include <string.h>
#include <memory.h>
diff -up qpdf-11.7.0/libqpdf/QPDF.cc.relax qpdf-11.7.0/libqpdf/QPDF.cc
--- qpdf-11.7.0/libqpdf/QPDF.cc.relax 2023-12-24 13:36:07.000000000 +0100
+++ qpdf-11.7.0/libqpdf/QPDF.cc 2024-01-08 15:17:27.020951639 +0100
@@ -13,6 +13,10 @@
#include <sstream>
#include <vector>
+#ifdef USE_CRYPTO_GNUTLS
+# include <gnutls/crypto.h>
+#endif
+
#include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh>
#include <qpdf/Pipeline.hh>
@@ -262,7 +266,13 @@ QPDF::processFile(char const* filename, char const* password)
#include <qpdf/BufferInputSource.hh>
#include <qpdf/FileInputSource.hh>
#include <qpdf/OffsetInputSource.hh>
@@ -250,14 +254,26 @@ void
QPDF::processFile(char const* filename, char const* password)
{
FileInputSource* fi = new FileInputSource();
fi->setFilename(filename);
auto* fi = new FileInputSource(filename);
+#ifdef USE_CRYPTO_GNUTLS
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
processInputSource(fi, password);
processInputSource(std::shared_ptr<InputSource>(fi), password);
+#ifdef USE_CRYPTO_GNUTLS
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
@@ -271,7 +281,13 @@ QPDF::processFile(char const* description, FILE* filep,
QPDF::processFile(char const* description, FILE* filep, bool close_file, char const* password)
{
FileInputSource* fi = new FileInputSource();
fi->setFile(description, filep, close_file);
auto* fi = new FileInputSource(description, filep, close_file);
+#ifdef USE_CRYPTO_GNUTLS
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
processInputSource(fi, password);
processInputSource(std::shared_ptr<InputSource>(fi), password);
+#ifdef USE_CRYPTO_GNUTLS
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 689fef7..57df1eb 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -24,6 +24,10 @@
#include <algorithm>
#include <stdlib.h>
+#ifdef USE_CRYPTO_GNUTLS
+#include <gnutls/crypto.h>
+#endif
+
QPDFWriter::Members::Members(QPDF& pdf) :
pdf(pdf),
filename("unspecified"),
@@ -321,6 +325,13 @@ void
QPDFWriter::setDeterministicID(bool val)
{
this->m->deterministic_id = val;
+
+#ifdef USE_CRYPTO_GNUTLS
+ if (val)
+ GNUTLS_FIPS140_SET_LAX_MODE();
+ else
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
@@ -342,6 +353,13 @@ void
QPDFWriter::setPreserveEncryption(bool val)
{
this->m->preserve_encryption = val;
+
+#ifdef USE_CRYPTO_GNUTLS
+ if (val)
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+ else
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
}
void
@@ -2301,12 +2319,23 @@ QPDFWriter::generateID()
}
}
+#ifdef USE_CRYPTO_GNUTLS
+ unsigned oldmode = gnutls_fips140_mode_enabled();
+
+ gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, GNUTLS_FIPS140_SET_MODE_THREAD);
+#endif
+
MD5 m;
m.encodeString(seed.c_str());
MD5::Digest digest;
m.digest(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
+
}
diff -up qpdf-11.7.0/libqpdf/QPDF_encryption.cc.relax qpdf-11.7.0/libqpdf/QPDF_encryption.cc
--- qpdf-11.7.0/libqpdf/QPDF_encryption.cc.relax 2023-12-24 13:36:07.000000000 +0100
+++ qpdf-11.7.0/libqpdf/QPDF_encryption.cc 2024-01-08 15:19:52.303117277 +0100
@@ -3,6 +3,8 @@
// If /ID already exists, follow the spec: use the original first
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc
index 2ff48df..ce6fb31 100644
--- a/libqpdf/QPDF_encryption.cc
+++ b/libqpdf/QPDF_encryption.cc
@@ -1,6 +1,8 @@
// This file implements methods from the QPDF class that involve
// encryption.
#include <qpdf/assert_debug.h>
+#include <qpdf/qpdf-config.h>
+
#include <qpdf/QPDF.hh>
#include <qpdf/QPDFExc.hh>
@@ -18,6 +20,10 @@
#include <assert.h>
#include <string.h>
@@ -19,6 +21,10 @@
#include <algorithm>
#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,
@@ -380,10 +386,21 @@ QPDF::compute_data_key(std::string const& encryption_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};
@@ -349,10 +355,21 @@ QPDF::compute_data_key(
result += "sAlT";
}
@ -151,12 +81,12 @@ index 2ff48df..ce6fb31 100644
+ 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 {reinterpret_cast<char*>(digest), std::min(result.length(), toS(16))};
}
@@ -1150,6 +1167,12 @@ QPDF::getKeyForObject(
@@ -976,6 +993,12 @@ QPDF::getKeyForObject(
void
QPDF::decryptString(std::string& str, int objid, int generation)
QPDF::decryptString(std::string& str, QPDFObjGen const& og)
{
+#ifdef USE_CRYPTO_GNUTLS
+ unsigned oldmode = gnutls_fips140_mode_enabled();
@ -164,12 +94,12 @@ index 2ff48df..ce6fb31 100644
+ gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, GNUTLS_FIPS140_SET_MODE_THREAD);
+#endif
+
if (objid == 0)
{
if (!og.isIndirect()) {
return;
@@ -1230,6 +1253,10 @@ QPDF::decryptString(std::string& str, int objid, int generation)
QUtil::int_to_string(objid) + " " +
QUtil::int_to_string(generation) + ": " + e.what());
}
@@ -1036,6 +1059,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
@ -177,10 +107,10 @@ index 2ff48df..ce6fb31 100644
+#endif
}
void
@@ -1240,6 +1267,12 @@ QPDF::decryptStream(PointerHolder<EncryptionParameters> encp,
// Prepend a decryption pipeline to 'pipeline'. The decryption pipeline (returned as
@@ -1051,6 +1078,12 @@ QPDF::decryptStream(
QPDFObjectHandle& stream_dict,
std::vector<PointerHolder<Pipeline> >& heap)
std::unique_ptr<Pipeline>& decrypt_pipeline)
{
+#ifdef USE_CRYPTO_GNUTLS
+ unsigned oldmode = gnutls_fips140_mode_enabled();
@ -189,12 +119,12 @@ index 2ff48df..ce6fb31 100644
+#endif
+
std::string type;
if (stream_dict.getKey("/Type").isName())
{
@@ -1361,6 +1394,10 @@ QPDF::decryptStream(PointerHolder<EncryptionParameters> encp,
if (stream_dict.getKey("/Type").isName()) {
type = stream_dict.getKey("/Type").getName();
@@ -1151,6 +1184,10 @@ QPDF::decryptStream(
toI(key.length()));
}
heap.push_back(pipeline);
pipeline = decrypt_pipeline.get();
+
+#ifdef USE_CRYPTO_GNUTLS
+ gnutls_fips140_set_mode(static_cast<gnutls_fips_mode_t>(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD);
@ -202,3 +132,67 @@ index 2ff48df..ce6fb31 100644
}
void
diff -up qpdf-11.7.0/libqpdf/QPDFWriter.cc.relax qpdf-11.7.0/libqpdf/QPDFWriter.cc
--- qpdf-11.7.0/libqpdf/QPDFWriter.cc.relax 2023-12-24 13:36:07.000000000 +0100
+++ qpdf-11.7.0/libqpdf/QPDFWriter.cc 2024-01-08 15:17:27.022951614 +0100
@@ -26,6 +26,10 @@
#include <cstdlib>
#include <stdexcept>
+#ifdef USE_CRYPTO_GNUTLS
+#include <gnutls/crypto.h>
+#endif
+
QPDFWriter::ProgressReporter::~ProgressReporter() // NOLINT (modernize-use-equals-default)
{
// Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
@@ -287,6 +291,13 @@ void
QPDFWriter::setDeterministicID(bool val)
{
m->deterministic_id = val;
+
+#ifdef USE_CRYPTO_GNUTLS
+ if (val)
+ GNUTLS_FIPS140_SET_LAX_MODE();
+ else
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
@@ -307,6 +318,13 @@ void
QPDFWriter::setPreserveEncryption(bool val)
{
m->preserve_encryption = val;
+
+#ifdef USE_CRYPTO_GNUTLS
+ if (val)
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+ else
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
}
void
@@ -1890,11 +1908,21 @@ QPDFWriter::generateID()
}
}
+#ifdef USE_CRYPTO_GNUTLS
+ unsigned oldmode = gnutls_fips140_mode_enabled();
+
+ gnutls_fips140_set_mode(GNUTLS_FIPS140_LAX, GNUTLS_FIPS140_SET_MODE_THREAD);
+#endif
+
MD5 m;
m.encodeString(seed.c_str());
MD5::Digest digest;
m.digest(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 word and generate a new second

@ -1,36 +0,0 @@
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index fccefe0..2793191 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -2096,7 +2096,6 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object)
// 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 = QPDFObjectHandle::newNull();
diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov
index b4e7c46..3e935d0 100644
--- a/qpdf/qpdf.testcov
+++ b/qpdf/qpdf.testcov
@@ -443,7 +443,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
-QPDFWriter stream in ostream 0
QPDFObjectHandle duplicate dict key 0
QPDFWriter no encryption sig contents 0
QPDFPageObjectHelper colorspace lookup 0
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index afb6668..b8f55a2 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -996,7 +996,6 @@ my @bug_tests = (
["263", "empty xref stream", 2],
["335a", "ozz-fuzz-12152", 2],
["335b", "ozz-fuzz-14845", 2],
- ["fuzz-16214", "stream in object stream", 3],
# When adding to this list, consider adding to SEED_CORPUS_FILES
# in fuzz/build.mk and updating the count in fuzz/qtest/fuzz.test.
);

@ -1,34 +1,29 @@
Summary: Command-line tools and library for transforming PDF files
Name: qpdf
Version: 10.3.1
Release: 7%{?dist}
# MIT: e.g. libqpdf/sha2.c
Version: 11.8.0
Release: 4%{?dist}
# MIT: e.g. libqpdf/sha2.c, but those are not compiled in (GNUTLS is used)
# upstream uses ASL 2.0 now, but he allowed other to distribute qpdf under
# old license (see README)
License: (Artistic 2.0 or ASL 2.0) and MIT
URL: http://qpdf.sourceforge.net/
Source0: http://downloads.sourceforge.net/sourceforge/qpdf/qpdf-%{version}.tar.gz
Patch0: qpdf-doc.patch
# zlib has optimalization for aarch64 now, which gives different output after
# compression - patch erases 3 tests with generated object stream which were failing
Patch1: qpdf-erase-tests-with-generated-object-stream.patch
License: Apache-2.0 OR Artistic-2.0
URL: https://qpdf.sourceforge.io/
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-%{version}-doc.zip
# make qpdf working under FIPS, downstream patch
Patch2: qpdf-relax.patch
# 1950033 - Possible changes in zlib output causes FTBFS for qpdf
Patch3: qpdf-s390x-disable-streamtest.patch
Patch1: qpdf-relax.patch
# gcc and gcc-c++ are no longer in buildroot by default
# gcc is needed for qpdf-ctest.c
BuildRequires: gcc
# gcc-c++ is need for everything except for qpdf-ctest
BuildRequires: gcc-c++
# uses make
BuildRequires: make
# uses cmake
BuildRequires: cmake
BuildRequires: zlib-devel
BuildRequires: libjpeg-turbo-devel
BuildRequires: pcre-devel
# for gnutls crypto
BuildRequires: gnutls-devel
@ -43,6 +38,7 @@ BuildRequires: perl(Cwd)
BuildRequires: perl(Digest::MD5)
BuildRequires: perl(Digest::SHA)
BuildRequires: perl(File::Basename)
BuildRequires: perl(File::Compare)
BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Find)
BuildRequires: perl(File::Spec)
@ -55,11 +51,6 @@ BuildRequires: perl(strict)
# perl(Term::ANSIColor) - not needed for tests
# perl(Term::ReadKey) - not needed for tests
# for autoreconf
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%package libs
@ -72,6 +63,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%package doc
Summary: QPDF Manual
BuildArch: noarch
BuildRequires: unzip
Requires: %{name}-libs = %{version}-%{release}
%description
@ -96,37 +88,34 @@ QPDF Manual
%prep
%setup -q
# fix 'complete manual location' note in man pages
%patch0 -p1 -b .doc
%ifarch aarch64
%patch1 -p1 -b .erase-tests-with-generated-object-stream
%endif
%patch2 -p1 -b .relax
%ifarch s390x
%patch3 -p1 -b .s390x-disable-streamtest
%endif
%patch -P 1 -p1 -b .relax
%build
# work-around check-rpaths errors
autoreconf --verbose --force --install
# automake files needed to be regenerated in 8.4.0 - check if this can be removed
# in the next qpdf release
./autogen.sh
# unpack zip file with manual
unzip %{SOURCE1}
%configure --disable-static \
--enable-crypto-gnutls \
--disable-implicit-crypto \
--enable-show-failed-test-output
%make_build
%build
%cmake -DBUILD_STATIC_LIBS=0 \
-DREQUIRE_CRYPTO_GNUTLS=1 \
-DUSE_IMPLICIT_CRYPTO=0 \
-DSHOW_FAILED_TEST_OUTPUT=1 \
-DINSTALL_CMAKE_PACKAGE=0
%cmake_build
%install
%make_install
%cmake_install
install -m 0644 %{name}-%{version}-doc/%{name}-manual.pdf %{buildroot}/%{_pkgdocdir}/%{name}-manual.pdf
rm -f %{buildroot}%{_libdir}/libqpdf.la
# install bash/zsh completions
mkdir -p %{buildroot}%{bash_completions_dir}
mkdir -p %{buildroot}%{zsh_completions_dir}
install -m 0644 completions/bash/qpdf %{buildroot}%{bash_completions_dir}/qpdf
install -m 0644 completions/zsh/_qpdf %{buildroot}%{zsh_completions_dir}/_qpdf
%check
make check
%ctest
%ldconfig_scriptlets libs
@ -135,12 +124,16 @@ make check
%{_bindir}/qpdf
%{_bindir}/zlib-flate
%{_mandir}/man1/*
%dir %{bash_completions_dir}
%{bash_completions_dir}/qpdf
%dir %{zsh_completions_dir}
%{zsh_completions_dir}/_qpdf
%files libs
%doc README.md TODO ChangeLog
%license Artistic-2.0
%{_libdir}/libqpdf.so.28
%{_libdir}/libqpdf.so.28.3.1
%doc README.md TODO.md ChangeLog
%license Artistic-2.0 LICENSE.txt NOTICE.md
%{_libdir}/libqpdf.so.29
%{_libdir}/libqpdf.so.29.8.0
%files devel
%doc examples/*.cc examples/*.c
@ -153,24 +146,111 @@ make check
%changelog
* Wed Jan 04 2023 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-7
- 2157765 - Ship qpdf-devel in CRB
* Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 11.8.0-4
- Rebuilt for MSVSphere 10
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 11.8.0-4
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 11.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 11.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jan 09 2024 Zdenek Dohnal <zdohnal@redhat.com> - 11.8.0-1
- 2257313 - qpdf-11.8.0 is available
* Mon Jan 08 2024 Zdenek Dohnal <zdohnal@redhat.com> - 11.7.0-1
- 2255755 - qpdf-11.7.0 is available
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.6.4-2
- 2254778 - remove the tests which fail with zlib-ng-compat for now
* Mon Dec 18 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.6.4-1
- 2253901 - qpdf-11.6.4 is available
* Thu Nov 02 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.6.3-1
- 2244319 - qpdf-11.6.3 is available
* Mon Oct 09 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.6.2-1
- 2242670 - qpdf-11.6.2 is available
* Tue Sep 12 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.6.1-1
- 2237125 - qpdf-11.6.1 is available
* Wed Jul 26 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.5.0-1
- 2221506 - qpdf-11.5.0 is available
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 11.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* 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
* Thu Mar 02 2023 Zdenek Dohnal <zdohnal@redhat.com> - 11.3.0-1
- 2173354 - qpdf-11.3.0 is available
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 11.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Nov 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 11.2.0-1
- 2144359 - qpdf-11.2.0 is available
* Thu Oct 13 2022 Zdenek Dohnal <zdohnal@redhat.com> - 11.1.1-1
- 2125823 - qpdf-11.1.1 is available
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 11.1.0-1
- 2125823 - qpdf-11.1.0 is available, move to cmake
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.3-5
- use `grep -E` in test suite (bz2127957)
* Mon Jul 25 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.3-4
- qpdf doesn't depend on pcre since 7.0b1
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 10.6.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jul 14 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.3-2
- 2107240 - FIPS breaks pdftopdf and bannertopdf
* Fri Mar 18 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.3-1
- 2063429 - qpdf-10.6.3 is available
* Thu Feb 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.2-1
- 2053647 - qpdf-10.6.2 is available
* Mon Feb 14 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.1-1
- 2053647 - qpdf-10.6.1 is available
* Thu Feb 10 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.6.0-1
- 2052569 - qpdf-10.6.0 is available
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 10.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 05 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.5.0-2
- add qpdf-manual - now it is in a different archive
* Fri Jul 15 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-6
- 2106940 - FIPS breaks pdftopdf and bannertopdf
* Mon Jan 03 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.5.0-1
- 2034671 - qpdf-10.5.0 is available
* Wed Jun 29 2022 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-5
- 2095993 - Move qpdf to CRB repository
* Mon Dec 06 2021 Zdenek Dohnal <zdohnal@redhat.com> - 10.4.0-1
- 2023979 - qpdf-10.4.0 is available
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 10.3.1-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 10.3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Apr 20 2021 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-3
- 1950033 - Possible changes in zlib output causes FTBFS for qpdf
* Thu May 20 2021 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.2-1
- 1958536 - qpdf-10.3.2 is available
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 10.3.1-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Apr 19 2021 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-2
- aarch64 specific patches were removed from zlib, so no need for ours
- zlib got downstream patches on s390x, we need to patch qpdf test suite for it
* Fri Mar 12 2021 Zdenek Dohnal <zdohnal@redhat.com> - 10.3.1-1
- 1937988 - qpdf-10.3.1 is available

Loading…
Cancel
Save