summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-crypt.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-09-01 22:11:03 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-09-08 15:08:52 +0200
commita55648c9d009cdd94977fc5b7152932e59c975ad (patch)
tree1be3408d601386b3ce23130bc5c76466fb8f3933 /source/pdf/pdf-crypt.c
parent621f2c0b3b913c59c0d3cc8ebedac1453caf7acb (diff)
downloadmupdf-a55648c9d009cdd94977fc5b7152932e59c975ad.tar.xz
Revert part of commit 5509a4ef7520bf0b5280ce7d6af8eb15b1b8b0f1
Even though the encryption key length isn't supposed to be taken from the encryption dictionary's /Length for crypt version 4, other readers such as Adobe's still use that value if a crypt filter's /Length is missing. See https://code.google.com/p/sumatrapdf/issues/detail?id=2710 for a document where this makes a difference (or simply remove /Length from the crypt filter in any document encrypted with crypt version 4 and an AESV2 crypt filter).
Diffstat (limited to 'source/pdf/pdf-crypt.c')
-rw-r--r--source/pdf/pdf-crypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/pdf/pdf-crypt.c b/source/pdf/pdf-crypt.c
index ef87655e..d502c378 100644
--- a/source/pdf/pdf-crypt.c
+++ b/source/pdf/pdf-crypt.c
@@ -180,7 +180,7 @@ pdf_new_crypt(fz_context *ctx, pdf_obj *dict, pdf_obj *id)
/* Determine encryption key length */
crypt->length = 40;
- if (crypt->v == 2)
+ if (crypt->v == 2 || crypt->v == 4)
{
obj = pdf_dict_gets(dict, "Length");
if (pdf_is_int(obj))