From 6223aeeddda9016356d8e7b114553489eccecd01 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 6 Jul 2018 15:53:20 +0100 Subject: Only do signing if HAVE_LIBCRYPTO is defined. --- platform/gl/gl-form.c | 8 ++++++-- platform/x11/pdfapp.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/gl/gl-form.c b/platform/gl/gl-form.c index f9083f71..b9da50a1 100644 --- a/platform/gl/gl-form.c +++ b/platform/gl/gl-form.c @@ -15,6 +15,7 @@ static struct input cert_password; static void do_sign(void) { +#ifdef HAVE_LIBCRYPTO pdf_pkcs7_signer *signer = NULL; fz_var(signer); @@ -35,6 +36,9 @@ static void do_sign(void) if (pdf_update_page(ctx, selected_annot->page)) render_page(); +#else + ui_show_warning_dialog("Document not signed as no LIBCRYPTO."); +#endif } static void cert_password_dialog(void) @@ -113,14 +117,14 @@ void do_widget_panel(void) } else if (type == PDF_WIDGET_TYPE_COMBOBOX || type == PDF_WIDGET_TYPE_LISTBOX) { - const char **options; + char **options; int n, choice; ui_label("Value:"); n = pdf_choice_widget_options(ctx, selected_annot->page->doc, selected_annot, 0, NULL); options = fz_malloc_array(ctx, n, sizeof(char*)); pdf_choice_widget_options(ctx, selected_annot->page->doc, selected_annot, 0, options); value = pdf_field_value(ctx, selected_annot->page->doc, selected_annot->obj); - choice = ui_select("Widget/Ch", value, (const char **)options, n); + choice = ui_select("Widget/Ch", value, options, n); if (choice >= 0) { pdf_field_set_value(ctx, selected_annot->page->doc, selected_annot->obj, options[choice]); diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 17ec2679..5bacb467 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -1682,8 +1682,8 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta { int nopts; int nvals; - const char **opts = NULL; - const char **vals = NULL; + char **opts = NULL; + char **vals = NULL; fz_var(opts); fz_var(vals); @@ -1719,6 +1719,7 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta break; case PDF_WIDGET_TYPE_SIGNATURE: +#ifdef HAVE_LIBCRYPTO if (state == -1) { char ebuf[256]; @@ -1774,6 +1775,9 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta } } } +#else + winwarn(app, "Cannot check signatures as no libcrypto!"); +#endif break; } } -- cgit v1.2.3