summaryrefslogtreecommitdiff
path: root/source/helpers
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-07-11 12:23:52 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-08-10 12:09:33 +0200
commit37ed199fcebc73954e694b44033aeca4ab8a417f (patch)
tree22ae28e8efca1429704d1b9aad8eb4cfcbbabb11 /source/helpers
parent09f2e173850e011e6390c49a4f761e87dd87ffba (diff)
downloadmupdf-37ed199fcebc73954e694b44033aeca4ab8a417f.tar.xz
Use stubs instead of conditional compile with HAVE_LIBCRYPTO.
The macro is only set when building the pkcs7-helper library, so cannot be used by client code. Build stub functions when compiling the pkcs7-openssl helper library without libcrypto.
Diffstat (limited to 'source/helpers')
-rw-r--r--source/helpers/pkcs7/pkcs7-openssl.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/source/helpers/pkcs7/pkcs7-openssl.c b/source/helpers/pkcs7/pkcs7-openssl.c
index 22d281df..1468b7e1 100644
--- a/source/helpers/pkcs7/pkcs7-openssl.c
+++ b/source/helpers/pkcs7/pkcs7-openssl.c
@@ -1,8 +1,43 @@
#include "mupdf/fitz.h"
#include "mupdf/pdf.h"
-#include "../../fitz/fitz-imp.h"
+#include "../../fitz/fitz-imp.h" /* for fz_keep/drop_imp */
+
#include "mupdf/helpers/pkcs7-openssl.h"
+#ifndef HAVE_LIBCRYPTO
+
+enum pdf_signature_error
+pkcs7_openssl_check_digest(fz_context *ctx, fz_stream *stm, char *sig, int sig_len)
+{
+ return PDF_SIGNATURE_ERROR_UNKNOWN;
+}
+
+/* Check a singature's certificate is trusted */
+enum pdf_signature_error
+pkcs7_openssl_check_certificate(char *sig, int sig_len)
+{
+ return PDF_SIGNATURE_ERROR_UNKNOWN;
+}
+
+pdf_pkcs7_designated_name *
+pkcs7_openssl_designated_name(fz_context *ctx, char *sig, int sig_len)
+{
+ return NULL;
+}
+
+void
+pkcs7_openssl_drop_designated_name(fz_context *ctx, pdf_pkcs7_designated_name *dn)
+{
+}
+
+pdf_pkcs7_signer *
+pkcs7_openssl_read_pfx(fz_context *ctx, const char *pfile, const char *pw)
+{
+ fz_throw(ctx, FZ_ERROR_GENERIC, "No OpenSSL support.");
+}
+
+#else
+
#include <limits.h>
#include <string.h>
@@ -776,3 +811,5 @@ exit:
return name;
}
+
+#endif