? 01-xpdf-3.00pl1.patch ? 02-xpdf-3.00pl2.patch ? 03-xpdf-3.00pl3.patch ? 10-xpdf-3.01-docs.patch ? 11-xpdf-3.01-fixedpoint.patch ? 12-xpdf-3.01-no-no-decryption.patch Index: poppler/DCTStream.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/DCTStream.h,v retrieving revision 1.4 diff -u -r1.4 DCTStream.h --- poppler/DCTStream.h 1 Aug 2005 19:15:40 -0000 1.4 +++ poppler/DCTStream.h 15 Sep 2005 09:56:56 -0000 @@ -32,9 +32,7 @@ #include "poppler-config.h" #include "Error.h" #include "Object.h" -#ifndef NO_DECRYPTION #include "Decrypt.h" -#endif #include "Stream.h" extern "C" { Index: poppler/FlateStream.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/FlateStream.h,v retrieving revision 1.1 diff -u -r1.1 FlateStream.h --- poppler/FlateStream.h 27 Apr 2005 20:56:18 -0000 1.1 +++ poppler/FlateStream.h 15 Sep 2005 09:56:56 -0000 @@ -32,9 +32,7 @@ #include "poppler-config.h" #include "Error.h" #include "Object.h" -#ifndef NO_DECRYPTION #include "Decrypt.h" -#endif #include "Stream.h" extern "C" { Index: poppler/Parser.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/Parser.cc,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Parser.cc --- poppler/Parser.cc 3 Mar 2005 19:46:03 -0000 1.1.1.1 +++ poppler/Parser.cc 15 Sep 2005 09:56:57 -0000 @@ -19,9 +19,7 @@ #include "Parser.h" #include "XRef.h" #include "Error.h" -#ifndef NO_DECRYPTION #include "Decrypt.h" -#endif Parser::Parser(XRef *xrefA, Lexer *lexerA) { xref = xrefA; @@ -37,23 +35,17 @@ delete lexer; } -#ifndef NO_DECRYPTION Object *Parser::getObj(Object *obj, Guchar *fileKey, int keyLength, int objNum, int objGen) { -#else -Object *Parser::getObj(Object *obj) { -#endif char *key; Stream *str; Object obj2; int num; -#ifndef NO_DECRYPTION Decrypt *decrypt; GooString *s; char *p; int i; -#endif // refill buffer after inline image data if (inlineImg == 2) { @@ -69,11 +61,7 @@ shift(); obj->initArray(xref); while (!buf1.isCmd("]") && !buf1.isEOF()) -#ifndef NO_DECRYPTION obj->arrayAdd(getObj(&obj2, fileKey, keyLength, objNum, objGen)); -#else - obj->arrayAdd(getObj(&obj2)); -#endif if (buf1.isEOF()) error(getPos(), "End of file inside array"); shift(); @@ -93,11 +81,7 @@ gfree(key); break; } -#ifndef NO_DECRYPTION obj->dictAdd(key, getObj(&obj2, fileKey, keyLength, objNum, objGen)); -#else - obj->dictAdd(key, getObj(&obj2)); -#endif } } if (buf1.isEOF()) @@ -105,12 +89,10 @@ if (buf2.isCmd("stream")) { if ((str = makeStream(obj))) { obj->initStream(str); -#ifndef NO_DECRYPTION if (fileKey) { str->getBaseStream()->doDecryption(fileKey, keyLength, objNum, objGen); } -#endif } else { obj->free(); obj->initError(); @@ -131,7 +113,6 @@ obj->initInt(num); } -#ifndef NO_DECRYPTION // string } else if (buf1.isString() && fileKey) { buf1.copy(obj); @@ -144,7 +125,6 @@ } delete decrypt; shift(); -#endif // simple object } else { Index: poppler/Parser.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/Parser.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 Parser.h --- poppler/Parser.h 3 Mar 2005 19:46:01 -0000 1.1.1.1 +++ poppler/Parser.h 15 Sep 2005 09:56:57 -0000 @@ -29,13 +29,9 @@ ~Parser(); // Get the next object from the input stream. -#ifndef NO_DECRYPTION Object *getObj(Object *obj, Guchar *fileKey = NULL, int keyLength = 0, int objNum = 0, int objGen = 0); -#else - Object *getObj(Object *obj); -#endif // Get stream. Stream *getStream() { return lexer->getStream(); } Index: poppler/Stream.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/Stream.cc,v retrieving revision 1.4 diff -u -r1.4 Stream.cc --- poppler/Stream.cc 27 Aug 2005 08:43:43 -0000 1.4 +++ poppler/Stream.cc 15 Sep 2005 09:57:09 -0000 @@ -25,9 +25,7 @@ #include "poppler-config.h" #include "Error.h" #include "Object.h" -#ifndef NO_DECRYPTION #include "Decrypt.h" -#endif #include "Stream.h" #include "JBIG2Stream.h" #include "JPXStream.h" @@ -280,25 +278,19 @@ BaseStream::BaseStream(Object *dictA) { dict = *dictA; -#ifndef NO_DECRYPTION decrypt = NULL; -#endif } BaseStream::~BaseStream() { dict.free(); -#ifndef NO_DECRYPTION if (decrypt) delete decrypt; -#endif } -#ifndef NO_DECRYPTION void BaseStream::doDecryption(Guchar *fileKey, int keyLength, int objNum, int objGen) { decrypt = new Decrypt(fileKey, keyLength, objNum, objGen); } -#endif //------------------------------------------------------------------------ // FilterStream @@ -604,10 +596,8 @@ saved = gTrue; bufPtr = bufEnd = buf; bufPos = start; -#ifndef NO_DECRYPTION if (decrypt) decrypt->reset(); -#endif } void FileStream::close() { @@ -625,9 +615,7 @@ GBool FileStream::fillBuf() { int n; -#ifndef NO_DECRYPTION char *p; -#endif bufPos += bufEnd - buf; bufPtr = bufEnd = buf; @@ -644,13 +632,11 @@ if (bufPtr >= bufEnd) { return gFalse; } -#ifndef NO_DECRYPTION if (decrypt) { for (p = buf; p < bufEnd; ++p) { *p = (char)decrypt->decryptByte((Guchar)*p); } } -#endif return gTrue; } @@ -739,11 +725,9 @@ void MemStream::reset() { bufPtr = buf + start; -#ifndef NO_DECRYPTION if (decrypt) { decrypt->reset(); } -#endif } void MemStream::close() { @@ -770,7 +754,6 @@ bufPtr = buf + start; } -#ifndef NO_DECRYPTION void MemStream::doDecryption(Guchar *fileKey, int keyLength, int objNum, int objGen) { char *newBuf; @@ -789,7 +772,6 @@ needFree = gTrue; } } -#endif //------------------------------------------------------------------------ // EmbedStream Index: poppler/Stream.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/Stream.h,v retrieving revision 1.4 diff -u -r1.4 Stream.h --- poppler/Stream.h 31 Aug 2005 15:28:46 -0000 1.4 +++ poppler/Stream.h 15 Sep 2005 09:57:12 -0000 @@ -17,9 +17,7 @@ #include "goo/gtypes.h" #include "Object.h" -#ifndef NO_DECRYPTION class Decrypt; -#endif class BaseStream; //------------------------------------------------------------------------ @@ -145,17 +143,13 @@ virtual Guint getStart() = 0; virtual void moveStart(int delta) = 0; -#ifndef NO_DECRYPTION // Set decryption for this stream. virtual void doDecryption(Guchar *fileKey, int keyLength, int objNum, int objGen); -#endif -#ifndef NO_DECRYPTION protected: Decrypt *decrypt; -#endif private: @@ -322,10 +316,8 @@ virtual void setPos(Guint pos, int dir = 0); virtual Guint getStart() { return start; } virtual void moveStart(int delta); -#ifndef NO_DECRYPTION virtual void doDecryption(Guchar *fileKey, int keyLength, int objNum, int objGen); -#endif private: Index: poppler/XRef.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/XRef.cc,v retrieving revision 1.4 diff -u -r1.4 XRef.cc --- poppler/XRef.cc 27 Aug 2005 08:43:43 -0000 1.4 +++ poppler/XRef.cc 15 Sep 2005 09:57:15 -0000 @@ -22,9 +22,7 @@ #include "Lexer.h" #include "Parser.h" #include "Dict.h" -#ifndef NO_DECRYPTION #include "Decrypt.h" -#endif #include "Error.h" #include "ErrorCodes.h" #include "XRef.h" @@ -34,7 +32,6 @@ #define xrefSearchSize 1024 // read this many bytes at end of file // to look for 'startxref' -#ifndef NO_DECRYPTION //------------------------------------------------------------------------ // Permission bits // Note that the PDF spec uses 1 base (eg bit 3 is 1<<2) @@ -49,7 +46,6 @@ #define permAssemble (1<<10) // bit 11 #define permHighResPrint (1<<11) // bit 12 #define defPermFlags 0xfffc -#endif //------------------------------------------------------------------------ // ObjectStream @@ -263,9 +259,7 @@ trailerDict.getDict()->setXRef(this); // check for encryption -#ifndef NO_DECRYPTION encrypted = gFalse; -#endif if (checkEncrypted(ownerPassword, userPassword)) { ok = gFalse; errCode = errEncrypted; @@ -786,7 +780,6 @@ return gFalse; } -#ifndef NO_DECRYPTION GBool XRef::checkEncrypted(GooString *ownerPassword, GooString *userPassword) { Object encrypt, filterObj, versionObj, revisionObj, lengthObj; Object ownerKey, userKey, permissions, fileID, fileID1; @@ -881,34 +874,15 @@ return ret; } -#else -GBool XRef::checkEncrypted(GooString *ownerPassword, GooString *userPassword) { - Object obj; - GBool encrypted; - - trailerDict.dictLookup("Encrypt", &obj); - if ((encrypted = !obj.isNull())) { - error(-1, "PDF file is encrypted and this version of the Xpdf tools"); - error(-1, "was built without decryption support."); - } - obj.free(); - return encrypted; -} -#endif GBool XRef::okToPrint(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint); -#else - return gTrue; -#endif } // we can print at high res if we are only doing security handler revision // 2 (and we are allowed to print at all), or with security handler rev // 3 and we are allowed to print, and bit 12 is set. GBool XRef::okToPrintHighRes(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION if (2 == encRevision) { return (okToPrint(ignoreOwnerPW)); } else if (encRevision >= 3) { @@ -917,57 +891,30 @@ // something weird - unknown security handler version return gFalse; } -#else - return gTrue; -#endif } GBool XRef::okToChange(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange); -#else - return gTrue; -#endif } GBool XRef::okToCopy(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy); -#else - return gTrue; -#endif } GBool XRef::okToAddNotes(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes); -#else - return gTrue; -#endif } GBool XRef::okToFillForm(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permFillForm); -#else - return gTrue; -#endif } GBool XRef::okToAccessibility(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permAccessibility); -#else - return gTrue; -#endif } GBool XRef::okToAssemble(GBool ignoreOwnerPW) { -#ifndef NO_DECRYPTION return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permAssemble); -#else - return gTrue; -#endif } Object *XRef::fetch(int num, int gen, Object *obj) { @@ -999,12 +946,8 @@ !obj3.isCmd("obj")) { goto err; } -#ifndef NO_DECRYPTION parser->getObj(obj, encrypted ? fileKey : (Guchar *)NULL, keyLength, num, gen); -#else - parser->getObj(obj); -#endif obj1.free(); obj2.free(); obj3.free(); Index: poppler/XRef.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/XRef.h,v retrieving revision 1.2 diff -u -r1.2 XRef.h --- poppler/XRef.h 5 Jul 2005 12:15:04 -0000 1.2 +++ poppler/XRef.h 15 Sep 2005 09:57:16 -0000 @@ -53,11 +53,7 @@ int getErrorCode() { return errCode; } // Is the file encrypted? -#ifndef NO_DECRYPTION GBool isEncrypted() { return encrypted; } -#else - GBool isEncrypted() { return gFalse; } -#endif // Check various permissions. GBool okToPrint(GBool ignoreOwnerPW = gFalse); @@ -114,7 +110,6 @@ // damaged files int streamEndsLen; // number of valid entries in streamEnds ObjectStream *objStr; // cached object stream -#ifndef NO_DECRYPTION GBool encrypted; // true if file is encrypted int encVersion; // encryption algorithm int encRevision; // security handler revision @@ -122,7 +117,6 @@ int permFlags; // permission bits Guchar fileKey[16]; // file decryption key GBool ownerPasswordOk; // true if owner password is correct -#endif Guint getStartXref(); GBool readXRef(Guint *pos); Index: poppler/poppler-config.h.in =================================================================== RCS file: /cvs/poppler/poppler/poppler/poppler-config.h.in,v retrieving revision 1.2 diff -u -r1.2 poppler-config.h.in --- poppler/poppler-config.h.in 28 Jul 2005 06:31:57 -0000 1.2 +++ poppler/poppler-config.h.in 15 Sep 2005 09:57:17 -0000 @@ -41,8 +41,6 @@ // Also, there's a couple of preprocessor symbols in the header files // that are used but never defined: DISABLE_OUTLINE, DEBUG_MEM and -// NO_DECRYPTION. We might want to explicitly #undef these to make -// sure we don't get spurious API or ABI incompatibilities. //------------------------------------------------------------------------ // version