diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-01-19 00:58:09 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-01-19 17:48:49 +0100 |
commit | 75b6425fe9ce8136dbc852415471708d365b4d25 (patch) | |
tree | 3d5533b150d5eb5fd3fe8efa8b667512a44edef7 /apps/pdfclean.c | |
parent | 08e84b18e5c1dbe8f3d32dd0aeb4b4c43debce9f (diff) | |
download | mupdf-75b6425fe9ce8136dbc852415471708d365b4d25.tar.xz |
Remove confusing optional 'password' argument to pdf_open_xref.
Require that clients call pdf_needs_password/pdf_authenticate_password
instead. For dumb clients, we still allow for decrypting a file with
a blank password without calling those functions.
Diffstat (limited to 'apps/pdfclean.c')
-rw-r--r-- | apps/pdfclean.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pdfclean.c b/apps/pdfclean.c index 0f3474ce..82eb7c03 100644 --- a/apps/pdfclean.c +++ b/apps/pdfclean.c @@ -775,7 +775,10 @@ int main(int argc, char **argv) exit(1); } - xref = pdf_open_xref(ctx, infile, password); + xref = pdf_open_xref(ctx, infile); + if (pdf_needs_password(xref)) + if (!pdf_authenticate_password(xref, password)) + fz_throw(ctx, "cannot authenticate password: %s\n", infile); out = fopen(outfile, "wb"); if (!out) |