From a55648c9d009cdd94977fc5b7152932e59c975ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Mon, 1 Sep 2014 22:11:03 +0200 Subject: 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). --- source/pdf/pdf-crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/pdf/pdf-crypt.c') 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)) -- cgit v1.2.3