Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/Decrypt.h
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 22:20:42 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 22:20:42 (GMT)
commit2a393c134fe3fe8eb85bf818cb7ad6ae4396322a (patch)
treeeba8b0dcaba42d799ed8313faee15fb74a5a0cd2 /pdf/xpdf/Decrypt.h
parent7aac8dc8533347e21311b15186e0af82f1b22fd6 (diff)
Synched with Xpdf 1.01
Diffstat (limited to 'pdf/xpdf/Decrypt.h')
-rw-r--r--pdf/xpdf/Decrypt.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/pdf/xpdf/Decrypt.h b/pdf/xpdf/Decrypt.h
index 3ea4374..52afb2f 100644
--- a/pdf/xpdf/Decrypt.h
+++ b/pdf/xpdf/Decrypt.h
@@ -2,7 +2,7 @@
//
// Decrypt.h
//
-// Copyright 1996 Derek B. Noonburg
+// Copyright 1996-2002 Glyph & Cog, LLC
//
//========================================================================
@@ -24,7 +24,7 @@ class Decrypt {
public:
// Initialize the decryptor object.
- Decrypt(Guchar *fileKey, int objNum, int objGen);
+ Decrypt(Guchar *fileKey, int keyLength, int objNum, int objGen);
// Reset decryption.
void reset();
@@ -32,16 +32,26 @@ public:
// Decrypt one byte.
Guchar decryptByte(Guchar c);
- // Generate a file key. The <fileKey> buffer must have space for
- // at least 16 bytes. Checks user key and returns gTrue if okay.
- // <userPassword> may be NULL.
- static GBool makeFileKey(GString *ownerKey, GString *userKey,
+ // Generate a file key. The <fileKey> buffer must have space for at
+ // least 16 bytes. Checks <ownerPassword> and then <userPassword>
+ // and returns true if either is correct. Sets <ownerPasswordOk> if
+ // the owner password was correct. Either or both of the passwords
+ // may be NULL, which is treated as an empty string.
+ static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
+ GString *ownerKey, GString *userKey,
int permissions, GString *fileID,
- GString *userPassword, Guchar *fileKey);
+ GString *ownerPassword, GString *userPassword,
+ Guchar *fileKey, GBool *ownerPasswordOk);
private:
- Guchar objKey[16];
+ static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
+ GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *userPassword, Guchar *fileKey);
+
+ int objKeyLength;
+ Guchar objKey[21];
Guchar state[256];
Guchar x, y;
};