summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/helpers/pkcs7/pkcs7-check.c14
-rw-r--r--source/tools/pdfsign.c4
2 files changed, 13 insertions, 5 deletions
diff --git a/source/helpers/pkcs7/pkcs7-check.c b/source/helpers/pkcs7/pkcs7-check.c
index 4c70bb2c..225ec385 100644
--- a/source/helpers/pkcs7/pkcs7-check.c
+++ b/source/helpers/pkcs7/pkcs7-check.c
@@ -1,8 +1,10 @@
#include "mupdf/fitz.h"
#include "mupdf/pdf.h"
-#include "mupdf/helpers/pkcs7-openssl.h"
+
#include "mupdf/helpers/pkcs7-check.h"
+#ifdef HAVE_LIBCRYPTO
+#include "mupdf/helpers/pkcs7-openssl.h"
#include <string.h>
@@ -126,3 +128,13 @@ int pdf_check_signature(fz_context *ctx, pdf_document *doc, pdf_widget *widget,
return res;
}
+
+#else
+
+int pdf_check_signature(fz_context *ctx, pdf_document *doc, pdf_widget *widget, char *ebuf, int ebufsize)
+{
+ fz_strlcpy(ebuf, "No digital signing support in this build", ebufsize);
+ return 0;
+}
+
+#endif
diff --git a/source/tools/pdfsign.c b/source/tools/pdfsign.c
index 434c9332..b9b1c862 100644
--- a/source/tools/pdfsign.c
+++ b/source/tools/pdfsign.c
@@ -23,14 +23,10 @@ static void usage(void)
void verify_signature(fz_context *ctx, pdf_document *doc, int n, pdf_widget *widget)
{
-#ifdef HAVE_LIBCRYPTO
char msg[256];
printf("verifying signature on page %d\n", n+1);
pdf_check_signature(ctx, doc, widget, msg, sizeof msg);
printf(" result: '%s'\n", msg);
-#else
- printf("No signature support in this build\n");
-#endif
}
void verify_page(fz_context *ctx, pdf_document *doc, int n, pdf_page *page)