From 1ebb2db0aaa6b5212152dd0f32d781fa81b6bcaa Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Wed, 17 Jan 2018 11:50:33 +0000 Subject: Signature support: use an enum to report errors. Previously, errors were reported with a boolean function return with a char buffer filled out with the reason in the failure case. Now an enum is used to report the various failure cases. The function pdf_check_signature has been left as is so that existing apps will not need changing. --- include/mupdf/pdf/crypt.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/mupdf/pdf/crypt.h b/include/mupdf/pdf/crypt.h index e29da8ca..555a8d25 100644 --- a/include/mupdf/pdf/crypt.h +++ b/include/mupdf/pdf/crypt.h @@ -21,6 +21,18 @@ unsigned char *pdf_crypt_key(fz_context *ctx, pdf_document *doc); void pdf_print_crypt(fz_context *ctx, fz_output *out, pdf_crypt *crypt); +typedef enum +{ + SignatureError_Okay, + SignatureError_NoSignatures, + SignatureError_NoCertificate, + SignatureError_DocumentChanged, + SignatureError_SelfSigned, + SignatureError_SelfSignedInChain, + SignatureError_NotTrusted, + SignatureError_Unknown +} SignatureError; + typedef struct pdf_designated_name_s { char *cn; -- cgit v1.2.3