diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-11-07 19:44:55 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-11-07 20:02:51 +0100 |
commit | 68840d4a34e1e56ea9130158e8e163fb60550db4 (patch) | |
tree | 4e331d436427d525879c9979f44def044e6fdd43 | |
parent | 5df675cf0886e88fdc2dfc07cf127c3e0065dedf (diff) | |
download | mupdf-68840d4a34e1e56ea9130158e8e163fb60550db4.tar.xz |
Fix 699840: Use saved sig_widget pointer to sign signatures, not selected_annot.
-rw-r--r-- | platform/gl/gl-form.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/gl/gl-form.c b/platform/gl/gl-form.c index 94daa8e2..889554f2 100644 --- a/platform/gl/gl-form.c +++ b/platform/gl/gl-form.c @@ -10,6 +10,10 @@ #include "mupdf/helpers/pkcs7-check.h" #include "mupdf/helpers/pkcs7-openssl.h" +static pdf_widget *sig_widget; +static char sig_status[500]; +static int sig_result; + static char cert_filename[PATH_MAX]; static struct input cert_password; @@ -22,7 +26,7 @@ static void do_sign(void) fz_try(ctx) { signer = pkcs7_openssl_read_pfx(ctx, cert_filename, cert_password.text); - pdf_sign_signature(ctx, pdf, selected_annot, signer); + pdf_sign_signature(ctx, pdf, sig_widget, signer); ui_show_warning_dialog("Signed document successfully."); } fz_always(ctx) @@ -33,7 +37,7 @@ static void do_sign(void) fz_catch(ctx) ui_show_warning_dialog("%s", fz_caught_message(ctx)); - if (pdf_update_page(ctx, selected_annot->page)) + if (pdf_update_page(ctx, sig_widget->page)) render_page(); } @@ -84,10 +88,6 @@ static void cert_file_dialog(void) } } -static pdf_widget *sig_widget; -static char sig_status[500]; -static int sig_result; - static void sig_dialog(void) { const char *label = pdf_field_label(ctx, sig_widget->page->doc, sig_widget->obj); |