summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-pkcs7.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-04-12 16:24:34 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-04-13 14:13:31 +0200
commit48be72fb64202cb52d5ebe3a4c931aa925276b6d (patch)
tree798dada1ad918874ec264270f20a71e895087887 /source/pdf/pdf-pkcs7.c
parentc3400385a878c71ab9e60b7cfb88b437234ac353 (diff)
downloadmupdf-48be72fb64202cb52d5ebe3a4c931aa925276b6d.tar.xz
Change generated files to be C instead of headers.
Remove AdobeCA.p7c from autogenerated files. Just include the array in the source. Simplifies makefile dependencies and makes the sizes of each bit of data easier to look at. It also paves the way for eventually using objcopy to create binary objects for the fonts instead of needing to use hexdump.
Diffstat (limited to 'source/pdf/pdf-pkcs7.c')
-rw-r--r--source/pdf/pdf-pkcs7.c65
1 files changed, 61 insertions, 4 deletions
diff --git a/source/pdf/pdf-pkcs7.c b/source/pdf/pdf-pkcs7.c
index dd106034..3fac2c72 100644
--- a/source/pdf/pdf-pkcs7.c
+++ b/source/pdf/pdf-pkcs7.c
@@ -1,7 +1,66 @@
-#include "mupdf/pdf.h" // TODO: move this file to pdf module
+#include "mupdf/pdf.h"
#ifdef HAVE_LIBCRYPTO
+/* Generated from resources/certs/AdobeCA.p7c */
+static const char AdobeCA_p7c[] = {
+48,130,4,208,6,9,42,134,72,134,247,13,1,7,2,160,130,4,193,48,130,4,189,2,
+1,1,49,0,48,11,6,9,42,134,72,134,247,13,1,7,1,160,130,4,165,48,130,4,161,
+48,130,3,137,160,3,2,1,2,2,4,62,28,189,40,48,13,6,9,42,134,72,134,247,13,
+1,1,5,5,0,48,105,49,11,48,9,6,3,85,4,6,19,2,85,83,49,35,48,33,6,3,85,4,10,
+19,26,65,100,111,98,101,32,83,121,115,116,101,109,115,32,73,110,99,111,114,
+112,111,114,97,116,101,100,49,29,48,27,6,3,85,4,11,19,20,65,100,111,98,101,
+32,84,114,117,115,116,32,83,101,114,118,105,99,101,115,49,22,48,20,6,3,85,
+4,3,19,13,65,100,111,98,101,32,82,111,111,116,32,67,65,48,30,23,13,48,51,
+48,49,48,56,50,51,51,55,50,51,90,23,13,50,51,48,49,48,57,48,48,48,55,50,51,
+90,48,105,49,11,48,9,6,3,85,4,6,19,2,85,83,49,35,48,33,6,3,85,4,10,19,26,
+65,100,111,98,101,32,83,121,115,116,101,109,115,32,73,110,99,111,114,112,
+111,114,97,116,101,100,49,29,48,27,6,3,85,4,11,19,20,65,100,111,98,101,32,
+84,114,117,115,116,32,83,101,114,118,105,99,101,115,49,22,48,20,6,3,85,4,
+3,19,13,65,100,111,98,101,32,82,111,111,116,32,67,65,48,130,1,34,48,13,6,
+9,42,134,72,134,247,13,1,1,1,5,0,3,130,1,15,0,48,130,1,10,2,130,1,1,0,204,
+79,84,132,247,167,162,231,51,83,127,63,156,18,136,107,44,153,71,103,126,15,
+30,185,173,20,136,249,195,16,216,29,240,240,213,159,105,10,47,89,53,176,204,
+108,169,76,156,21,160,159,206,32,191,160,207,84,226,224,32,102,69,63,57,134,
+56,126,156,196,142,7,34,198,36,246,1,18,176,53,223,85,234,105,144,176,219,
+133,55,30,226,78,7,178,66,161,106,19,105,160,102,234,128,145,17,89,42,155,
+8,121,90,32,68,45,201,189,115,56,139,60,47,224,67,27,93,179,11,240,175,53,
+26,41,254,239,166,146,221,129,76,157,61,89,142,173,49,60,64,126,155,145,54,
+6,252,226,92,141,209,141,38,213,92,69,207,175,101,63,177,170,210,98,150,244,
+168,56,234,186,96,66,244,244,28,74,53,21,206,248,78,34,86,15,149,24,197,248,
+150,159,159,251,176,183,120,37,233,128,107,189,214,10,240,198,116,148,157,
+243,15,80,219,154,119,206,75,112,131,35,141,160,202,120,32,68,92,60,84,100,
+241,234,162,48,25,159,234,76,6,77,6,120,75,94,146,223,34,210,201,103,179,
+122,210,1,2,3,1,0,1,163,130,1,79,48,130,1,75,48,17,6,9,96,134,72,1,134,248,
+66,1,1,4,4,3,2,0,7,48,129,142,6,3,85,29,31,4,129,134,48,129,131,48,129,128,
+160,126,160,124,164,122,48,120,49,11,48,9,6,3,85,4,6,19,2,85,83,49,35,48,
+33,6,3,85,4,10,19,26,65,100,111,98,101,32,83,121,115,116,101,109,115,32,73,
+110,99,111,114,112,111,114,97,116,101,100,49,29,48,27,6,3,85,4,11,19,20,65,
+100,111,98,101,32,84,114,117,115,116,32,83,101,114,118,105,99,101,115,49,
+22,48,20,6,3,85,4,3,19,13,65,100,111,98,101,32,82,111,111,116,32,67,65,49,
+13,48,11,6,3,85,4,3,19,4,67,82,76,49,48,43,6,3,85,29,16,4,36,48,34,128,15,
+50,48,48,51,48,49,48,56,50,51,51,55,50,51,90,129,15,50,48,50,51,48,49,48,
+57,48,48,48,55,50,51,90,48,11,6,3,85,29,15,4,4,3,2,1,6,48,31,6,3,85,29,35,
+4,24,48,22,128,20,130,183,56,74,147,170,155,16,239,128,187,217,84,226,241,
+15,251,128,156,222,48,29,6,3,85,29,14,4,22,4,20,130,183,56,74,147,170,155,
+16,239,128,187,217,84,226,241,15,251,128,156,222,48,12,6,3,85,29,19,4,5,48,
+3,1,1,255,48,29,6,9,42,134,72,134,246,125,7,65,0,4,16,48,14,27,8,86,54,46,
+48,58,52,46,48,3,2,4,144,48,13,6,9,42,134,72,134,247,13,1,1,5,5,0,3,130,1,
+1,0,50,218,159,67,117,193,250,111,201,111,219,171,29,54,55,62,188,97,25,54,
+183,2,60,29,35,89,152,108,158,238,77,133,231,84,200,32,31,167,212,187,226,
+191,0,119,125,36,107,112,47,92,193,58,118,73,181,211,224,35,132,42,113,106,
+34,243,193,39,41,152,21,246,53,144,228,4,76,195,141,188,159,97,28,231,253,
+36,140,209,68,67,140,22,186,155,77,165,212,53,47,188,17,206,189,247,81,55,
+141,159,144,228,20,241,24,63,190,233,89,18,53,249,51,146,243,158,224,213,
+107,154,113,155,153,75,200,113,195,225,177,97,9,196,229,250,145,240,66,58,
+55,125,52,249,114,232,205,170,98,28,33,233,213,244,130,16,227,123,5,182,45,
+104,86,11,126,126,146,44,111,77,114,130,12,237,86,116,178,157,185,171,45,
+43,29,16,95,219,39,117,112,143,253,29,215,226,2,160,121,229,28,229,255,175,
+100,64,81,45,158,155,71,219,66,165,124,31,194,166,72,176,215,190,146,105,
+77,164,246,41,87,197,120,17,24,220,135,81,202,19,178,98,157,79,43,50,189,
+49,165,193,250,82,171,5,136,200,49,0
+};
+
#include "openssl/err.h"
#include "openssl/bio.h"
#include "openssl/asn1.h"
@@ -256,8 +315,6 @@ exit:
return res;
}
-#include "gen_adobe_ca.h"
-
static int verify_sig(char *sig, int sig_len, char *file, int (*byte_range)[2], int byte_range_len, char *ebuf, int ebufsize)
{
PKCS7 *pk7sig = NULL;
@@ -289,7 +346,7 @@ static int verify_sig(char *sig, int sig_len, char *file, int (*byte_range)[2],
BIO_set_segments(bsegs, byte_range, byte_range_len);
/* Find the certificates in the pk7 file */
- bcert = BIO_new_mem_buf((void*)fz_resources_certs_AdobeCA_p7c, fz_resources_certs_AdobeCA_p7c_size);
+ bcert = BIO_new_mem_buf((void*)AdobeCA_p7c, sizeof AdobeCA_p7c);
pk7cert = d2i_PKCS7_bio(bcert, NULL);
if (pk7cert == NULL)
goto exit;