From 9b946a62b4fb13c9d68b263ef00af01ab115a397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 12 Mar 2022 23:02:55 +0100 Subject: [PATCH] ADEPT remove : Don't decrypt XRef stream if there is one --- include/libgourou.h | 2 +- src/libgourou.cpp | 7 +++++++ utils/drmprocessorclientimpl.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/libgourou.h b/include/libgourou.h index 186b0c5..1715a7c 100644 --- a/include/libgourou.h +++ b/include/libgourou.h @@ -40,7 +40,7 @@ #define ACS_SERVER "http://adeactivate.adobe.com/adept" #endif -#define LIBGOUROU_VERSION "0.5.2" +#define LIBGOUROU_VERSION "0.5.3" namespace gourou { diff --git a/src/libgourou.cpp b/src/libgourou.cpp index b4f2918..0397045 100644 --- a/src/libgourou.cpp +++ b/src/libgourou.cpp @@ -1151,10 +1151,17 @@ namespace gourou uPDFParser::Object* object = *it; if (object->objectId() == ebxId) + { + // object->deleteKey("Filter"); continue; + } + // Should not decrypt XRef stream if (object->hasKey("Type") && (*object)["Type"]->str() == "/XRef") + { + GOUROU_LOG(DEBUG, "XRef stream at " << object->offset()); continue; + } GOUROU_LOG(DEBUG, "Obj " << object->objectId()); diff --git a/utils/drmprocessorclientimpl.cpp b/utils/drmprocessorclientimpl.cpp index 089b31a..b18b1ba 100644 --- a/utils/drmprocessorclientimpl.cpp +++ b/utils/drmprocessorclientimpl.cpp @@ -532,7 +532,7 @@ void DRMProcessorClientImpl::inflate(gourou::ByteArray& data, gourou::ByteArray& { // Real error if (ret == Z_BUF_ERROR && infstream.avail_out == (uInt)dataSize) - EXCEPTION(gourou::CLIENT_ZIP_ERROR, "Inflate error, code " << zError(ret) << ", msg " << infstream.msg); + break; result.append(buffer, dataSize-infstream.avail_out);