From c02660af803151382408ece995c0020110dd9ff3 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 16:04:01 +0000 Subject: [PATCH] import UBI poppler-24.02.0-6.el10 --- .gitignore | 4 +- .poppler.metadata | 2 - ...ppler-0.30.0-rotated-words-selection.patch | 279 ----- SOURCES/poppler-0.66.0-nss.patch | 1055 ----------------- .../poppler-20.11.0-XRef-check-isDict.patch | 21 - SOURCES/poppler-20.11.0-bad-generation.patch | 35 - SOURCES/poppler-20.11.0-check-gdatetime.patch | 30 - SOURCES/poppler-20.11.0-check-isDict.patch | 34 - ...pler-20.11.0-fix-crash-in-FoFiType1C.patch | 45 - SOURCES/poppler-20.11.0-hints.patch | 58 - ...poppler-20.11.0-jbig-symbol-overflow.patch | 26 - ...ler-20.11.0-pdfunite-broken-document.patch | 48 - ...oppler-20.11.0-pdfunite-check-isDict.patch | 41 - ...ler-0.90.0-position-independent-code.patch | 12 + poppler-21.01.0-glib-introspection.patch | 11 + ...can.patch => poppler-24.02.0-covscan.patch | 88 +- ...tch => poppler-24.02.0-pdfinfo-dests.patch | 54 +- SPECS/poppler.spec => poppler.spec | 527 +++++--- sources | 2 + 19 files changed, 431 insertions(+), 1941 deletions(-) delete mode 100644 .poppler.metadata delete mode 100644 SOURCES/poppler-0.30.0-rotated-words-selection.patch delete mode 100644 SOURCES/poppler-0.66.0-nss.patch delete mode 100644 SOURCES/poppler-20.11.0-XRef-check-isDict.patch delete mode 100644 SOURCES/poppler-20.11.0-bad-generation.patch delete mode 100644 SOURCES/poppler-20.11.0-check-gdatetime.patch delete mode 100644 SOURCES/poppler-20.11.0-check-isDict.patch delete mode 100644 SOURCES/poppler-20.11.0-fix-crash-in-FoFiType1C.patch delete mode 100644 SOURCES/poppler-20.11.0-hints.patch delete mode 100644 SOURCES/poppler-20.11.0-jbig-symbol-overflow.patch delete mode 100644 SOURCES/poppler-20.11.0-pdfunite-broken-document.patch delete mode 100644 SOURCES/poppler-20.11.0-pdfunite-check-isDict.patch create mode 100644 poppler-0.90.0-position-independent-code.patch create mode 100644 poppler-21.01.0-glib-introspection.patch rename SOURCES/poppler-0.66.0-covscan.patch => poppler-24.02.0-covscan.patch (72%) rename SOURCES/poppler-20.11.0-pdfinfo-dests.patch => poppler-24.02.0-pdfinfo-dests.patch (68%) rename SPECS/poppler.spec => poppler.spec (72%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index eedabbd..67b7f1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/poppler-20.11.0.tar.xz -SOURCES/poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz +poppler-24.02.0.tar.xz +poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz diff --git a/.poppler.metadata b/.poppler.metadata deleted file mode 100644 index 596bfa9..0000000 --- a/.poppler.metadata +++ /dev/null @@ -1,2 +0,0 @@ -0aa751121aed6ee2220ef3ea16b9df8f9b2e81c1 SOURCES/poppler-20.11.0.tar.xz -b58229322eb8f44a2bb1d98114b9fa3dfbef6a0a SOURCES/poppler-test-2009-05-13_0d2bfd4af4c76a3bac27ccaff793d9129df7b57a.tar.xz diff --git a/SOURCES/poppler-0.30.0-rotated-words-selection.patch b/SOURCES/poppler-0.30.0-rotated-words-selection.patch deleted file mode 100644 index 98230f9..0000000 --- a/SOURCES/poppler-0.30.0-rotated-words-selection.patch +++ /dev/null @@ -1,279 +0,0 @@ -From 0ab1f29d4ce315b0fca260c0e0f3007024d00342 Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Tue, 28 Jan 2014 15:13:24 +0100 -Subject: [PATCH] TextOutputDev: Respect orientation when selecting words - -Take rotation into account when visiting selection. -This doesn't fix all problems (there are still problems -on line and block levels). - -https://bugs.freedesktop.org/show_bug.cgi?id=16619 ---- - poppler/TextOutputDev.cc | 193 ++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 150 insertions(+), 43 deletions(-) - -diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc -index 7c2ca78..e93908c 100644 ---- a/poppler/TextOutputDev.cc -+++ b/poppler/TextOutputDev.cc -@@ -178,6 +178,12 @@ - // to read the underlying image. Issue #157 - #define glyphlessSelectionOpacity 0.4 - -+// Returns whether x is between a and b or equal to a or b. -+// a and b don't need to be sorted. -+#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \ -+ ((x) < (a) && (x) < (b))) ? \ -+ true : false) -+ - namespace { - - inline bool isAscii7(Unicode uchar) -@@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line, - PDFRectangle *rect; - double x1, y1, x2, y2, margin; - -- margin = (line->yMax - line->yMin) / 8; -- x1 = line->edge[edge_begin]; -- y1 = line->yMin - margin; -- x2 = line->edge[edge_end]; -- y2 = line->yMax + margin; -+ switch (line->rot) { -+ default: -+ case 0: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_begin]; -+ x2 = line->edge[edge_end]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 1: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_begin]; -+ y2 = line->edge[edge_end]; -+ break; -+ case 2: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_end]; -+ x2 = line->edge[edge_begin]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 3: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_end]; -+ y2 = line->edge[edge_begin]; -+ break; -+ } - - rect = new PDFRectangle(floor(x1 * scale), floor(y1 * scale), ceil(x2 * scale), ceil(y2 * scale)); - list->push_back(rect); -@@ -4499,19 +4531,56 @@ void TextSelectionPainter::visitLine (TextLine *line, - { - double x1, y1, x2, y2, margin; - -- margin = (line->yMax - line->yMin) / 8; -- x1 = floor(line->edge[edge_begin]); -- y1 = floor(line->yMin - margin); -- x2 = ceil(line->edge[edge_end]); -- y2 = ceil(line->yMax + margin); -+ switch (line->rot) { -+ default: -+ case 0: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_begin]; -+ x2 = line->edge[edge_end]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 1: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_begin]; -+ y2 = line->edge[edge_end]; -+ break; -+ case 2: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_end]; -+ x2 = line->edge[edge_begin]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 3: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_end]; -+ y2 = line->edge[edge_begin]; -+ break; -+ } -+ -+ ctm.transform(x1, y1, &x1, &y1); -+ ctm.transform(x2, y2, &x2, &y2); - -- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1); -- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2); -+ if (x1 < x2) { -+ x1 = floor(x1); -+ x2 = ceil(x2); -+ } else { -+ x1 = ceil(x1); -+ x2 = floor(x2); -+ } - -- x1 = floor(x1); -- y1 = floor(y1); -- x2 = ceil(x2); -- y2 = ceil(y2); -+ if (y1 < y2) { -+ y1 = floor(y1); -+ y2 = ceil(y2); -+ } else { -+ y1 = ceil(y1); -+ y2 = floor(y2); -+ } - - ictm.transform(x1, y1, &x1, &y1); - ictm.transform(x2, y2, &x2, &y2); -@@ -4589,17 +4658,26 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor, - void TextWord::visitSelection(TextSelectionVisitor *visitor, const PDFRectangle *selection, SelectionStyle style) - { - int i, begin, end; -- double mid; -+ double mid, s1, s2; -+ -+ if (rot == 0 || rot == 2) { -+ s1 = selection->x1; -+ s2 = selection->x2; -+ } else { -+ s1 = selection->y1; -+ s2 = selection->y2; -+ } - - begin = len; - end = 0; - for (i = 0; i < len; i++) { - mid = (edge[i] + edge[i + 1]) / 2; -- if (selection->x1 < mid || selection->x2 < mid) -- if (i < begin) -- begin = i; -- if (mid < selection->x1 || mid < selection->x2) -- end = i + 1; -+ if (XBetweenAB (mid, s1, s2)) { -+ if (i < begin) -+ begin = i; -+ -+ end = i + 1; -+ } - } - - /* Skip empty selection. */ -@@ -4615,26 +4694,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, - TextWord *p, *begin, *end, *current; - int i, edge_begin, edge_end; - PDFRectangle child_selection; -+ double s1, s2, p_min, p_max; -+ -+ if (rot == 0 || rot == 2) { -+ s1 = selection->x1; -+ s2 = selection->x2; -+ } else { -+ s1 = selection->y1; -+ s2 = selection->y2; -+ } - - begin = nullptr; - end = nullptr; - current = nullptr; - for (p = words; p != nullptr; p = p->next) { -+ if (rot == 0 || rot == 2) { -+ p_min = p->xMin; -+ p_max = p->xMax; -+ } else { -+ p_min = p->yMin; -+ p_max = p->yMax; -+ } -+ - if (blk->page->primaryLR) { -- if ((selection->x1 < p->xMax) || (selection->x2 < p->xMax)) -- if (begin == nullptr) -- begin = p; -+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr) -+ begin = p; - -- if (((selection->x1 > p->xMin) || (selection->x2 > p->xMin)) && (begin != nullptr)) { -+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) { - end = p->next; - current = p; - } - } else { -- if ((selection->x1 > p->xMin) || (selection->x2 > p->xMin)) -- if (begin == nullptr) -- begin = p; -+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr) -+ begin = p; - -- if (((selection->x1 < p->xMax) || (selection->x2 < p->xMax)) && (begin != nullptr)) { -+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) { - end = p->next; - current = p; - } -@@ -4650,23 +4740,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, - - child_selection = *selection; - if (style == selectionStyleWord) { -- child_selection.x1 = begin ? begin->xMin : xMin; -- if (end && end->xMax != -1) { -- child_selection.x2 = current->xMax; -+ if (rot == 0 || rot == 2) { -+ child_selection.x1 = begin ? begin->xMin : xMin; -+ if (end && end->xMax != -1) { -+ child_selection.x2 = current->xMax; -+ } else { -+ child_selection.x2 = xMax; -+ } - } else { -- child_selection.x2 = xMax; -+ child_selection.y1 = begin ? begin->yMin : yMin; -+ if (end && end->yMax != -1) { -+ child_selection.y2 = current->yMax; -+ } else { -+ child_selection.y2 = yMax; -+ } - } - } - -+ if (rot == 0 || rot == 2) { -+ s1 = child_selection.x1; -+ s2 = child_selection.x2; -+ } else { -+ s1 = child_selection.y1; -+ s2 = child_selection.y2; -+ } -+ - edge_begin = len; - edge_end = 0; - for (i = 0; i < len; i++) { - double mid = (edge[i] + edge[i + 1]) / 2; -- if (child_selection.x1 < mid || child_selection.x2 < mid) -- if (i < edge_begin) -- edge_begin = i; -- if (mid < child_selection.x2 || mid < child_selection.x1) -- edge_end = i + 1; -+ if (XBetweenAB (mid, s1, s2)) { -+ if (i < edge_begin) -+ edge_begin = i; -+ -+ edge_end = i + 1; -+ } - } - - /* Skip empty selection. */ --- -1.8.4.2 - diff --git a/SOURCES/poppler-0.66.0-nss.patch b/SOURCES/poppler-0.66.0-nss.patch deleted file mode 100644 index 28db9dc..0000000 --- a/SOURCES/poppler-0.66.0-nss.patch +++ /dev/null @@ -1,1055 +0,0 @@ -diff --git a/config.h.cmake b/config.h.cmake -index 7989cbfb..6f5e147e 100644 ---- a/config.h.cmake -+++ b/config.h.cmake -@@ -24,9 +24,6 @@ - /* Use zlib instead of builtin zlib decoder to uncompress flate streams. */ - #cmakedefine ENABLE_ZLIB_UNCOMPRESS 1 - --/* Build against libnss3 for digital signature validation */ --#cmakedefine ENABLE_NSS3 1 -- - /* Use cairo for rendering. */ - #cmakedefine HAVE_CAIRO 1 - -diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc -index 16476f4f..9f4adda3 100644 ---- a/poppler/Decrypt.cc -+++ b/poppler/Decrypt.cc -@@ -39,17 +39,33 @@ - #include "goo/grandom.h" - #include "Decrypt.h" - #include "Error.h" -- -+#ifdef ENABLE_NSS3 -+#include -+#include -+#include -+#endif -+ -+#ifdef ENABLE_NSS3 -+static PK11Context *rc4InitContext(const unsigned char *key, int keyLen); -+static unsigned char rc4DecryptByte(PK11Context *context, unsigned char c); -+#else - static void rc4InitKey(const unsigned char *key, int keyLen, unsigned char *state); - static unsigned char rc4DecryptByte(unsigned char *state, unsigned char *x, unsigned char *y, unsigned char c); -+#endif - - static bool aesReadBlock(Stream *str, unsigned char *in, bool addPadding); - -+#ifdef ENABLE_NSS3 -+static PK11Context *aesInitContext(unsigned char *in, unsigned char *objKey, int objKeyLength, bool decrypt); -+#else - static void aesKeyExpansion(DecryptAESState *s, const unsigned char *objKey, int objKeyLen, bool decrypt); -+#endif - static void aesEncryptBlock(DecryptAESState *s, const unsigned char *in); - static void aesDecryptBlock(DecryptAESState *s, const unsigned char *in, bool last); - -+#ifndef ENABLE_NSS3 - static void aes256KeyExpansion(DecryptAES256State *s, const unsigned char *objKey, int objKeyLen, bool decrypt); -+#endif - static void aes256EncryptBlock(DecryptAES256State *s, const unsigned char *in); - static void aes256DecryptBlock(DecryptAES256State *s, const unsigned char *in, bool last); - -@@ -70,6 +86,31 @@ static const unsigned char passwordPad[32] = { - // Decrypt - //------------------------------------------------------------------------ - -+#ifdef ENABLE_NSS3 -+static void shutdownNSS() -+{ -+ if (NSS_Shutdown() != SECSuccess) { -+ error(errInternal, -1, "NSS shutdown failed: {0:s}", -+ PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT)); -+ } -+} -+ -+static bool initNSS() { -+ if (NSS_IsInitialized()) { -+ return true; -+ } else { -+ if (NSS_NoDB_Init(".") != SECSuccess) { -+ error(errInternal, -1, "NSS initialization failed: {0:s}", -+ PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT)); -+ return false; -+ } else { -+ atexit(shutdownNSS); -+ return true; -+ } -+ } -+} -+#endif -+ - bool Decrypt::makeFileKey(int encVersion, int encRevision, int keyLength, const GooString *ownerKey, const GooString *userKey, const GooString *ownerEnc, const GooString *userEnc, int permissions, const GooString *fileID, - const GooString *ownerPassword, const GooString *userPassword, unsigned char *fileKey, bool encryptMetadata, bool *ownerPasswordOk) - { -@@ -80,13 +121,21 @@ bool Decrypt::makeFileKey(int encVersio - DecryptAES256State state; - unsigned char test[127 + 56], test2[32]; - GooString *userPassword2; -- unsigned char fState[256]; - unsigned char tmpKey[16]; -- unsigned char fx, fy; - int len, i, j; -+#ifdef ENABLE_NSS3 -+ PK11Context *rc4Context; -+#else -+ unsigned char fState[256]; -+ unsigned char fx, fy; -+#endif - - *ownerPasswordOk = false; - -+#ifdef ENABLE_NSS3 -+ initNSS(); -+#endif -+ - if (encRevision == 5 || encRevision == 6) { - - // check the owner password -@@ -115,14 +164,26 @@ bool Decrypt::makeFileKey(int encVersio - // test contains the initial SHA-256 hash input K. - revision6Hash(ownerPassword, test, userKey->c_str()); - } -+#ifndef ENABLE_NSS3 - aes256KeyExpansion(&state, test, 32, true); -+#endif - for (i = 0; i < 16; ++i) { - state.cbc[i] = 0; - } -+#ifdef ENABLE_NSS3 -+ state.context = aesInitContext(state.cbc, test, 32, true); -+ if (state.context) { -+#endif - aes256DecryptBlock(&state, (unsigned char *)ownerEnc->c_str(), false); - memcpy(fileKey, state.buf, 16); - aes256DecryptBlock(&state, (unsigned char *)ownerEnc->c_str() + 16, false); - memcpy(fileKey + 16, state.buf, 16); -+#ifdef ENABLE_NSS3 -+ PK11_DestroyContext(state.context, PR_TRUE); -+ } else { -+ return false; -+ } -+#endif - - *ownerPasswordOk = true; - return true; -@@ -156,14 +217,26 @@ bool Decrypt::makeFileKey(int encVersio - // user key is not used in computing intermediate user key. - revision6Hash(userPassword, test, nullptr); - } -+#ifndef ENABLE_NSS3 - aes256KeyExpansion(&state, test, 32, true); -+#endif - for (i = 0; i < 16; ++i) { - state.cbc[i] = 0; - } -+#ifdef ENABLE_NSS3 -+ state.context = aesInitContext(state.cbc, test, 32, true); -+ if (state.context) { -+#endif - aes256DecryptBlock(&state, (unsigned char *)userEnc->c_str(), false); - memcpy(fileKey, state.buf, 16); - aes256DecryptBlock(&state, (unsigned char *)userEnc->c_str() + 16, false); - memcpy(fileKey + 16, state.buf, 16); -+#ifdef ENABLE_NSS3 -+ PK11_DestroyContext(state.context, PR_TRUE); -+ } else { -+ return false; -+ } -+#endif - - return true; - } -@@ -189,22 +262,41 @@ bool Decrypt::makeFileKey(int encVersio - } - } - if (encRevision == 2) { -+#ifdef ENABLE_NSS3 -+ rc4Context = rc4InitContext(test, keyLength); -+ if (rc4Context) { -+ for (i = 0; i < 32; ++i) -+ test2[i] = rc4DecryptByte(rc4Context, ownerKey->getChar(i)); -+ PK11_DestroyContext(rc4Context, PR_TRUE); -+ } -+#else - rc4InitKey(test, keyLength, fState); - fx = fy = 0; - for (i = 0; i < 32; ++i) { - test2[i] = rc4DecryptByte(fState, &fx, &fy, ownerKey->getChar(i)); - } -+#endif - } else { - memcpy(test2, ownerKey->c_str(), 32); - for (i = 19; i >= 0; --i) { - for (j = 0; j < keyLength; ++j) { - tmpKey[j] = test[j] ^ i; - } -+#ifdef ENABLE_NSS3 -+ rc4Context = rc4InitContext(tmpKey, keyLength); -+ if (rc4Context) { -+ for (j = 0; j < 32; ++j) { -+ test2[j] = rc4DecryptByte(rc4Context, test2[j]); -+ } -+ PK11_DestroyContext(rc4Context, PR_TRUE); -+ } -+#else - rc4InitKey(tmpKey, keyLength, fState); - fx = fy = 0; - for (j = 0; j < 32; ++j) { - test2[j] = rc4DecryptByte(fState, &fx, &fy, test2[j]); - } -+#endif - } - } - userPassword2 = new GooString((char *)test2, 32); -@@ -232,11 +324,15 @@ bool Decrypt::makeFileKey2(int encVersi - { - unsigned char *buf; - unsigned char test[32]; -- unsigned char fState[256]; - unsigned char tmpKey[16]; -- unsigned char fx, fy; - int len, i, j; -- bool ok; -+ bool ok = true; -+#ifdef ENABLE_NSS3 -+ PK11Context *rc4Context; -+#else -+ unsigned char fState[256]; -+ unsigned char fx, fy; -+#endif - - // generate file key - buf = (unsigned char *)gmalloc(72 + fileID->getLength()); -@@ -273,28 +369,52 @@ bool Decrypt::makeFileKey2(int encVersi - - // test user password - if (encRevision == 2) { -+#ifdef ENABLE_NSS3 -+ rc4Context = rc4InitContext(fileKey, keyLength); -+ if (rc4Context) { -+ for (i = 0; i < 32; ++i) -+ test[i] = rc4DecryptByte(rc4Context, userKey->getChar(i)); -+ PK11_DestroyContext(rc4Context, PR_TRUE); -+ } else { -+ ok = false; -+ } -+#else - rc4InitKey(fileKey, keyLength, fState); - fx = fy = 0; - for (i = 0; i < 32; ++i) { - test[i] = rc4DecryptByte(fState, &fx, &fy, userKey->getChar(i)); - } -- ok = memcmp(test, passwordPad, 32) == 0; -+#endif -+ if (ok) -+ ok = memcmp(test, passwordPad, 32) == 0; - } else if (encRevision == 3) { - memcpy(test, userKey->c_str(), 32); - for (i = 19; i >= 0; --i) { - for (j = 0; j < keyLength; ++j) { - tmpKey[j] = fileKey[j] ^ i; - } -+#ifdef ENABLE_NSS3 -+ rc4Context = rc4InitContext(tmpKey, keyLength); -+ if (rc4Context) { -+ for (j = 0; j < 32; ++j) -+ test[j] = rc4DecryptByte(rc4Context, test[j]); -+ PK11_DestroyContext(rc4Context, PR_TRUE); -+ } else { -+ ok = false; -+ } -+#else - rc4InitKey(tmpKey, keyLength, fState); - fx = fy = 0; - for (j = 0; j < 32; ++j) { - test[j] = rc4DecryptByte(fState, &fx, &fy, test[j]); - } -+#endif - } - memcpy(buf, passwordPad, 32); - memcpy(buf + 32, fileID->c_str(), fileID->getLength()); - md5(buf, 32 + fileID->getLength(), buf); -- ok = memcmp(test, buf, 16) == 0; -+ if (ok) -+ ok = memcmp(test, buf, 16) == 0; - } else { - ok = false; - } -@@ -334,6 +454,9 @@ BaseCryptStream::BaseCryptStream(Stream - if ((objKeyLength = keyLength + 5) > 16) { - objKeyLength = 16; - } -+#ifdef ENABLE_NSS3 -+ state.rc4.context = nullptr; -+#endif - break; - case cryptAES: - objKey[keyLength] = refA.num & 0xff; -@@ -349,9 +472,15 @@ BaseCryptStream::BaseCryptStream(Stream - if ((objKeyLength = keyLength + 5) > 16) { - objKeyLength = 16; - } -+#ifdef ENABLE_NSS3 -+ state.aes.context = nullptr; -+#endif - break; - case cryptAES256: - objKeyLength = keyLength; -+#ifdef ENABLE_NSS3 -+ state.aes256.context = nullptr; -+#endif - break; - case cryptNone: - break; -@@ -359,10 +488,33 @@ BaseCryptStream::BaseCryptStream(Stream - charactersRead = 0; - nextCharBuff = EOF; - autoDelete = true; -+ -+#ifdef ENABLE_NSS3 -+ initNSS(); -+#endif - } - - BaseCryptStream::~BaseCryptStream() - { -+#ifdef ENABLE_NSS3 -+ switch (algo) { -+ case cryptRC4: -+ if (state.rc4.context) -+ PK11_DestroyContext(state.rc4.context, PR_TRUE); -+ break; -+ case cryptAES: -+ if (state.aes.context) -+ PK11_DestroyContext(state.aes.context, PR_TRUE); -+ break; -+ case cryptAES256: -+ if (state.aes256.context) -+ PK11_DestroyContext(state.aes256.context, PR_TRUE); -+ break; -+ default: -+ break; -+ } -+#endif -+ - if (autoDelete) { - delete str; - } -@@ -424,18 +576,40 @@ void EncryptStream::reset() { - - switch (algo) { - case cryptRC4: -+#ifdef ENABLE_NSS3 -+ if (state.rc4.context) -+ PK11_DestroyContext(state.rc4.context, PR_TRUE); -+ state.rc4.context = rc4InitContext(objKey, objKeyLength); -+#else - state.rc4.x = state.rc4.y = 0; - rc4InitKey(objKey, objKeyLength, state.rc4.state); -+#endif - break; - case cryptAES: -+#ifdef ENABLE_NSS3 -+ memcpy(state.aes.buf, state.aes.cbc, 16); // Copy CBC IV to buf -+ if (state.aes.context) -+ PK11_DestroyContext(state.aes.context, PR_TRUE); -+ state.aes.context = aesInitContext(state.aes.cbc, objKey, objKeyLength, -+ false); -+#else - aesKeyExpansion(&state.aes, objKey, objKeyLength, false); - memcpy(state.aes.buf, state.aes.cbc, 16); // Copy CBC IV to buf -+#endif - state.aes.bufIdx = 0; - state.aes.paddingReached = false; - break; - case cryptAES256: -+#ifdef ENABLE_NSS3 -+ memcpy(state.aes256.buf, state.aes256.cbc, 16); // Copy CBC IV to buf -+ if (state.aes256.context) -+ PK11_DestroyContext(state.aes256.context, PR_TRUE); -+ state.aes256.context = aesInitContext(state.aes256.cbc, objKey, objKeyLength, -+ false); -+#else - aes256KeyExpansion(&state.aes256, objKey, objKeyLength, false); - memcpy(state.aes256.buf, state.aes256.cbc, 16); // Copy CBC IV to buf -+#endif - state.aes256.bufIdx = 0; - state.aes256.paddingReached = false; - break; -@@ -456,7 +630,11 @@ int EncryptStream::lookChar() { - case cryptRC4: - if ((c = str->getChar()) != EOF) { - // RC4 is XOR-based: the decryption algorithm works for encryption too -+#ifdef ENABLE_NSS3 -+ c = rc4DecryptByte(state.rc4.context, (unsigned char)c); -+#else - c = rc4DecryptByte(state.rc4.state, &state.rc4.x, &state.rc4.y, (unsigned char)c); -+#endif - } - break; - case cryptAES: -@@ -506,21 +684,47 @@ void DecryptStream::reset() { - - switch (algo) { - case cryptRC4: -+#ifdef ENABLE_NSS3 -+ if (state.rc4.context) -+ PK11_DestroyContext(state.rc4.context, PR_TRUE); -+ state.rc4.context = rc4InitContext(objKey, objKeyLength); -+#else - state.rc4.x = state.rc4.y = 0; - rc4InitKey(objKey, objKeyLength, state.rc4.state); -+#endif - break; - case cryptAES: -+#ifdef ENABLE_NSS3 -+ if (state.aes.context) -+ PK11_DestroyContext(state.aes.context, PR_TRUE); -+ for (i = 0; i < 16; ++i) { -+ state.aes.cbc[i] = str->getChar(); -+ } -+ state.aes.context = aesInitContext(state.aes.cbc, objKey, objKeyLength, -+ true); -+#else - aesKeyExpansion(&state.aes, objKey, objKeyLength, true); - for (i = 0; i < 16; ++i) { - state.aes.cbc[i] = str->getChar(); - } -+#endif - state.aes.bufIdx = 16; - break; - case cryptAES256: -+#ifdef ENABLE_NSS3 -+ if (state.aes256.context) -+ PK11_DestroyContext(state.aes256.context, PR_TRUE); -+ for (i = 0; i < 16; ++i) { -+ state.aes256.cbc[i] = str->getChar(); -+ } -+ state.aes256.context = aesInitContext(state.aes256.cbc, objKey, objKeyLength, -+ true); -+#else - aes256KeyExpansion(&state.aes256, objKey, objKeyLength, true); - for (i = 0; i < 16; ++i) { - state.aes256.cbc[i] = str->getChar(); - } -+#endif - state.aes256.bufIdx = 16; - break; - case cryptNone: -@@ -539,10 +743,21 @@ int DecryptStream::lookChar() { - switch (algo) { - case cryptRC4: - if ((c = str->getChar()) != EOF) { -+#ifdef ENABLE_NSS3 -+ if (unlikely(state.rc4.context == nullptr)) -+ c = EOF; -+ else -+ c = rc4DecryptByte(state.rc4.context, (unsigned char)c); -+#else - c = rc4DecryptByte(state.rc4.state, &state.rc4.x, &state.rc4.y, (unsigned char)c); -+#endif - } - break; - case cryptAES: -+#ifdef ENABLE_NSS3 -+ if (unlikely(state.aes.context == nullptr)) -+ break; -+#endif - if (state.aes.bufIdx == 16) { - if (aesReadBlock(str, in, false)) { - aesDecryptBlock(&state.aes, in, str->lookChar() == EOF); -@@ -555,6 +770,10 @@ int DecryptStream::lookChar() { - } - break; - case cryptAES256: -+#ifdef ENABLE_NSS3 -+ if (unlikely(state.aes256.context == nullptr)) -+ break; -+#endif - if (state.aes256.bufIdx == 16) { - if (aesReadBlock(str, in, false)) { - aes256DecryptBlock(&state.aes256, in, str->lookChar() == EOF); -@@ -576,7 +795,176 @@ int DecryptStream::lookChar() { - // RC4-compatible decryption - //------------------------------------------------------------------------ - -+#ifdef ENABLE_NSS3 -+/* -+ * This function turns given key into token key (compared to a session key -+ * which is prohibited in FIPS mode). -+ */ -+static PK11SymKey *tokenizeKey(const unsigned char *key, int keyLen, -+ CK_ATTRIBUTE_TYPE operation) { -+ CK_MECHANISM_TYPE cipherMech = CKM_AES_CBC_PAD; -+ PK11SlotInfo *slot; -+ PK11SymKey *wrappingKey = nullptr; -+ PK11SymKey *symKey = nullptr; -+ PK11SymKey *token = nullptr; -+ SECStatus retval; -+ SECItem *secParam = nullptr; -+ SECItem ivItem, wrappedKey; -+ unsigned char output[48]; // Buffer to hold 256 bit key + padding -+ unsigned char iv[16]; // Initialization vector for AES -+ unsigned int outputLength; -+ int i; -+ -+ slot = PK11_GetBestSlot(CKM_AES_KEY_GEN, nullptr); -+ if (slot == nullptr) { -+ error(errInternal, -1, "Unable to find security device (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ // Generate random key for wrapping of given key by AES-256 -+ wrappingKey = PK11_KeyGen(slot, CKM_AES_KEY_GEN, nullptr, 32, nullptr); -+ if (wrappingKey == nullptr) { -+ error(errInternal, -1, "Failed to generate wrapping key (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ for (i = 0; i < 16; i++) -+ iv[i] = i; -+ -+ ivItem.type = siBuffer; -+ ivItem.data = iv; -+ ivItem.len = 16; -+ -+ secParam = PK11_ParamFromIV(cipherMech, &ivItem); -+ if (secParam == nullptr) { -+ error(errInternal, -1, "Failed to set up PKCS11 param (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ // Encrypt given key -+ retval = PK11_Encrypt(wrappingKey, -+ cipherMech, -+ secParam, -+ output, -+ &outputLength, -+ sizeof(output), -+ key, -+ keyLen); -+ if (retval != SECSuccess) { -+ error(errInternal, -1, "Failed to encrypt key (err {0:d})", -+ PR_GetError()); -+ } -+ -+ wrappedKey.type = siBuffer; -+ wrappedKey.data = output; -+ wrappedKey.len = outputLength; -+ -+ // Unwrap the wrapped key to token so it can be used in FIPS mode -+ token = PK11_UnwrapSymKey(wrappingKey, -+ cipherMech, -+ &ivItem, -+ &wrappedKey, -+ operation, -+ CKA_UNWRAP, -+ keyLen); -+ -+ if (token == nullptr) { -+ error(errInternal, -1, "Failed to unwrap symmetric key (err {0:d})", -+ PR_GetError()); -+ } -+ -+err: -+ if (secParam != nullptr) -+ SECITEM_FreeItem(secParam, PR_TRUE); -+ -+ if (wrappingKey != nullptr) -+ PK11_FreeSymKey(wrappingKey); -+ -+ if (symKey != nullptr) -+ PK11_FreeSymKey(symKey); -+ -+ if (slot != nullptr) -+ PK11_FreeSlot(slot); -+ -+ return token; -+} -+ -+static PK11Context *rc4InitContext(const unsigned char *key, int keyLen) { -+ CK_MECHANISM_TYPE cipherMech = CKM_RC4; -+ PK11SlotInfo *slot = nullptr; -+ PK11SymKey *symKey = nullptr; -+ SECItem *secParam = nullptr; -+ PK11Context *context = nullptr; -+ -+ slot = PK11_GetBestSlot(cipherMech, nullptr); -+ if (slot == nullptr) { -+ error(errInternal, -1, "Unable to find security device (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ symKey = tokenizeKey(key, keyLen, cipherMech); -+ if (symKey == nullptr) { -+ error(errInternal, -1, "Failed to create token from key (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ secParam = PK11_ParamFromIV(cipherMech, nullptr); -+ if (secParam == nullptr) { -+ error(errInternal, -1, "Failed to set up PKCS11 param (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ context = PK11_CreateContextBySymKey(cipherMech, -+ CKA_DECRYPT, -+ symKey, -+ secParam); -+ if (context == nullptr) { -+ error(errInternal, -1, "Failed to create context (err {0:d})", -+ PR_GetError()); -+ } -+ -+err: -+ if (secParam != nullptr) -+ SECITEM_FreeItem(secParam, PR_TRUE); -+ -+ if (symKey != nullptr) -+ PK11_FreeSymKey(symKey); -+ -+ if (slot != nullptr) -+ PK11_FreeSlot(slot); -+ -+ return context; -+} -+ -+static unsigned char rc4DecryptByte(PK11Context *context, unsigned char c) { -+ unsigned char outputChar = 0; -+ SECStatus retval; -+ int outputLength; -+ -+ retval = PK11_CipherOp(context, -+ &outputChar, -+ &outputLength, -+ 1, -+ &c, -+ 1); -+ -+ if (retval != SECSuccess) { -+ error(errInternal, -1, "Failed to decrypt byte (err {0:d})", -+ PR_GetError()); -+ } -+ -+ return outputChar; -+} -+ -+#else -+ - static void rc4InitKey(const unsigned char *key, int keyLen, unsigned char *state) - { - unsigned char index1, index2; - unsigned char t; -@@ -609,6 +997,8 @@ static unsigned char rc4DecryptByte(unsigned char *sta - return c ^ state[(tx + ty) % 256]; - } - -+#endif -+ - //------------------------------------------------------------------------ - // AES decryption - //------------------------------------------------------------------------ -@@ -639,6 +1029,178 @@ static bool aesReadBlock(Stream *str, G - } - } - -+#ifdef ENABLE_NSS3 -+ -+static PK11Context *aesInitContext(unsigned char *in, unsigned char *objKey, -+ int objKeyLength, bool decrypt) { -+ CK_MECHANISM_TYPE cipherMech = CKM_AES_CBC; -+ CK_ATTRIBUTE_TYPE operationType = decrypt ? CKA_DECRYPT : CKA_ENCRYPT; -+ PK11SlotInfo *slot; -+ PK11SymKey *symKey = nullptr; -+ SECItem *secParam = nullptr; -+ PK11Context *context = nullptr; -+ SECItem ivItem; -+ -+ slot = PK11_GetBestSlot(cipherMech, nullptr); -+ if (slot == nullptr) { -+ error(errInternal, -1, "Unable to find security device (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ symKey = tokenizeKey(objKey, objKeyLength, cipherMech); -+ if (symKey == nullptr) { -+ error(errInternal, -1, "Failed to create token from key (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ ivItem.type = siBuffer; -+ ivItem.data = in; -+ ivItem.len = 16; -+ -+ secParam = PK11_ParamFromIV(cipherMech, &ivItem); -+ if (secParam == nullptr) { -+ error(errInternal, -1, "Failed to set up PKCS11 param (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ context = PK11_CreateContextBySymKey(cipherMech, -+ operationType, -+ symKey, -+ secParam); -+ -+err: -+ if (secParam != nullptr) -+ SECITEM_FreeItem(secParam, PR_TRUE); -+ -+ if (symKey != nullptr) -+ PK11_FreeSymKey(symKey); -+ -+ if (slot != nullptr) -+ PK11_FreeSlot(slot); -+ -+ return context; -+} -+ -+static void aesEncryptBlock(DecryptAESState *s, const unsigned char *in) { -+ SECStatus rv; -+ int outputLength; -+ -+ rv = PK11_CipherOp(s->context, -+ s->buf, -+ &outputLength, -+ 16, -+ in, -+ 16); -+ -+ if (rv != SECSuccess) { -+ error(errInternal, -1, "Failed to encrypt input block (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ s->bufIdx = 0; -+ -+err: -+ return; -+} -+ -+static void aesDecryptBlock(DecryptAESState *s, const unsigned char *in, bool last) { -+ SECStatus rv1; -+ int outputLen; -+ int n, i; -+ -+ rv1 = PK11_CipherOp(s->context, -+ s->buf, -+ &outputLen, -+ 16, -+ in, -+ 16); -+ -+ if (rv1 != SECSuccess) { -+ error(errInternal, -1, "Failed to decrypt input block (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ s->bufIdx = 0; -+ if (last) { -+ n = s->buf[15]; -+ if (n < 1 || n > 16) { // this should never happen -+ n = 16; -+ } -+ for (i = 15; i >= n; --i) { -+ s->buf[i] = s->buf[i-n]; -+ } -+ s->bufIdx = n; -+ } -+ -+err: -+ return; -+} -+ -+static void aes256EncryptBlock(DecryptAES256State *s, const unsigned char *in) { -+ SECStatus rv; -+ int outputLength; -+ -+ rv = PK11_CipherOp(s->context, -+ s->buf, -+ &outputLength, -+ 16, -+ in, -+ 16); -+ -+ if (rv != SECSuccess) { -+ error(errInternal, -1, "Failed to encrypt input block (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ s->bufIdx = 0; -+ -+err: -+ return; -+} -+ -+static void aes256DecryptBlock(DecryptAES256State *s, const unsigned char *in, -+ bool last) { -+ SECStatus rv1; -+ int outputLen; -+ int n, i; -+ -+ rv1 = PK11_CipherOp(s->context, -+ s->buf, -+ &outputLen, -+ 16, -+ in, -+ 16); -+ -+ if (rv1 != SECSuccess) { -+ error(errInternal, -1, "Failed to decrypt input block (err {0:d})", -+ PR_GetError()); -+ goto err; -+ } -+ -+ s->bufIdx = 0; -+ if (last) { -+ n = s->buf[15]; -+ if (n < 1 || n > 16) { // this should never happen -+ n = 16; -+ } -+ for (i = 15; i >= n; --i) { -+ s->buf[i] = s->buf[i-n]; -+ } -+ s->bufIdx = n; -+ } -+ -+err: -+ return; -+} -+ -+#else -+ - static const unsigned char sbox[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, - 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, - 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, -@@ -1121,10 +1683,33 @@ static void aes256DecryptBlock(DecryptAE - } - } - -+#endif -+ - //------------------------------------------------------------------------ - // MD5 message digest - //------------------------------------------------------------------------ - -+#ifdef ENABLE_NSS3 -+static void hashFunc(const unsigned char *msg, int msgLen, unsigned char *hash, -+ HASH_HashType type) { -+ HASHContext *context; -+ unsigned int hashLen = 0; -+ -+ if (!initNSS()) -+ return; -+ -+ context = HASH_Create(type); -+ if (context == nullptr) -+ return; -+ -+ HASH_Begin(context); -+ HASH_Update(context, msg, msgLen); -+ HASH_End(context, hash, &hashLen, HASH_ResultLen(type)); -+ HASH_Destroy(context); -+} -+ -+#else -+ - // this works around a bug in older Sun compilers - static inline unsigned long rotateLeft(unsigned long x, int r) - { -@@ -1151,8 +1736,13 @@ static inline unsigned long md5Round4(unsigned long a, - state->digest[15] = (unsigned char)(state->d >> 24); - } - -+#endif -+ - void md5(const unsigned char *msg, int msgLen, unsigned char *digest) - { -+#ifdef ENABLE_NSS3 -+ hashFunc(msg, msgLen, digest, HASH_AlgMD5); -+#else - if (msgLen < 0) { - return; - } -@@ -1296,12 +1886,14 @@ void md5(unsigned char *msg, int msgLen, unsigned char - for (int i = 0; i < 16; ++i) { - digest[i] = state.digest[i]; - } -+#endif - } - - //------------------------------------------------------------------------ - // SHA-256 hash - //------------------------------------------------------------------------ - -+#ifndef ENABLE_NSS3 - static const unsigned int sha256K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, -@@ -1400,9 +1992,13 @@ static void sha256HashBlock(unsigned char *blk, - H[6] += g; - H[7] += h; - } -+#endif - - static void sha256(unsigned char *msg, int msgLen, unsigned char *hash) - { -+#ifdef ENABLE_NSS3 -+ hashFunc(msg, msgLen, hash, HASH_AlgSHA256); -+#else - unsigned char blk[64]; - unsigned int H[8]; - int blkLen, i; -@@ -1453,7 +2049,10 @@ static void sha256(unsigned char *msg, int msgL - hash[i * 4 + 2] = (unsigned char)(H[i] >> 8); - hash[i * 4 + 3] = (unsigned char)H[i]; - } -+#endif - } -+ -+#ifndef ENABLE_NSS3 - //------------------------------------------------------------------------ - // SHA-512 hash (see FIPS 180-4) - //------------------------------------------------------------------------ -@@ -1557,9 +2156,13 @@ static void sha512HashBlock(unsigned char *blk, - H[6] += g; - H[7] += h; - } -+#endif - - static void sha512(unsigned char *msg, int msgLen, unsigned char *hash) - { -+#ifdef ENABLE_NSS3 -+ hashFunc(msg, msgLen, hash, HASH_AlgSHA512); -+#else - unsigned char blk[128]; - uint64_t H[8]; - int blkLen = 0, i; -@@ -1622,6 +2225,7 @@ static void sha512(unsigned char *msg, int msgL - hash[i * 8 + 6] = (unsigned char)(H[i] >> 8); - hash[i * 8 + 7] = (unsigned char)H[i]; - } -+#endif - } - - //------------------------------------------------------------------------ -@@ -1631,6 +2235,9 @@ static void sha512(unsigned char *msg, int msgL - // 2.A 384 bit message digest is obtained by truncating the final hash value. - static void sha384(unsigned char *msg, int msgLen, unsigned char *hash) - { -+#ifdef ENABLE_NSS3 -+ hashFunc(msg, msgLen, hash, HASH_AlgSHA384); -+#else - unsigned char blk[128]; - uint64_t H[8]; - int blkLen, i; -@@ -1696,6 +2303,7 @@ static void sha384(unsigned char *msg, int msgL - hash[i * 8 + 6] = (unsigned char)(H[i] >> 8); - hash[i * 8 + 7] = (unsigned char)H[i]; - } -+#endif - } - - //------------------------------------------------------------------------ -@@ -1735,7 +2344,11 @@ static void revision6Hash(GooString *inp - memcpy(state.buf, state.cbc, 16); // Copy CBC IV to buf - state.bufIdx = 0; - state.paddingReached = false; -+#ifdef ENABLE_NSS3 -+ state.context = aesInitContext(state.cbc, aesKey, 16, false); -+#else - aesKeyExpansion(&state, aesKey, 16, false); -+#endif - - for (int i = 0; i < (4 * sequenceLength); i++) { - aesEncryptBlock(&state, K1 + (16 * i)); -@@ -1776,6 +2389,9 @@ static void revision6Hash(GooString *inp - sha512(E, totalLength, K); - } - rounds++; -+#ifdef ENABLE_NSS3 -+ PK11_DestroyContext(state.context, PR_TRUE); -+#endif - } - // the first 32 bytes of the final K are the output of the function. - } -diff --git a/poppler/Decrypt.h b/poppler/Decrypt.h -index d4667c8c..16fa9830 100644 ---- a/poppler/Decrypt.h -+++ b/poppler/Decrypt.h -@@ -31,6 +32,9 @@ - #include "goo/GooString.h" - #include "Object.h" - #include "Stream.h" -+#ifdef ENABLE_NSS3 -+#include -+#endif - - //------------------------------------------------------------------------ - // Decrypt -@@ -73,14 +77,22 @@ private: - * case of encryption. */ - struct DecryptRC4State - { -+#ifdef ENABLE_NSS3 -+ PK11Context *context; -+#else - unsigned char state[256]; - unsigned char x, y; -+#endif - }; - - struct DecryptAESState - { -+#ifdef ENABLE_NSS3 -+ PK11Context *context; -+#else - unsigned int w[44]; - unsigned char state[16]; -+#endif - unsigned char cbc[16]; - unsigned char buf[16]; - bool paddingReached; // encryption only -@@ -87,8 +99,12 @@ struct DecryptAESState { - - struct DecryptAES256State - { -+#ifdef ENABLE_NSS3 -+ PK11Context *context; -+#else - unsigned int w[60]; - unsigned char state[16]; -+#endif - unsigned char cbc[16]; - unsigned char buf[16]; - bool paddingReached; // encryption only -diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake -index f0a5a1a0..dcaade6f 100644 ---- a/poppler/poppler-config.h.cmake -+++ b/poppler/poppler-config.h.cmake -@@ -115,6 +115,12 @@ - #cmakedefine USE_BOOST_HEADERS 1 - #endif - -+/* Build against libnss3 for digital signature validation and -+ implementation of encryption/decryption. */ -+#ifndef ENABLE_NSS3 -+#cmakedefine ENABLE_NSS3 1 -+#endif -+ - //------------------------------------------------------------------------ - // version - //------------------------------------------------------------------------ diff --git a/SOURCES/poppler-20.11.0-XRef-check-isDict.patch b/SOURCES/poppler-20.11.0-XRef-check-isDict.patch deleted file mode 100644 index 0f0cca5..0000000 --- a/SOURCES/poppler-20.11.0-XRef-check-isDict.patch +++ /dev/null @@ -1,21 +0,0 @@ -From dcd5bd8238ea448addd102ff045badd0aca1b990 Mon Sep 17 00:00:00 2001 -From: crt -Date: Wed, 27 Jul 2022 08:40:02 +0000 -Subject: pdfseparate: Check XRef's Catalog for being a Dict - - -diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc -index 351140af..c26a41c4 100644 ---- a/poppler/PDFDoc.cc -+++ b/poppler/PDFDoc.cc -@@ -886,6 +886,10 @@ int PDFDoc::savePageAs(const GooString &name, int pageNo) - - // get and mark output intents etc. - Object catObj = getXRef()->getCatalog(); -+ if (!catObj.isDict()) { -+ error(errSyntaxError, -1, "XRef's Catelog is not a dictionary"); -+ return errOpenFile; -+ } - Dict *catDict = catObj.getDict(); - Object pagesObj = catDict->lookup("Pages"); - Object afObj = catDict->lookupNF("AcroForm").copy(); diff --git a/SOURCES/poppler-20.11.0-bad-generation.patch b/SOURCES/poppler-20.11.0-bad-generation.patch deleted file mode 100644 index e4a0c1a..0000000 --- a/SOURCES/poppler-20.11.0-bad-generation.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4f478daa6a9734b8f269a6586bdce2909844bb6f Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Wed, 23 Dec 2020 23:52:58 +0100 -Subject: Fix opening files by some generators that are a bit broken - -But Adobe opens it and it's easy to fix - -diff --git a/poppler/XRef.cc b/poppler/XRef.cc -index 66d3f04a..c36c747a 100644 ---- a/poppler/XRef.cc -+++ b/poppler/XRef.cc -@@ -45,6 +45,7 @@ - #include - #include - #include -+#include - #include "goo/gfile.h" - #include "goo/gmem.h" - #include "Object.h" -@@ -793,8 +794,13 @@ bool XRef::readXRefStreamSection(Stream *xrefStr, const int *w, int first, int n - gen = (gen << 8) + c; - } - if (gen > INT_MAX) { -- error(errSyntaxError, -1, "Gen inside xref table too large (bigger than INT_MAX)"); -- return false; -+ if (i == 0 && gen == std::numeric_limits::max()) { -+ // workaround broken generators -+ gen = 65535; -+ } else { -+ error(errSyntaxError, -1, "Gen inside xref table too large (bigger than INT_MAX)"); -+ return false; -+ } - } - if (entries[i].offset == -1) { - switch (type) { diff --git a/SOURCES/poppler-20.11.0-check-gdatetime.patch b/SOURCES/poppler-20.11.0-check-gdatetime.patch deleted file mode 100644 index 2b9c457..0000000 --- a/SOURCES/poppler-20.11.0-check-gdatetime.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- poppler-20.11.0/glib/poppler-attachment.cc -+++ poppler-20.11.0/glib/poppler-attachment.cc -@@ -114,17 +114,21 @@ PopplerAttachment *_poppler_attachment_n - if (embFile->createDate()) { - priv->ctime = _poppler_convert_pdf_date_to_date_time(embFile->createDate()); - G_GNUC_BEGIN_IGNORE_DEPRECATIONS -- /* This will overflow on dates from after 2038. This field is -- * deprecated, only kept for backward compatibility. */ -- attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime); -+ if (priv->ctime != NULL) { -+ /* This will overflow on dates from after 2038. This field is -+ * deprecated, only kept for backward compatibility. */ -+ attachment->ctime = (GTime)g_date_time_to_unix(priv->ctime); -+ } - G_GNUC_END_IGNORE_DEPRECATIONS - } - if (embFile->modDate()) { - priv->mtime = _poppler_convert_pdf_date_to_date_time(embFile->modDate()); - G_GNUC_BEGIN_IGNORE_DEPRECATIONS -- /* This will overflow on dates from after 2038. This field is -- * deprecated, only kept for backward compatibility. */ -- attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime); -+ if (priv->mtime != NULL) { -+ /* This will overflow on dates from after 2038. This field is -+ * deprecated, only kept for backward compatibility. */ -+ attachment->mtime = (GTime)g_date_time_to_unix(priv->mtime); -+ } - G_GNUC_END_IGNORE_DEPRECATIONS - } - diff --git a/SOURCES/poppler-20.11.0-check-isDict.patch b/SOURCES/poppler-20.11.0-check-isDict.patch deleted file mode 100644 index 22c4090..0000000 --- a/SOURCES/poppler-20.11.0-check-isDict.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/poppler/PDFDoc.cc -+++ b/poppler/PDFDoc.cc -@@ -1757,6 +1757,9 @@ void PDFDoc::replacePageDict(int pageNo, - { - Ref *refPage = getCatalog()->getPageRef(pageNo); - Object page = getXRef()->fetch(*refPage); -+ if (!page.isDict()) { -+ return; -+ } - Dict *pageDict = page.getDict(); - pageDict->remove("MediaBoxssdf"); - pageDict->remove("MediaBox"); ---- a/utils/pdfunite.cc -+++ b/utils/pdfunite.cc -@@ -293,9 +293,18 @@ int main(int argc, char *argv[]) - const PDFRectangle *cropBox = nullptr; - if (docs[i]->getCatalog()->getPage(j)->isCropped()) - cropBox = docs[i]->getCatalog()->getPage(j)->getCropBox(); -- docs[i]->replacePageDict(j, docs[i]->getCatalog()->getPage(j)->getRotate(), docs[i]->getCatalog()->getPage(j)->getMediaBox(), cropBox); - Ref *refPage = docs[i]->getCatalog()->getPageRef(j); - Object page = docs[i]->getXRef()->fetch(*refPage); -+ if (!page.isDict()) { -+ fclose(f); -+ delete yRef; -+ delete countRef; -+ delete outStr; -+ error(errSyntaxError, -1, "PDFDoc::replacePageDict failed."); -+ return -1; -+ } else { -+ docs[i]->replacePageDict(j, docs[i]->getCatalog()->getPage(j)->getRotate(), docs[i]->getCatalog()->getPage(j)->getMediaBox(), cropBox); -+ } - Dict *pageDict = page.getDict(); - Object *resDict = docs[i]->getCatalog()->getPage(j)->getResourceDictObject(); - if (resDict->isDict()) { diff --git a/SOURCES/poppler-20.11.0-fix-crash-in-FoFiType1C.patch b/SOURCES/poppler-20.11.0-fix-crash-in-FoFiType1C.patch deleted file mode 100644 index 80f406c..0000000 --- a/SOURCES/poppler-20.11.0-fix-crash-in-FoFiType1C.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3cc28b66132e66ed2dfe13a9a285ac41ac7267d5 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Wed, 23 Dec 2020 23:27:02 +0100 -Subject: [PATCH] FoFiType1C: Fix crashes with broken files - ---- - fofi/FoFiType1C.cc | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc -index 0387b0a87..4c2e9a770 100644 ---- a/fofi/FoFiType1C.cc -+++ b/fofi/FoFiType1C.cc -@@ -194,7 +194,6 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bo - Type1CIndexVal val; - GooString *buf; - char buf2[256]; -- const char **enc; - bool ok; - int i; - -@@ -299,9 +298,9 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bo - } else { - (*outputFunc)(outputStream, "256 array\n", 10); - (*outputFunc)(outputStream, "0 1 255 {1 index exch /.notdef put} for\n", 40); -- enc = newEncoding ? newEncoding : (const char **)encoding; -+ const char **enc = newEncoding ? newEncoding : (const char **)encoding; - for (i = 0; i < 256; ++i) { -- if (enc[i]) { -+ if (enc && enc[i]) { - buf = GooString::format("dup {0:d} /{1:s} put\n", i, enc[i]); - (*outputFunc)(outputStream, buf->c_str(), buf->getLength()); - delete buf; -@@ -1945,7 +1944,7 @@ bool FoFiType1C::parse() - readPrivateDict(0, 0, &privateDicts[0]); - } else { - getIndex(topDict.fdArrayOffset, &fdIdx, &parsedOk); -- if (!parsedOk) { -+ if (!parsedOk || fdIdx.len <= 0) { - return false; - } - nFDs = fdIdx.len; --- -GitLab - diff --git a/SOURCES/poppler-20.11.0-hints.patch b/SOURCES/poppler-20.11.0-hints.patch deleted file mode 100644 index 85becf3..0000000 --- a/SOURCES/poppler-20.11.0-hints.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 81044c64b9ed9a10ae82a28bac753060bdfdac74 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Tue, 15 Mar 2022 15:14:32 +0100 -Subject: Hints::readTables: bail out if we run out of file when reading - -Fixes #1230 - -diff --git a/poppler/Hints.cc b/poppler/Hints.cc -index 79f04088..4707e1c6 100644 ---- a/poppler/Hints.cc -+++ b/poppler/Hints.cc -@@ -5,7 +5,7 @@ - // This file is licensed under the GPLv2 or later - // - // Copyright 2010, 2012 Hib Eris --// Copyright 2010, 2011, 2013, 2014, 2016-2019 Albert Astals Cid -+// Copyright 2010, 2011, 2013, 2014, 2016-2019, 2021, 2022 Albert Astals Cid - // Copyright 2010, 2013 Pino Toscano - // Copyright 2013 Adrian Johnson - // Copyright 2014 Fabio D'Urso -@@ -189,21 +189,31 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref - char *p = &buf[0]; - - if (hintsOffset && hintsLength) { -- Stream *s = str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull)); -+ std::unique_ptr s(str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull))); - s->reset(); - for (unsigned int i = 0; i < hintsLength; i++) { -- *p++ = s->getChar(); -+ const int c = s->getChar(); -+ if (unlikely(c == EOF)) { -+ error(errSyntaxWarning, -1, "Found EOF while reading hints"); -+ ok = false; -+ return; -+ } -+ *p++ = c; - } -- delete s; - } - - if (hintsOffset2 && hintsLength2) { -- Stream *s = str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull)); -+ std::unique_ptr s(str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull))); - s->reset(); - for (unsigned int i = 0; i < hintsLength2; i++) { -- *p++ = s->getChar(); -+ const int c = s->getChar(); -+ if (unlikely(c == EOF)) { -+ error(errSyntaxWarning, -1, "Found EOF while reading hints2"); -+ ok = false; -+ return; -+ } -+ *p++ = c; - } -- delete s; - } - - MemStream *memStream = new MemStream(&buf[0], 0, bufLength, Object(objNull)); diff --git a/SOURCES/poppler-20.11.0-jbig-symbol-overflow.patch b/SOURCES/poppler-20.11.0-jbig-symbol-overflow.patch deleted file mode 100644 index 9a7cc0c..0000000 --- a/SOURCES/poppler-20.11.0-jbig-symbol-overflow.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 27354e9d9696ee2bc063910a6c9a6b27c5184a52 Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Thu, 25 Aug 2022 00:14:22 +0200 -Subject: JBIG2Stream: Fix crash on broken file - -https://github.com/jeffssh/CVE-2021-30860 - -Thanks to David Warren for the heads up - -diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc -index 662276e5..9f70431d 100644 ---- a/poppler/JBIG2Stream.cc -+++ b/poppler/JBIG2Stream.cc -@@ -1976,7 +1976,11 @@ void JBIG2Stream::readTextRegionSeg(unsigned int segNum, bool imm, bool lossless - for (i = 0; i < nRefSegs; ++i) { - if ((seg = findSegment(refSegs[i]))) { - if (seg->getType() == jbig2SegSymbolDict) { -- numSyms += ((JBIG2SymbolDict *)seg)->getSize(); -+ const unsigned int segSize = ((JBIG2SymbolDict *)seg)->getSize(); -+ if (unlikely(checkedAdd(numSyms, segSize, &numSyms))) { -+ error(errSyntaxError, getPos(), "Too many symbols in JBIG2 text region"); -+ return; -+ } - } else if (seg->getType() == jbig2SegCodeTable) { - codeTables->push_back(seg); - } diff --git a/SOURCES/poppler-20.11.0-pdfunite-broken-document.patch b/SOURCES/poppler-20.11.0-pdfunite-broken-document.patch deleted file mode 100644 index 11e4004..0000000 --- a/SOURCES/poppler-20.11.0-pdfunite-broken-document.patch +++ /dev/null @@ -1,48 +0,0 @@ -From efb68686784f0c58668b7ced990fd173e09346db Mon Sep 17 00:00:00 2001 -From: Albert Astals Cid -Date: Thu, 18 Aug 2022 23:41:24 +0200 -Subject: pdfunite: Don't crash in broken documents - - -diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc -index 86e75555..a154f40d 100644 ---- a/utils/pdfunite.cc -+++ b/utils/pdfunite.cc -@@ -106,16 +106,21 @@ static void doMergeNameDict(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldR - } - } - --static void doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset) -+static bool doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset) - { - Object srcFields = srcFormDict->lookup("Fields"); - Object mergeFields = mergeFormDict->lookup("Fields"); - if (srcFields.isArray() && mergeFields.isArray()) { - for (int i = 0; i < mergeFields.arrayGetLength(); i++) { - const Object &value = mergeFields.arrayGetNF(i); -+ if (!value.isRef()) { -+ error(errSyntaxError, -1, "Fields object is not a Ref."); -+ return false; -+ } - srcFields.arrayAdd(Object({ value.getRef().num + numOffset, value.getRef().gen })); - } - } -+ return true; - } - - /////////////////////////////////////////////////////////////////////////// -@@ -332,7 +337,13 @@ int main(int argc, char *argv[]) - if (afObj.isNull()) { - afObj = pageCatDict->lookupNF("AcroForm").copy(); - } else if (afObj.isDict()) { -- doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset); -+ if (!doMergeFormDict(afObj.getDict(), pageForm.getDict(), numOffset)) { -+ fclose(f); -+ delete yRef; -+ delete countRef; -+ delete outStr; -+ return -1; -+ } - } - } - objectsCount += docs[i]->writePageObjects(outStr, yRef, numOffset, true); diff --git a/SOURCES/poppler-20.11.0-pdfunite-check-isDict.patch b/SOURCES/poppler-20.11.0-pdfunite-check-isDict.patch deleted file mode 100644 index 2ffdf72..0000000 --- a/SOURCES/poppler-20.11.0-pdfunite-check-isDict.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 4631115647c1e4f0482ffe0491c2f38d2231337b Mon Sep 17 00:00:00 2001 -From: crt -Date: Fri, 29 Jul 2022 20:51:11 +0000 -Subject: Check isDict before calling getDict - -Issue #1276 - -diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc -index b96b0378..050927d3 100644 ---- a/utils/pdfunite.cc -+++ b/utils/pdfunite.cc -@@ -197,6 +197,14 @@ int main(int argc, char *argv[]) - Object ocObj; - if (docs.size() >= 1) { - Object catObj = docs[0]->getXRef()->getCatalog(); -+ if(!catObj.isDict()){ -+ fclose(f); -+ delete yRef; -+ delete countRef; -+ delete outStr; -+ error(errSyntaxError, -1, "XRef's Catalog is not a dictionary."); -+ return -1; -+ } - Dict *catDict = catObj.getDict(); - intents = catDict->lookup("OutputIntents"); - afObj = catDict->lookupNF("AcroForm").copy(); -@@ -295,6 +303,14 @@ int main(int argc, char *argv[]) - } - } - Object pageCatObj = docs[i]->getXRef()->getCatalog(); -+ if(!pageCatObj.isDict()){ -+ fclose(f); -+ delete yRef; -+ delete countRef; -+ delete outStr; -+ error(errSyntaxError, -1, "XRef's Catalog is not a dictionary."); -+ return -1; -+ } - Dict *pageCatDict = pageCatObj.getDict(); - Object pageNames = pageCatDict->lookup("Names"); - if (!pageNames.isNull() && pageNames.isDict()) { diff --git a/poppler-0.90.0-position-independent-code.patch b/poppler-0.90.0-position-independent-code.patch new file mode 100644 index 0000000..12c879e --- /dev/null +++ b/poppler-0.90.0-position-independent-code.patch @@ -0,0 +1,12 @@ +--- poppler-0.90.0/CMakeLists.txt ++++ poppler-0.90.0/CMakeLists.txt +@@ -17,6 +17,9 @@ else() + + include(MacroOptionalFindPackage) + find_package(PkgConfig) ++ ++set(CMAKE_POSITION_INDEPENDENT_CODE ON) ++ + include(TestBigEndian) + test_big_endian(WORDS_BIGENDIAN) + include(CheckFileOffsetBits) diff --git a/poppler-21.01.0-glib-introspection.patch b/poppler-21.01.0-glib-introspection.patch new file mode 100644 index 0000000..6b82738 --- /dev/null +++ b/poppler-21.01.0-glib-introspection.patch @@ -0,0 +1,11 @@ +--- poppler-21.01.0/glib/CMakeLists.txt ++++ poppler-21.01.0/glib/CMakeLists.txt +@@ -121,7 +121,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_ + + # General gir: Reset object-list for introspection & load tool args + set(INTROSPECTION_GIRS) +- set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all") ++ set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all" "--sources-top-dirs=${CMAKE_SOURCE_DIR}" "--sources-top-dirs=${CMAKE_BINARY_DIR}") + set(INTROSPECTION_COMPILER_ARGS ${INTROSPECTION_COMPILER_ARGS} "--includedir=${CMAKE_CURRENT_SOURCE_DIR}") + + # Poppler: Assign package to gir & export keys diff --git a/SOURCES/poppler-0.66.0-covscan.patch b/poppler-24.02.0-covscan.patch similarity index 72% rename from SOURCES/poppler-0.66.0-covscan.patch rename to poppler-24.02.0-covscan.patch index 04e15e1..02d717e 100644 --- a/SOURCES/poppler-0.66.0-covscan.patch +++ b/poppler-24.02.0-covscan.patch @@ -1,44 +1,35 @@ ---- poppler/glib/poppler-document.cc -+++ poppler/glib/poppler-document.cc -@@ -3405,6 +3405,7 @@ PopplerFormField *poppler_document_get_f - unsigned fieldNum; - FormPageWidgets *widgets; - FormWidget *field; -+ PopplerFormField *formField; +--- poppler-21.01.0/glib/poppler-page.cc ++++ poppler-21.01.0/glib/poppler-page.cc +@@ -1530,15 +1530,18 @@ void poppler_page_add_annot(PopplerPage + * first remove cropbox of the prior page before adding cropbox of the new page later */ + quads = new_quads_from_offset_cropbox(crop_box, annot_markup->getQuadrilaterals(), FALSE); + annot_markup->setQuadrilaterals(quads); ++ delete quads; + } + if (page_is_rotated) { + /* Quadrilateral's coords need to be saved un-rotated (same as rect coords) */ + quads = _page_new_quads_unrotated(page->page, annot_markup->getQuadrilaterals()); + annot_markup->setQuadrilaterals(quads); ++ delete quads; + } + /* Add to annot's quadrilaterals the offset for the cropbox of the new page */ + quads = new_quads_from_offset_cropbox(page_crop_box, annot_markup->getQuadrilaterals(), TRUE); + annot_markup->setQuadrilaterals(quads); ++ delete quads; + } - FormWidget::decodeID(id, &pageNum, &fieldNum); - -@@ -3417,8 +3418,14 @@ PopplerFormField *poppler_document_get_f - return nullptr; - - field = widgets->getWidget(fieldNum); -- if (field) -- return _poppler_form_field_new(document, field); -+ if (field) { -+ formField = _poppler_form_field_new(document, field); -+ delete widgets; -+ -+ return formField; -+ } -+ -+ delete widgets; - - return nullptr; - } + page->page->addAnnot(annot->annot); --- poppler/poppler/CairoOutputDev.cc +++ poppler/poppler/CairoOutputDev.cc -@@ -2921,8 +2921,10 @@ void CairoOutputDev::setMimeData(GfxStat - +@@ -2921,6 +2921,7 @@ void CairoOutputDev::setMimeData(GfxStat // colorspace in stream dict may be different from colorspace in jpx // data -- if (strKind == strJPX && colorSpace) -+ if (strKind == strJPX && colorSpace) { + if (strKind == strJPX && colorSpace) { + delete colorSpace; return; -+ } + } // only embed mime data for gray, rgb, and cmyk colorspaces. - if (colorSpace) { --- poppler/poppler/TextOutputDev.cc +++ poppler/poppler/TextOutputDev.cc @@ -1619,7 +1619,6 @@ TextBlock::~TextBlock() @@ -126,15 +117,15 @@ --- poppler/poppler/XRef.cc +++ poppler/poppler/XRef.cc @@ -402,6 +402,7 @@ int XRef::reserve(int newSize) - - void *p = greallocn_checkoverflow(entries, realNewSize, sizeof(XRefEntry)); + void *p = grealloc(entries, newCapacity * sizeof(XRefEntry), + /* checkoverflow=*/true); if (p == nullptr) { + entries = nullptr; return 0; } @@ -835,7 +836,6 @@ bool XRef::constructXRef(bool *wasRecons - int offset = 0; + Goffset offset = 0; resize(0); // free entries properly - gfree(entries); @@ -163,16 +154,6 @@ void PdfInspector::set_file_name(const char *file_name) { GtkWidget *widget; ---- poppler/utils/HtmlOutputDev.cc -+++ poppler/utils/HtmlOutputDev.cc -@@ -1337,6 +1337,7 @@ void HtmlOutputDev::drawPngImage(GfxStat - // TODO can we calculate the resolution of the image? - if (!writer->init(f1, width, height, 72, 72)) { - error(errInternal, -1, "Can't init PNG for image '{0:t}'", fName); -+ delete fName; - delete writer; - fclose(f1); - return; --- poppler/utils/pdftotext.cc +++ poppler/utils/pdftotext.cc @@ -329,6 +329,7 @@ int main(int argc, char *argv[]) @@ -184,7 +165,7 @@ } } @@ -348,8 +349,9 @@ int main(int argc, char *argv[]) - printWordBBox(f, doc, textOut, firstPage, lastPage); + printWordBBox(f, doc.get(), &textOut, firstPage, lastPage); } } - if (f != stdout) { @@ -193,9 +174,9 @@ + f = nullptr; } } else { - textOut = new TextOutputDev(textFileName->c_str(), physLayout, fixedPitch, rawOrder, htmlMeta, discardDiag); + @@ -390,7 +392,7 @@ int main(int argc, char *argv[]) - fputs("\n", f); + } fputs("\n", f); fputs("\n", f); - if (f != stdout) { @@ -203,3 +184,14 @@ fclose(f); } } +@@ -533,7 +533,9 @@ void printWordBBox(FILE *f, PDFDoc *doc, + for (int i = 0; i < word_length; ++i) { + word = wordlist->get(i); + word->getBBox(&xMinA, &yMinA, &xMaxA, &yMaxA); +- const std::string myString = myXmlTokenReplace(word->getText()->c_str()); ++ GooString *wordText = word->getText(); ++ const std::string myString = myXmlTokenReplace(wordText->c_str()); ++ delete wordText; + fprintf(f, " %s\n", xMinA, yMinA, xMaxA, yMaxA, myString.c_str()); + } + fprintf(f, " \n"); diff --git a/SOURCES/poppler-20.11.0-pdfinfo-dests.patch b/poppler-24.02.0-pdfinfo-dests.patch similarity index 68% rename from SOURCES/poppler-20.11.0-pdfinfo-dests.patch rename to poppler-24.02.0-pdfinfo-dests.patch index 20889c1..34a314b 100644 --- a/SOURCES/poppler-20.11.0-pdfinfo-dests.patch +++ b/poppler-24.02.0-pdfinfo-dests.patch @@ -3,7 +3,6 @@ From: Albert Astals Cid Date: Fri, 7 Jun 2024 00:54:55 +0200 Subject: pdfinfo: Fix crash in broken documents when using -dests -Modified by Marek Kasik due to the backport. diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc index 5d37ef64..7d569749 100644 @@ -13,36 +12,36 @@ index 5d37ef64..7d569749 100644 // under GPL version 2 or later // // Copyright (C) 2006 Dom Lachowicz --// Copyright (C) 2007-2010, 2012, 2016-2020 Albert Astals Cid -+// Copyright (C) 2007-2010, 2012, 2016-2020, 2024 Albert Astals Cid +-// Copyright (C) 2007-2010, 2012, 2016-2022 Albert Astals Cid ++// Copyright (C) 2007-2010, 2012, 2016-2022, 2024 Albert Astals Cid // Copyright (C) 2010 Hib Eris // Copyright (C) 2011 Vittal Aithal - // Copyright (C) 2012, 2013, 2016-2018 Adrian Johnson -@@ -107,6 +107,23 @@ static const ArgDesc argDesc[] = { { "-f + // Copyright (C) 2012, 2013, 2016-2018, 2021 Adrian Johnson +@@ -113,16 +113,21 @@ static const ArgDesc argDesc[] = { { "-f", argInt, &firstPage, 0, "first page to { "-?", argFlag, &printHelp, 0, "print usage information" }, {} }; +-static void printTextString(const GooString *s, const UnicodeMap *uMap) +static void printStdTextString(const std::string &s, const UnicodeMap *uMap) + { + char buf[8]; +- std::vector u = TextStringToUCS4(s->toStr()); ++ const std::vector u = TextStringToUCS4(s); + for (const auto &c : u) { + int n = uMap->mapUnicode(c, buf, sizeof(buf)); + fwrite(buf, 1, n, stdout); + } + } + ++static void printTextString(const GooString *s, const UnicodeMap *uMap) +{ -+ char buf[8]; -+ Unicode *u; -+ int i, len; -+ GooString *s1 = new GooString(s); -+ -+ if (s1 != nullptr) { -+ len = TextStringToUCS4(s1, &u); -+ for (i = 0; i < len; i++) { -+ int n = uMap->mapUnicode(u[i], buf, sizeof(buf)); -+ fwrite(buf, 1, n, stdout); -+ } -+ delete s1; -+ } ++ printStdTextString(s->toStr(), uMap); +} + - static void printInfoString(Dict *infoDict, const char *key, const char *text, const UnicodeMap *uMap) + static void printUCS4String(const Unicode *u, int len, const UnicodeMap *uMap) { - const GooString *s1; -@@ -278,11 +295,6 @@ static void printStruct(const StructElem + char buf[8]; +@@ -294,11 +299,6 @@ static void printStruct(const StructElement *element, unsigned indent) } } @@ -54,7 +53,7 @@ index 5d37ef64..7d569749 100644 static void printLinkDest(const std::unique_ptr &dest) { GooString s; -@@ -353,29 +365,25 @@ static void printLinkDest(const std::uni +@@ -369,29 +369,25 @@ static void printLinkDest(const std::unique_ptr &dest) static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap) { @@ -90,18 +89,11 @@ index 5d37ef64..7d569749 100644 } } -@@ -389,16 +397,8 @@ static void printDestinations(PDFDoc *do +@@ -405,9 +401,8 @@ static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap) printf("%4d ", i); printLinkDest(it.second); printf(" \""); -- Unicode *u; -- char buf[8]; -- const int len = TextStringToUCS4(it.first, &u); -- for (int j = 0; j < len; j++) { -- const int n = uMap->mapUnicode(u[j], buf, sizeof(buf)); -- fwrite(buf, 1, n, stdout); -- } -- gfree(u); +- printTextString(it.first, uMap); + printStdTextString(it.first, uMap); printf("\"\n"); - delete it.first; diff --git a/SPECS/poppler.spec b/poppler.spec similarity index 72% rename from SPECS/poppler.spec rename to poppler.spec index 8977e88..6904ae8 100644 --- a/SPECS/poppler.spec +++ b/poppler.spec @@ -1,57 +1,41 @@ -%global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a -%global test_date 2009-05-13 +%global test_sha 03a4b9eb854a06a83c465e82de601796c458bbe9 +%global test_date 2021-01-11 + +%bcond qt 1 + +%if %{with qt} +# Enable qt5 support (or not) +# RHEL 10 drops support for Qt5, adds Qt6 +%if %{undefined rhel} || 0%{?rhel} < 10 +%global qt5 1 +%endif +%if %{undefined rhel} || 0%{?rhel} >= 10 +%global qt6 1 +%endif +%endif Summary: PDF rendering library Name: poppler -Version: 20.11.0 -Release: 12%{?dist} -License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT +Version: 24.02.0 +Release: 6%{?dist} +License: (GPL-2.0-only OR GPL-3.0-only) AND GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz # git archive --prefix test/ -Source1: %{name}-test-%{test_date}_%{test_sha}.tar.xz +Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz -# https://bugzilla.redhat.com/show_bug.cgi?id=1185007 -Patch0: poppler-0.30.0-rotated-words-selection.patch +Patch1: poppler-0.90.0-position-independent-code.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1602662 -# https://bugzilla.redhat.com/show_bug.cgi?id=1638712 -Patch4: poppler-0.66.0-covscan.patch +Patch3: poppler-21.01.0-glib-introspection.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1618766 -Patch21: poppler-0.66.0-nss.patch +# https://issues.redhat.com/browse/RHEL-44326 +Patch4: poppler-24.02.0-pdfinfo-dests.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1981108 -Patch22: poppler-20.11.0-check-gdatetime.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2002575 -Patch23: poppler-20.11.0-bad-generation.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2087190 -Patch24: poppler-20.11.0-hints.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2124527 -Patch25: poppler-20.11.0-jbig-symbol-overflow.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2189815 -Patch26: poppler-20.11.0-pdfunite-broken-document.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2189811 -Patch27: poppler-20.11.0-pdfunite-check-isDict.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2189814 -Patch28: poppler-20.11.0-check-isDict.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=2189810 -Patch29: poppler-20.11.0-XRef-check-isDict.patch - -# https://issues.redhat.com/browse/RHEL-4255 -Patch30: poppler-20.11.0-fix-crash-in-FoFiType1C.patch - -# https://issues.redhat.com/browse/RHEL-44330 -Patch31: poppler-20.11.0-pdfinfo-dests.patch +Patch5: poppler-24.02.0-covscan.patch +BuildRequires: make BuildRequires: cmake +BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(cairo-ft) @@ -63,7 +47,7 @@ BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gobject-2.0) -BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk-doc) BuildRequires: pkgconfig(lcms2) @@ -73,12 +57,23 @@ BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libtiff-4) BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(poppler-data) +BuildRequires: pkgconfig(libcurl) +BuildRequires: cmake(Gpgmepp) +%if 0%{?qt5} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Xml) -BuildRequires: python3-devel +%endif +%if 0%{?qt6} +BuildRequires: cmake(Qt6Core) +BuildRequires: cmake(Qt6Gui) +BuildRequires: cmake(Qt6Test) +BuildRequires: cmake(Qt6Widgets) +BuildRequires: cmake(Qt6Xml) +%endif +BuildRequires: boost-devel Requires: poppler-data @@ -118,9 +113,11 @@ BuildArch: noarch %description glib-doc %{summary}. +%if 0%{?qt5} %package qt5 Summary: Qt5 wrapper for poppler Requires: %{name}%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-qt < 0.90.0-9 %description qt5 %{summary}. @@ -129,8 +126,26 @@ Summary: Development files for Qt5 wrapper Requires: %{name}-qt5%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: qt5-qtbase-devel +Obsoletes: %{name}-qt-devel < 0.90.0-9 %description qt5-devel %{summary}. +%endif + +%if 0%{?qt6} +%package qt6 +Summary: Qt6 wrapper for poppler +Requires: %{name}%{?_isa} = %{version}-%{release} +%description qt6 +%{summary}. + +%package qt6-devel +Summary: Development files for Qt6 wrapper +Requires: %{name}-qt6%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: qt6-qtbase-devel +%description qt6-devel +%{summary}. +%endif %package cpp Summary: Pure C++ wrapper for poppler @@ -156,61 +171,65 @@ other formats. %prep %autosetup -p1 -b 1 + chmod -x poppler/CairoFontEngine.cc %build -mkdir build -cd build -export CC="gcc -fPIC" # hack to make the cmake call pass %cmake \ -DENABLE_CMS=lcms2 \ -DENABLE_DCTDECODER=libjpeg \ -DENABLE_GTK_DOC=ON \ -DENABLE_LIBOPENJPEG=openjpeg2 \ - -DENABLE_ZLIB=OFF \ - -DENABLE_NSS=ON \ - -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ +%if ! 0%{?qt5} + -DENABLE_QT5=OFF \ +%endif +%if ! 0%{?qt6} -DENABLE_QT6=OFF \ +%endif + -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \ + -DENABLE_ZLIB=OFF \ .. -unset CC -make %{?_smp_mflags} +%cmake_build %install -cd build -make install DESTDIR=$RPM_BUILD_ROOT +%cmake_install %check -make %{?_smp_mflags} test +%make_build test # verify pkg-config sanity/version export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig test "$(pkg-config --modversion poppler)" = "%{version}" -test "$(pkg-config --modversion poppler-cairo)" = "%{version}" test "$(pkg-config --modversion poppler-cpp)" = "%{version}" test "$(pkg-config --modversion poppler-glib)" = "%{version}" +%if 0%{?qt5} test "$(pkg-config --modversion poppler-qt5)" = "%{version}" -test "$(pkg-config --modversion poppler-splash)" = "%{version}" +%endif +%if 0%{?qt6} +test "$(pkg-config --modversion poppler-qt6)" = "%{version}" +%endif -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%ldconfig_scriptlets -%post glib -p /sbin/ldconfig -%postun glib -p /sbin/ldconfig +%ldconfig_scriptlets glib -%post qt5 -p /sbin/ldconfig -%postun qt5 -p /sbin/ldconfig +%if 0%{?qt5} +%ldconfig_scriptlets qt5 +%endif -%post cpp -p /sbin/ldconfig -%postun cpp -p /sbin/ldconfig +%if 0%{?qt6} +%ldconfig_scriptlets qt6 +%endif + +%ldconfig_scriptlets cpp %files %doc README.md %license COPYING -%{_libdir}/libpoppler.so.104* +%{_libdir}/libpoppler.so.134* %files devel %{_libdir}/pkgconfig/poppler.pc -%{_libdir}/pkgconfig/poppler-splash.pc %{_libdir}/libpoppler.so %dir %{_includedir}/poppler/ # xpdf headers @@ -225,7 +244,6 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %files glib-devel %{_libdir}/pkgconfig/poppler-glib.pc -%{_libdir}/pkgconfig/poppler-cairo.pc %{_libdir}/libpoppler-glib.so %{_datadir}/gir-1.0/Poppler-0.18.gir %{_includedir}/poppler/glib/ @@ -234,6 +252,7 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %license COPYING %{_datadir}/gtk-doc/ +%if 0%{?qt5} %files qt5 %{_libdir}/libpoppler-qt5.so.1* @@ -241,6 +260,17 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_libdir}/libpoppler-qt5.so %{_libdir}/pkgconfig/poppler-qt5.pc %{_includedir}/poppler/qt5/ +%endif + +%if 0%{?qt6} +%files qt6 +%{_libdir}/libpoppler-qt6.so.3* + +%files qt6-devel +%{_libdir}/libpoppler-qt6.so +%{_libdir}/pkgconfig/poppler-qt6.pc +%{_includedir}/poppler/qt6/ +%endif %files cpp %{_libdir}/libpoppler-cpp.so.0* @@ -255,182 +285,307 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog -* Fri Jul 26 2024 Marek Kasik - 20.11.0-12 +* Fri Jan 10 2025 Marek Kasik - 24.02.0-6 +- Backport fix for issues found by Coverity +- Resolves: RHEL-71952 + +* Tue Oct 29 2024 Troy Dawson - 24.02.0-5 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Fri Jul 26 2024 Marek Kasik - 24.02.0-4 - Fix crash in broken documents when using -dests -- Fix versions in changelog -- Resolves: RHEL-44330 +- Resolves: RHEL-44326 -* Thu Oct 12 2023 Marek Kasik - 20.11.0-11 -- Fix crashes in FoFiType1C -- Rebuild for inclusion of poppler-glib-doc in CRB -- Resolves: RHEL-4255, RHEL-4273 +* Mon Jun 24 2024 Troy Dawson - 24.02.0-3 +- Bump release for June 2024 mass rebuild -* Fri Jun 9 2023 Marek Kasik - 20.11.0-10 -- Check XRef's Catalog for being a Dict -- Resolves: #2189816 +* Tue Feb 6 2024 Marek Kasik - 24.02.0-2 +- Migrated to SPDX license -* Fri Jun 9 2023 Marek Kasik - 20.11.0-9 -- Check isDict before calling getDict 2 -- Resolves: #2189837 +* Fri Feb 2 2024 Marek Kasik - 24.02.0-1 +- Update to 24.02.0 +- Resolves: #2237549 -* Fri Jun 9 2023 Marek Kasik - 20.11.0-8 -- Check isDict before calling getDict -- Resolves: #2189823 +* Fri Feb 2 2024 Marie Loise Nolden - 24.01.0-1 +- update to 24.01.9 -* Fri Jun 9 2023 Marek Kasik - 20.11.0-7 -- Don't crash in broken documents -- Resolves: #2189844 +* Thu Jan 25 2024 Fedora Release Engineering - 23.08.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Tue Sep 20 2022 Marek Kasik - 20.11.0-6 +* Sun Jan 21 2024 Fedora Release Engineering - 23.08.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Aug 2 2023 Marek Kasik - 23.08.0-1 +- Update to 23.08.0 + +* Fri Jul 21 2023 Fedora Release Engineering - 23.02.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Mon Jun 19 2023 Yaakov Selkowitz - 23.02.0-2 +- Disable qt5 in RHEL 10 builds +- Enable qt6 on s390x + +* Fri Feb 3 2023 Marek Kasik - 23.02.0-1 +- Update to 23.02.0 +- Resolves: #2123190 + +* Fri Jan 20 2023 Fedora Release Engineering - 22.08.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Nov 29 2022 Marek Kasik - 22.08.0-4 +- Update font after restore in Cairo +- Provide Unicode marker when ensuring fonts + +* Wed Oct 05 2022 Marek Kasik - 22.08.0-3 - Check for overflow when computing number of symbols - in JBIG2 text region -- Resolves: #2126361 +- Resolves: #2124530 -* Fri Jun 17 2022 Marek Kasik - 20.11.0-5 +* Tue Sep 6 2022 Amit Shah - 22.08.0-2 +- Allow building without Qt + +* Tue Aug 2 2022 Marek Kasik - 22.08.0-1 +- Update to 22.08.0 +- Resolves: #2049336 + +* Fri Jul 22 2022 Fedora Release Engineering - 22.01.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jun 15 2022 Marek Kasik - 22.01.0-5 - Don't run out of file for Hints -- Rebuild for #2096452 -- Resolves: #2090969, #2096452 +- Resolves: #2090965 -* Thu Sep 9 2021 Marek Kasik - 20.11.0-4 -- Fix opening files with streams with wrong generations -- Resolves: #2002575 +* Fri May 20 2022 Sandro Mani - 22.01.0-4 +- Rebuild for gdal-3.5.0 and/or openjpeg-2.5.0 -* Wed Aug 4 2021 Marek Kasik - 20.11.0-3 -- Fix crash when processing dates of embedded files -- Resolves: #1981108 +* Fri Jan 21 2022 Fedora Release Engineering - 22.01.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild -* Tue Dec 8 2020 Marek Kasik - 20.11.0-2 -- Improve python3 build dependency -- Resolves: #1896335 +* Fri Jan 14 2022 Sandro Mani - 22.01.0-2 +- Enable qt6 -* Fri Nov 6 2020 Marek Kasik - 20.11.0-1 -- Rebase poppler to 20.11.0 -- Modify/remove patches as needed -- Resolves: #1644423 +* Thu Jan 13 2022 Marek Kasik - 22.01.0-1 +- Update to 22.01.0 +- Resolves: #2000346 -* Thu Apr 16 2020 Marek Kasik - 0.66.0-27 -- Fix crash on broken file in tilingPatternFill() -- Resolves: #1801341 +* Mon Aug 2 2021 Marek Kasik - 21.08.0-1 +- Update to 21.08.0 +- Resolves: #1923798, #1988844 -* Tue Aug 13 2019 Marek Kasik - 0.66.0-26 -- Coverity scan related fixes -- Related: #1618766 +* Mon Jul 26 2021 Marek Kasik - 21.07.0-2 +- Disable qt6 frontend as it doesn't build on s390x +- Resolves: #1923798 -* Tue Aug 13 2019 Marek Kasik - 0.66.0-25 -- Check whether input is RGB in PSOutputDev::checkPageSlice() -- also when using "-optimizecolorspace" flag -- Resolves: #1697576 +* Mon Jul 26 2021 Marek Kasik - 21.07.0-1 +- Update to 21.07.0 +- Add requirement of boost for performance gain in splash +- Add qt6 subpackages +- Resolves: #1923798 -* Fri Aug 9 2019 Marek Kasik - 0.66.0-24 -- Check whether input is RGB in PSOutputDev::checkPageSlice() -- Resolves: #1697576 +* Fri Jul 23 2021 Fedora Release Engineering - 21.01.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild -* Fri Aug 9 2019 Marek Kasik - 0.66.0-23 +* Tue Jun 1 2021 Marek Kasik - 21.01.0-7 +- Fix showing of non-ASCII characters in annotations +- Resolves: #1958673 + +* Tue Mar 30 2021 Jonathan Wakely - 21.01.0-6 +- Rebuilt for removed libstdc++ symbol (#1937698) + +* Tue Feb 9 2021 Marek Kasik - 21.01.0-5 +- Obsolete Qt4 frontend +- Resolves: #1926010 + +* Wed Jan 27 2021 Fedora Release Engineering - 21.01.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jan 15 2021 Marek Kasik - 21.01.0-3 +- Improve the previous fix +- Resolves: #1915776 + +* Wed Jan 13 2021 Marek Kasik - 21.01.0-2 +- Fix multilib property of poppler-glib +- by using the same build directory for all architectures +- Resolves: #1915776 + +* Mon Jan 11 2021 Marek Kasik - 21.01.0-1 +- Update to 21.01.0 +- Remove the Qt4 frontend +- Resolves: #1673727 + +* Mon Dec 07 2020 Marek Kasik - 0.90.0-8 +- Build Qt4 frontend on Fedora only + +* Sat Oct 31 2020 Jeff Law - 0.90.0-7 +- Fix bogus volatiles caught by gcc-11 + +* Tue Aug 04 2020 Marek Kasik - 0.90.0-6 +- Align poppler with +- https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds +- Resolves: #1865248 + +* Sat Aug 01 2020 Fedora Release Engineering - 0.90.0-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 0.90.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 10 2020 Marek Kasik - 0.90.0-3 +- Fix some other issues. +- Resolves: #1673727 + +* Fri Jul 10 2020 Marek Kasik - 0.90.0-2 +- Compile poppler with position independent code turned on. +- Otherwise it doesn't build on Fedora 33. +- Resolves: #1673727 + +* Wed Jul 08 2020 Marek Kasik - 0.90.0-1 +- Update to 0.90.0 +- Resolves: #1673727 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.84.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jan 17 2020 Marek Kasik - 0.84.0-1 +- Update to 0.84.0 +- Resolves: #1673727 + +* Fri Dec 20 2019 Marek Kasik - 0.73.0-15 +- Check scaled dimensions for 0 +- Resolves: #1785416 + +* Wed Jul 24 2019 Marek Kasik - 0.73.0-14 - Ignore dict Length if it is broken -- Resolves: #1733027 +- Resolves: #1732342 -* Fri Aug 9 2019 Marek Kasik - 0.66.0-22 +* Thu May 30 2019 Marek Kasik - 0.73.0-13 +- Don't read outside of image buffer in PSOutputDev +- Resolves: #1696640 + +* Thu May 30 2019 Marek Kasik - 0.73.0-12 +- SplashXPathScanner::clipAALine: Fix crash on broken file +- Resolves: #1696640 + +* Thu May 30 2019 Marek Kasik - 0.73.0-11 +- Restrict filling of overlapping boxes in Splash +- Resolves: #1696640 + +* Wed May 29 2019 Marek Kasik - 0.73.0-10 - Fail gracefully if not all components of JPEG2000Stream - have the same size -- Resolves: #1723505 +- Resolves: #1713585 -* Fri Jun 28 2019 Marek Kasik - 0.66.0-21 -- Implement crypto functions using NSS -- Resolves: #1618766 +* Wed Apr 17 2019 Marek Kasik - 0.73.0-9 +- Fix infinite loop in broken files +- Resolves: #1699863 -* Wed Apr 3 2019 Marek Kasik - 0.66.0-20 -- Fix stack overflow on broken file -- Resolves: #1691887 - -* Mon Apr 1 2019 Marek Kasik - 0.66.0-19 +* Mon Apr 1 2019 Marek Kasik - 0.73.0-8 - Constrain number of cycles in rescale filter - Compute correct coverage values for box filter -- Resolves: #1688418 +- Resolves: #1686803 -* Mon Apr 1 2019 Marek Kasik - 0.66.0-18 +* Mon Apr 1 2019 Marek Kasik - 0.73.0-7 +- Fix stack overflow on broken file +- Resolves: #1691725 + +* Mon Mar 11 2019 Marek Kasik - 0.73.0-6 - Fix possible crash on broken files in ImageStream::getLine() -- Resolves: #1685268 +- Resolves: #1683633 -* Mon Apr 1 2019 Marek Kasik - 0.66.0-17 +* Fri Mar 8 2019 Marek Kasik - 0.73.0-5 +- Synchronize previous patch with upstream +- Related: #1665274 + +* Wed Feb 20 2019 Marek Kasik - 0.73.0-4 - Check Catalog from XRef for being a Dict -- Resolves: #1677347 +- Resolves: #1665274 -* Mon Apr 1 2019 Marek Kasik - 0.66.0-16 -- Move the fileSpec.dictLookup call inside fileSpec.isDict if -- Resolves: #1677028 - -* Mon Apr 1 2019 Marek Kasik - 0.66.0-15 -- Do not try to construct invalid rich media annotation assets -- Resolves: #1677025 - -* Mon Apr 1 2019 Marek Kasik - 0.66.0-14 +* Wed Feb 20 2019 Marek Kasik - 0.73.0-3 - Defend against requests for negative XRef indices -- Resolves: #1673699 +- Resolves: #1672420 -* Mon Apr 1 2019 Marek Kasik - 0.66.0-13 -- Do not try to parse into unallocated XRef entry -- Resolves: #1677057 +* Sat Feb 02 2019 Fedora Release Engineering - 0.73.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Mon Apr 1 2019 Marek Kasik - 0.66.0-12 +* Fri Jan 25 2019 Marek Kasik - 0.73.0-1 +- Update to 0.73.0 + +* Tue Jan 22 2019 Marek Kasik - 0.67.0-10 - Avoid global display profile state becoming an uncontrolled - memory leak -- Resolves: #1646552 +- Resolves: #1646549 -* Fri Dec 14 2018 Marek Kasik - 0.66.0-11 -- Fix tiling patterns when pattern cell is too far -- Resolves: #1644094 +* Mon Jan 21 2019 Marek Kasik - 0.67.0-9 +- Do not try to parse into unallocated XRef entry +- Resolves: #1665268 -* Fri Nov 16 2018 Marek Kasik - 0.66.0-10 +* Mon Jan 21 2019 Marek Kasik - 0.67.0-8 +- Move the fileSpec.dictLookup call inside fileSpec.isDict if +- Resolves: #1665264 + +* Mon Jan 21 2019 Marek Kasik - 0.67.0-7 +- Do not try to construct invalid rich media annotation assets +- Resolves: #1665260 + +* Thu Nov 15 2018 Marek Kasik - 0.67.0-6 - Check for valid file name of embedded file -- Resolves: #1649453 +- Resolves: #1649451 -* Fri Nov 16 2018 Marek Kasik - 0.66.0-9 +* Thu Nov 15 2018 Marek Kasik - 0.67.0-5 - Check for valid embedded file before trying to save it -- Resolves: #1649443 +- Resolves: #1649441 -* Fri Nov 16 2018 Marek Kasik - 0.66.0-8 +* Thu Nov 15 2018 Marek Kasik - 0.67.0-4 - Check for stream before calling stream methods - when saving an embedded file -- Resolves: #1649438 +- Resolves: #1649436 -* Thu Nov 15 2018 Marek Kasik - 0.66.0-7 -- Fix crash on missing embedded file -- Resolves: #1649460 - -* Thu Nov 15 2018 Marek Kasik - 0.66.0-6 +* Mon Nov 12 2018 Marek Kasik - 0.67.0-3 - Avoid cycles in PDF parsing -- Resolves: #1626623 +- Resolves: #1626620 -* Fri Oct 12 2018 Marek Kasik - 0.66.0-5 -- Fix crash when accessing list of selections -- Resolves: #1638712 +* Wed Oct 17 2018 Marek Kasik - 0.67.0-2 +- Fix crash on missing embedded file +- Resolves: #1569334 -* Mon Sep 24 2018 Marek Kasik - 0.66.0-4 -- Fix important issues found by covscan -- Resolves: #1602662 +* Tue Aug 14 2018 Marek Kasik - 0.67.0-1 +- Update to 0.67.0 +- Resolves: #1568641 -* Tue Aug 14 2018 Petr Viktorin - 0.66.0-3 -- Fix BuildRequires for /usr/bin/python3 -- Resolves: #1615561 +* Tue Aug 7 2018 Marek Kasik - 0.63.0-8 +- Fix tiling patterns when pattern cell is too far +- Resolves: #1557355 -* Thu Jul 26 2018 Marek Kasik - 0.66.0-2 +* Tue Jul 31 2018 Florian Weimer - 0.63.0-7 +- Rebuild with fixed binutils + +* Fri Jul 27 2018 Igor Gnatenko - 0.63.0-6 +- Rebuild for new binutils + +* Thu Jul 26 2018 Marek Kasik - 0.63.0-5 - Fix crash when Object has negative number (CVE-2018-13988) -- Resolves: #1607463 +- Resolves: #1607461 -* Thu Jul 12 2018 Marek Kasik - 0.66.0-1 -- Rebase poppler to 0.66.0 -- Resolves: #1600553 +* Mon Jul 23 2018 Marek Kasik - 0.63.0-4 +- Use /usr/bin/python3 explicitly +- https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3#Transition_Steps +- Resolves: #1605490 -* Mon Jun 11 2018 Marek Kasik - 0.62.0-4 -- Drop reversion of removal of Qt4 frontend +* Fri Jul 13 2018 Fedora Release Engineering - 0.63.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild -* Fri May 25 2018 Marek Kasik - 0.62.0-3 +* Mon May 28 2018 Marek Kasik - 0.63.0-2 - Fix infinite recursion (CVE-2017-18267) -- Resolves: #1578779 +- Resolves: #1578780 -* Thu May 24 2018 Marek Kasik - 0.62.0-2 -- Fix building of poppler with python3 only -- Resolves: #1580849 +* Fri Mar 23 2018 Marek Kasik - 0.63.0-1 +- Update to 0.63.0 +- Resolves: #1558001 + +* Wed Mar 07 2018 Rex Dieter - 0.62.0-2 +- BR: gcc-c++, use %%ldconfig_scriptlets %%make_build %%make_install * Wed Feb 14 2018 David Tardon - 0.62.0-1 - new upstream release diff --git a/sources b/sources new file mode 100644 index 0000000..40de1c3 --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (poppler-24.02.0.tar.xz) = 95a208d21ac4d2d308a7ab3da43b95092ef78cd55ebe873c97e0d6c12d8b9d5c4614f83087616c35e1ed9d67ca606a5e008a98698bd12a332a8206ed4cf55500 +SHA512 (poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz) = 257133b261b07076d3207456e3edad324e29911a45a960d4953eb84813ac175bc65be713a10454b52b96711870fcbeee533fd0fd7de8550a87390e833b1af8c5