From 0312fb0efa320655905bd72b1af4228f017a8498 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Tue, 23 Jan 2018 10:02:43 +0000 Subject: Signature support: simplify pkcs7 api by the removal of byte ranges. Rather than provide a stream and an explicitly defined set of byte ranges within that stream, provide a stream that gives access to just the bytes in the ranges. --- include/mupdf/pdf/crypt.h | 2 +- include/mupdf/pdf/pdf-pkcs7.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mupdf/pdf/crypt.h b/include/mupdf/pdf/crypt.h index 59513acc..3aee039a 100644 --- a/include/mupdf/pdf/crypt.h +++ b/include/mupdf/pdf/crypt.h @@ -26,7 +26,7 @@ void pdf_write_digest(fz_context *ctx, fz_output *out, pdf_obj *byte_range, int /* pdf_signature_widget_byte_range: retrieve the byte range for a signature widget */ -int pdf_signature_widget_byte_range(fz_context *ctx, pdf_document *doc, pdf_widget *widget, int (*byte_range)[2]); +int pdf_signature_widget_byte_range(fz_context *ctx, pdf_document *doc, pdf_widget *widget, fz_range *byte_range); /* pdf_signature_widget_contents: retrieve the contents for a signature widget diff --git a/include/mupdf/pdf/pdf-pkcs7.h b/include/mupdf/pdf/pdf-pkcs7.h index 8f11a6b4..237a036d 100644 --- a/include/mupdf/pdf/pdf-pkcs7.h +++ b/include/mupdf/pdf/pdf-pkcs7.h @@ -24,7 +24,7 @@ typedef struct pdf_pkcs7_designated_name_s pdf_pkcs7_designated_name; /* Check a signature's digest against ranges of bytes drawn from a stream */ -SignatureError pdf_pkcs7_check_digest(fz_context *ctx, fz_stream *stm, char *sig, int sig_len, int (*byte_range)[2], int byte_range_len); +SignatureError pdf_pkcs7_check_digest(fz_context *ctx, fz_stream *stm, char *sig, int sig_len); /* Check a singature's certificate is trusted */ SignatureError pdf_pkcs7_check_certificate(char *sig, int sig_len); @@ -48,7 +48,7 @@ void pdf_pkcs7_drop_signer(fz_context *ctx, pdf_pkcs7_signer *signer); pdf_pkcs7_designated_name *pdf_pkcs7_signer_designated_name(fz_context *ctx, pdf_pkcs7_signer *signer); /* Create a signature based on ranges of bytes drawn from a steam */ -int pdf_pkcs7_create_digest(fz_context *ctx, fz_stream *in, int brange[][2], int brange_len, pdf_pkcs7_signer *signer, unsigned char *digest, int *digest_len); +int pdf_pkcs7_create_digest(fz_context *ctx, fz_stream *in, pdf_pkcs7_signer *signer, unsigned char *digest, int *digest_len); /* Report whether pkcs7 is supported in the current build */ int pdf_pkcs7_supported(fz_context *ctx); -- cgit v1.2.3