summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-crypt.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-02-06 15:14:59 +0000
committerRobin Watts <robin.watts@artifex.com>2018-02-08 17:10:43 +0000
commitb0df4dfd2b4fbb6f4facbc80195c52df605ec76a (patch)
treeaf1247447d0d87573591d36b6c2191255f7f193f /source/pdf/pdf-crypt.c
parent1c760a9d6818872c08c3858c03dcdbaefba8ca36 (diff)
downloadmupdf-b0df4dfd2b4fbb6f4facbc80195c52df605ec76a.tar.xz
Bug 698996: Disallow "" as owner password unless user password also "".
Diffstat (limited to 'source/pdf/pdf-crypt.c')
-rw-r--r--source/pdf/pdf-crypt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/pdf/pdf-crypt.c b/source/pdf/pdf-crypt.c
index c427e85e..f73617ff 100644
--- a/source/pdf/pdf-crypt.c
+++ b/source/pdf/pdf-crypt.c
@@ -788,6 +788,12 @@ pdf_authenticate_password(fz_context *ctx, pdf_document *doc, const char *pwd_ut
* stored keys. */
(void)pdf_authenticate_user_password(ctx, doc->crypt, (unsigned char *)password, strlen(password));
}
+
+ /* To match Acrobat, we choose not to allow an empty owner
+ * password, unless the user password is also the empty one. */
+ if (*password == 0 && auth == 4)
+ return 0;
+
return auth;
}