From b0df4dfd2b4fbb6f4facbc80195c52df605ec76a Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 6 Feb 2018 15:14:59 +0000 Subject: Bug 698996: Disallow "" as owner password unless user password also "". --- source/pdf/pdf-crypt.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/pdf') 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; } -- cgit v1.2.3