2052569 - qpdf-10.6.0 is available

This commit is contained in:
Zdenek Dohnal 2022-02-10 13:13:31 +01:00
parent e5f998c88c
commit 0efca19c73
4 changed files with 38 additions and 33 deletions

2
.gitignore vendored
View File

@ -36,3 +36,5 @@
/qpdf-10.4.0.tar.gz
/qpdf-10.5.0.tar.gz
/qpdf-10.5.0-doc.zip
/qpdf-10.6.0-doc.zip
/qpdf-10.6.0.tar.gz

View File

@ -1,9 +1,9 @@
diff -up qpdf-10.2.0/libqpdf/QPDF.cc.relax qpdf-10.2.0/libqpdf/QPDF.cc
--- qpdf-10.2.0/libqpdf/QPDF.cc.relax 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/libqpdf/QPDF.cc 2021-02-24 12:35:50.715329461 +0100
@@ -11,6 +11,10 @@
#include <string.h>
diff -up qpdf-10.6.0/libqpdf/QPDF.cc.relax qpdf-10.6.0/libqpdf/QPDF.cc
--- qpdf-10.6.0/libqpdf/QPDF.cc.relax 2022-02-10 12:27:57.433450324 +0100
+++ qpdf-10.6.0/libqpdf/QPDF.cc 2022-02-10 12:41:11.071905145 +0100
@@ -13,6 +13,10 @@
#include <memory.h>
#include <regex>
+#ifdef HAVE_GNUTLS
+# include <gnutls/crypto.h>
@ -12,37 +12,37 @@ diff -up qpdf-10.2.0/libqpdf/QPDF.cc.relax qpdf-10.2.0/libqpdf/QPDF.cc
#include <qpdf/QTC.hh>
#include <qpdf/QUtil.hh>
#include <qpdf/Pipeline.hh>
@@ -261,7 +265,13 @@ QPDF::processFile(char const* filename,
@@ -270,7 +274,13 @@ QPDF::processFile(char const* filename,
{
FileInputSource* fi = new FileInputSource();
fi->setFilename(filename);
+#ifdef HAVE_GNUTLS
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
processInputSource(fi, password);
processInputSource(PointerHolder<InputSource>(fi), password);
+#ifdef HAVE_GNUTLS
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
@@ -270,7 +280,13 @@ QPDF::processFile(char const* descriptio
@@ -279,7 +289,13 @@ QPDF::processFile(char const* descriptio
{
FileInputSource* fi = new FileInputSource();
fi->setFile(description, filep, close_file);
+#ifdef HAVE_GNUTLS
+ GNUTLS_FIPS140_SET_LAX_MODE();
+#endif
processInputSource(fi, password);
processInputSource(PointerHolder<InputSource>(fi), password);
+#ifdef HAVE_GNUTLS
+ GNUTLS_FIPS140_SET_STRICT_MODE();
+#endif
}
void
diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_encryption.cc
--- qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/libqpdf/QPDF_encryption.cc 2021-02-24 12:37:17.267561185 +0100
diff -up qpdf-10.6.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.6.0/libqpdf/QPDF_encryption.cc
--- qpdf-10.6.0/libqpdf/QPDF_encryption.cc.relax 2022-02-09 11:47:58.000000000 +0100
+++ qpdf-10.6.0/libqpdf/QPDF_encryption.cc 2022-02-10 12:39:22.295390998 +0100
@@ -1,6 +1,8 @@
// This file implements methods from the QPDF class that involve
// encryption.
@ -63,7 +63,7 @@ diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_e
static unsigned char const padding_string[] = {
0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
@@ -1150,6 +1156,12 @@ QPDF::getKeyForObject(
@@ -1149,6 +1155,12 @@ QPDF::getKeyForObject(
void
QPDF::decryptString(std::string& str, int objid, int generation)
{
@ -75,10 +75,10 @@ diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_e
+
if (objid == 0)
{
return;
@@ -1230,6 +1242,10 @@ QPDF::decryptString(std::string& str, in
QUtil::int_to_string(objid) + " " +
QUtil::int_to_string(generation) + ": " + e.what());
return;
@@ -1229,6 +1241,10 @@ QPDF::decryptString(std::string& str, in
QUtil::int_to_string(objid) + " " +
QUtil::int_to_string(generation) + ": " + e.what());
}
+
+#ifdef HAVE_GNUTLS
@ -87,9 +87,9 @@ diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_e
}
void
@@ -1240,6 +1256,12 @@ QPDF::decryptStream(PointerHolder<Encryp
QPDFObjectHandle& stream_dict,
std::vector<PointerHolder<Pipeline> >& heap)
@@ -1239,6 +1255,12 @@ QPDF::decryptStream(PointerHolder<Encryp
QPDFObjectHandle& stream_dict,
std::vector<std::shared_ptr<Pipeline>>& heap)
{
+#ifdef HAVE_GNUTLS
+ unsigned oldmode = gnutls_fips140_mode_enabled();
@ -101,9 +101,9 @@ diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_e
if (stream_dict.getKey("/Type").isName())
{
@@ -1361,6 +1383,10 @@ QPDF::decryptStream(PointerHolder<Encryp
toI(key.length()));
}
heap.push_back(pipeline);
pipeline = new_pipeline.get();
heap.push_back(new_pipeline);
+
+#ifdef HAVE_GNUTLS
+ gnutls_fips140_set_mode(static_cast<gnutls_fips_mode_t>(oldmode), GNUTLS_FIPS140_SET_MODE_THREAD);
@ -111,10 +111,10 @@ diff -up qpdf-10.2.0/libqpdf/QPDF_encryption.cc.relax qpdf-10.2.0/libqpdf/QPDF_e
}
void
diff -up qpdf-10.2.0/libqpdf/QPDFWriter.cc.relax qpdf-10.2.0/libqpdf/QPDFWriter.cc
--- qpdf-10.2.0/libqpdf/QPDFWriter.cc.relax 2021-02-23 16:41:58.000000000 +0100
+++ qpdf-10.2.0/libqpdf/QPDFWriter.cc 2021-02-24 12:35:50.716329452 +0100
@@ -24,6 +24,10 @@
diff -up qpdf-10.6.0/libqpdf/QPDFWriter.cc.relax qpdf-10.6.0/libqpdf/QPDFWriter.cc
--- qpdf-10.6.0/libqpdf/QPDFWriter.cc.relax 2022-02-09 11:47:58.000000000 +0100
+++ qpdf-10.6.0/libqpdf/QPDFWriter.cc 2022-02-10 12:27:57.434450320 +0100
@@ -25,6 +25,10 @@
#include <algorithm>
#include <stdlib.h>
@ -125,7 +125,7 @@ diff -up qpdf-10.2.0/libqpdf/QPDFWriter.cc.relax qpdf-10.2.0/libqpdf/QPDFWriter.
QPDFWriter::Members::Members(QPDF& pdf) :
pdf(pdf),
filename("unspecified"),
@@ -321,6 +325,13 @@ void
@@ -339,6 +343,13 @@ void
QPDFWriter::setDeterministicID(bool val)
{
this->m->deterministic_id = val;
@ -139,7 +139,7 @@ diff -up qpdf-10.2.0/libqpdf/QPDFWriter.cc.relax qpdf-10.2.0/libqpdf/QPDFWriter.
}
void
@@ -342,6 +353,13 @@ void
@@ -360,6 +371,13 @@ void
QPDFWriter::setPreserveEncryption(bool val)
{
this->m->preserve_encryption = val;

View File

@ -1,7 +1,7 @@
Summary: Command-line tools and library for transforming PDF files
Name: qpdf
Version: 10.5.0
Release: 3%{?dist}
Version: 10.6.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)
@ -141,7 +141,7 @@ make check
%doc README.md TODO ChangeLog
%license Artistic-2.0
%{_libdir}/libqpdf.so.28
%{_libdir}/libqpdf.so.28.5.0
%{_libdir}/libqpdf.so.28.6.0
%files devel
%doc examples/*.cc examples/*.c
@ -154,6 +154,9 @@ make check
%changelog
* 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

View File

@ -1,2 +1,2 @@
SHA512 (qpdf-10.5.0-doc.zip) = 75c4eac6e828eb5f8544b4194b775e8258a769aa5e18006b9491d9658981abcd286cd082a233122805e785f283704dccaf2078cd84965ab58ebc6c80fdb4a06f
SHA512 (qpdf-10.5.0.tar.gz) = 758dd4fd86b79a8b08738abb36685cf4a458dcf70a480efe3207d1148a691cf06a8040c83075ace9c3bbaf372cefe78508df2e52513cc969dca76442ed43775d
SHA512 (qpdf-10.6.0-doc.zip) = 21356cc29f383ce99a8bcf72eceba734b030e37d4ed7f8b7c20babd1af10fea776507c66dc51bc0b6ceb0904dc7abed75909ddf909cbf17de29cc6b7fb4adb24
SHA512 (qpdf-10.6.0.tar.gz) = df7a6d58f6682e9259a18d489078ac9363dd81723fb99dd7f58ef9e920fff139a59ce2e90fe7028180a71c8022ee13b88c0dd87287d6daf4f2bf4eb9b73e9c16