diff options
author | Robin Watts <robin.watts@artifex.com> | 2018-02-06 15:14:59 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2018-02-08 17:10:43 +0000 |
commit | b0df4dfd2b4fbb6f4facbc80195c52df605ec76a (patch) | |
tree | af1247447d0d87573591d36b6c2191255f7f193f /source | |
parent | 1c760a9d6818872c08c3858c03dcdbaefba8ca36 (diff) | |
download | mupdf-b0df4dfd2b4fbb6f4facbc80195c52df605ec76a.tar.xz |
Bug 698996: Disallow "" as owner password unless user password also "".
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-crypt.c | 6 |
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; } |