summaryrefslogtreecommitdiff
path: root/apps/common/pdftool.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/common/pdftool.c')
-rw-r--r--apps/common/pdftool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/common/pdftool.c b/apps/common/pdftool.c
index 5de9e1b6..025dcd9b 100644
--- a/apps/common/pdftool.c
+++ b/apps/common/pdftool.c
@@ -50,9 +50,9 @@ void openxref(char *filename, char *password, int dieonbadpass)
if (error)
die(error);
- if (xref->crypt)
+ if (pdf_needspassword(xref))
{
- okay = pdf_setpassword(xref->crypt, password);
+ okay = pdf_authenticatepassword(xref, password);
if (!okay && !dieonbadpass)
fz_warn("invalid password, attempting to continue.");
else if (!okay && dieonbadpass)