diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-04-12 16:24:34 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-04-13 14:13:31 +0200 |
commit | 48be72fb64202cb52d5ebe3a4c931aa925276b6d (patch) | |
tree | 798dada1ad918874ec264270f20a71e895087887 /source/pdf | |
parent | c3400385a878c71ab9e60b7cfb88b437234ac353 (diff) | |
download | mupdf-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')
-rw-r--r-- | source/pdf/pdf-cmap-table.c | 535 | ||||
-rw-r--r-- | source/pdf/pdf-js.c | 2 | ||||
-rw-r--r-- | source/pdf/pdf-pkcs7.c | 65 |
3 files changed, 418 insertions, 184 deletions
diff --git a/source/pdf/pdf-cmap-table.c b/source/pdf/pdf-cmap-table.c index eb94ee6e..8b2a62c4 100644 --- a/source/pdf/pdf-cmap-table.c +++ b/source/pdf/pdf-cmap-table.c @@ -20,207 +20,384 @@ #if CJK_CMAPS -#include "gen_cmap_cjk.h" +extern pdf_cmap pdf_cmap_83pv_RKSJ_H; +extern pdf_cmap pdf_cmap_90ms_RKSJ_H; +extern pdf_cmap pdf_cmap_90ms_RKSJ_V; +extern pdf_cmap pdf_cmap_90msp_RKSJ_H; +extern pdf_cmap pdf_cmap_90msp_RKSJ_V; +extern pdf_cmap pdf_cmap_90pv_RKSJ_H; +extern pdf_cmap pdf_cmap_Add_RKSJ_H; +extern pdf_cmap pdf_cmap_Add_RKSJ_V; +extern pdf_cmap pdf_cmap_Adobe_CNS1_UCS2; +extern pdf_cmap pdf_cmap_Adobe_GB1_UCS2; +extern pdf_cmap pdf_cmap_Adobe_Japan1_UCS2; +extern pdf_cmap pdf_cmap_Adobe_Korea1_UCS2; +extern pdf_cmap pdf_cmap_B5pc_H; +extern pdf_cmap pdf_cmap_B5pc_V; +extern pdf_cmap pdf_cmap_CNS_EUC_H; +extern pdf_cmap pdf_cmap_CNS_EUC_V; +extern pdf_cmap pdf_cmap_ETen_B5_H; +extern pdf_cmap pdf_cmap_ETen_B5_V; +extern pdf_cmap pdf_cmap_ETenms_B5_H; +extern pdf_cmap pdf_cmap_ETenms_B5_V; +extern pdf_cmap pdf_cmap_EUC_H; +extern pdf_cmap pdf_cmap_EUC_V; +extern pdf_cmap pdf_cmap_Ext_RKSJ_H; +extern pdf_cmap pdf_cmap_Ext_RKSJ_V; +extern pdf_cmap pdf_cmap_GBK2K_H; +extern pdf_cmap pdf_cmap_GBK2K_V; +extern pdf_cmap pdf_cmap_GBK_EUC_H; +extern pdf_cmap pdf_cmap_GBK_EUC_V; +extern pdf_cmap pdf_cmap_GBKp_EUC_H; +extern pdf_cmap pdf_cmap_GBKp_EUC_V; +extern pdf_cmap pdf_cmap_GB_EUC_H; +extern pdf_cmap pdf_cmap_GB_EUC_V; +extern pdf_cmap pdf_cmap_GBpc_EUC_H; +extern pdf_cmap pdf_cmap_GBpc_EUC_V; +extern pdf_cmap pdf_cmap_H; +extern pdf_cmap pdf_cmap_HKscs_B5_H; +extern pdf_cmap pdf_cmap_HKscs_B5_V; +extern pdf_cmap pdf_cmap_KSC_EUC_H; +extern pdf_cmap pdf_cmap_KSC_EUC_V; +extern pdf_cmap pdf_cmap_KSCms_UHC_H; +extern pdf_cmap pdf_cmap_KSCms_UHC_HW_H; +extern pdf_cmap pdf_cmap_KSCms_UHC_HW_V; +extern pdf_cmap pdf_cmap_KSCms_UHC_V; +extern pdf_cmap pdf_cmap_KSCpc_EUC_H; +extern pdf_cmap pdf_cmap_UniCNS_UCS2_H; +extern pdf_cmap pdf_cmap_UniCNS_UCS2_V; +extern pdf_cmap pdf_cmap_UniCNS_UTF16_H; +extern pdf_cmap pdf_cmap_UniCNS_UTF16_V; +extern pdf_cmap pdf_cmap_UniCNS_X; +extern pdf_cmap pdf_cmap_UniGB_UCS2_H; +extern pdf_cmap pdf_cmap_UniGB_UCS2_V; +extern pdf_cmap pdf_cmap_UniGB_UTF16_H; +extern pdf_cmap pdf_cmap_UniGB_UTF16_V; +extern pdf_cmap pdf_cmap_UniGB_X; +extern pdf_cmap pdf_cmap_UniJIS_UCS2_H; +extern pdf_cmap pdf_cmap_UniJIS_UCS2_HW_H; +extern pdf_cmap pdf_cmap_UniJIS_UCS2_HW_V; +extern pdf_cmap pdf_cmap_UniJIS_UCS2_V; +extern pdf_cmap pdf_cmap_UniJIS_UTF16_H; +extern pdf_cmap pdf_cmap_UniJIS_UTF16_V; +extern pdf_cmap pdf_cmap_UniJIS_X16; +extern pdf_cmap pdf_cmap_UniJIS_X; +extern pdf_cmap pdf_cmap_UniKS_UCS2_H; +extern pdf_cmap pdf_cmap_UniKS_UCS2_V; +extern pdf_cmap pdf_cmap_UniKS_UTF16_H; +extern pdf_cmap pdf_cmap_UniKS_UTF16_V; +extern pdf_cmap pdf_cmap_UniKS_X; +extern pdf_cmap pdf_cmap_V; struct table { const char *name; pdf_cmap *cmap; }; static const struct table table_cjk[] = { - {"83pv-RKSJ-H",&cmap_83pv_RKSJ_H}, - {"90ms-RKSJ-H",&cmap_90ms_RKSJ_H}, - {"90ms-RKSJ-V",&cmap_90ms_RKSJ_V}, - {"90msp-RKSJ-H",&cmap_90msp_RKSJ_H}, - {"90msp-RKSJ-V",&cmap_90msp_RKSJ_V}, - {"90pv-RKSJ-H",&cmap_90pv_RKSJ_H}, - {"Add-RKSJ-H",&cmap_Add_RKSJ_H}, - {"Add-RKSJ-V",&cmap_Add_RKSJ_V}, - {"Adobe-CNS1-UCS2",&cmap_Adobe_CNS1_UCS2}, - {"Adobe-GB1-UCS2",&cmap_Adobe_GB1_UCS2}, - {"Adobe-Japan1-UCS2",&cmap_Adobe_Japan1_UCS2}, - {"Adobe-Korea1-UCS2",&cmap_Adobe_Korea1_UCS2}, - {"B5pc-H",&cmap_B5pc_H}, - {"B5pc-V",&cmap_B5pc_V}, - {"CNS-EUC-H",&cmap_CNS_EUC_H}, - {"CNS-EUC-V",&cmap_CNS_EUC_V}, - {"ETen-B5-H",&cmap_ETen_B5_H}, - {"ETen-B5-V",&cmap_ETen_B5_V}, - {"ETenms-B5-H",&cmap_ETenms_B5_H}, - {"ETenms-B5-V",&cmap_ETenms_B5_V}, - {"EUC-H",&cmap_EUC_H}, - {"EUC-V",&cmap_EUC_V}, - {"Ext-RKSJ-H",&cmap_Ext_RKSJ_H}, - {"Ext-RKSJ-V",&cmap_Ext_RKSJ_V}, - {"GB-EUC-H",&cmap_GB_EUC_H}, - {"GB-EUC-V",&cmap_GB_EUC_V}, - {"GBK-EUC-H",&cmap_GBK_EUC_H}, - {"GBK-EUC-V",&cmap_GBK_EUC_V}, - {"GBK2K-H",&cmap_GBK2K_H}, - {"GBK2K-V",&cmap_GBK2K_V}, - {"GBKp-EUC-H",&cmap_GBKp_EUC_H}, - {"GBKp-EUC-V",&cmap_GBKp_EUC_V}, - {"GBpc-EUC-H",&cmap_GBpc_EUC_H}, - {"GBpc-EUC-V",&cmap_GBpc_EUC_V}, - {"H",&cmap_H}, - {"HKscs-B5-H",&cmap_HKscs_B5_H}, - {"HKscs-B5-V",&cmap_HKscs_B5_V}, - {"KSC-EUC-H",&cmap_KSC_EUC_H}, - {"KSC-EUC-V",&cmap_KSC_EUC_V}, - {"KSCms-UHC-H",&cmap_KSCms_UHC_H}, - {"KSCms-UHC-HW-H",&cmap_KSCms_UHC_HW_H}, - {"KSCms-UHC-HW-V",&cmap_KSCms_UHC_HW_V}, - {"KSCms-UHC-V",&cmap_KSCms_UHC_V}, - {"KSCpc-EUC-H",&cmap_KSCpc_EUC_H}, - {"UniCNS-UCS2-H",&cmap_UniCNS_UCS2_H}, - {"UniCNS-UCS2-V",&cmap_UniCNS_UCS2_V}, - {"UniCNS-UTF16-H",&cmap_UniCNS_UTF16_H}, - {"UniCNS-UTF16-V",&cmap_UniCNS_UTF16_V}, - {"UniCNS-X",&cmap_UniCNS_X}, - {"UniGB-UCS2-H",&cmap_UniGB_UCS2_H}, - {"UniGB-UCS2-V",&cmap_UniGB_UCS2_V}, - {"UniGB-UTF16-H",&cmap_UniGB_UTF16_H}, - {"UniGB-UTF16-V",&cmap_UniGB_UTF16_V}, - {"UniGB-X",&cmap_UniGB_X}, - {"UniJIS-UCS2-H",&cmap_UniJIS_UCS2_H}, - {"UniJIS-UCS2-HW-H",&cmap_UniJIS_UCS2_HW_H}, - {"UniJIS-UCS2-HW-V",&cmap_UniJIS_UCS2_HW_V}, - {"UniJIS-UCS2-V",&cmap_UniJIS_UCS2_V}, - {"UniJIS-UTF16-H",&cmap_UniJIS_UTF16_H}, - {"UniJIS-UTF16-V",&cmap_UniJIS_UTF16_V}, - {"UniJIS-X",&cmap_UniJIS_X}, - {"UniJIS-X16",&cmap_UniJIS_X16}, - {"UniKS-UCS2-H",&cmap_UniKS_UCS2_H}, - {"UniKS-UCS2-V",&cmap_UniKS_UCS2_V}, - {"UniKS-UTF16-H",&cmap_UniKS_UTF16_H}, - {"UniKS-UTF16-V",&cmap_UniKS_UTF16_V}, - {"UniKS-X",&cmap_UniKS_X}, - {"V",&cmap_V}, + {"83pv-RKSJ-H",&pdf_cmap_83pv_RKSJ_H}, + {"90ms-RKSJ-H",&pdf_cmap_90ms_RKSJ_H}, + {"90ms-RKSJ-V",&pdf_cmap_90ms_RKSJ_V}, + {"90msp-RKSJ-H",&pdf_cmap_90msp_RKSJ_H}, + {"90msp-RKSJ-V",&pdf_cmap_90msp_RKSJ_V}, + {"90pv-RKSJ-H",&pdf_cmap_90pv_RKSJ_H}, + {"Add-RKSJ-H",&pdf_cmap_Add_RKSJ_H}, + {"Add-RKSJ-V",&pdf_cmap_Add_RKSJ_V}, + {"Adobe-CNS1-UCS2",&pdf_cmap_Adobe_CNS1_UCS2}, + {"Adobe-GB1-UCS2",&pdf_cmap_Adobe_GB1_UCS2}, + {"Adobe-Japan1-UCS2",&pdf_cmap_Adobe_Japan1_UCS2}, + {"Adobe-Korea1-UCS2",&pdf_cmap_Adobe_Korea1_UCS2}, + {"B5pc-H",&pdf_cmap_B5pc_H}, + {"B5pc-V",&pdf_cmap_B5pc_V}, + {"CNS-EUC-H",&pdf_cmap_CNS_EUC_H}, + {"CNS-EUC-V",&pdf_cmap_CNS_EUC_V}, + {"ETen-B5-H",&pdf_cmap_ETen_B5_H}, + {"ETen-B5-V",&pdf_cmap_ETen_B5_V}, + {"ETenms-B5-H",&pdf_cmap_ETenms_B5_H}, + {"ETenms-B5-V",&pdf_cmap_ETenms_B5_V}, + {"EUC-H",&pdf_cmap_EUC_H}, + {"EUC-V",&pdf_cmap_EUC_V}, + {"Ext-RKSJ-H",&pdf_cmap_Ext_RKSJ_H}, + {"Ext-RKSJ-V",&pdf_cmap_Ext_RKSJ_V}, + {"GB-EUC-H",&pdf_cmap_GB_EUC_H}, + {"GB-EUC-V",&pdf_cmap_GB_EUC_V}, + {"GBK-EUC-H",&pdf_cmap_GBK_EUC_H}, + {"GBK-EUC-V",&pdf_cmap_GBK_EUC_V}, + {"GBK2K-H",&pdf_cmap_GBK2K_H}, + {"GBK2K-V",&pdf_cmap_GBK2K_V}, + {"GBKp-EUC-H",&pdf_cmap_GBKp_EUC_H}, + {"GBKp-EUC-V",&pdf_cmap_GBKp_EUC_V}, + {"GBpc-EUC-H",&pdf_cmap_GBpc_EUC_H}, + {"GBpc-EUC-V",&pdf_cmap_GBpc_EUC_V}, + {"H",&pdf_cmap_H}, + {"HKscs-B5-H",&pdf_cmap_HKscs_B5_H}, + {"HKscs-B5-V",&pdf_cmap_HKscs_B5_V}, + {"KSC-EUC-H",&pdf_cmap_KSC_EUC_H}, + {"KSC-EUC-V",&pdf_cmap_KSC_EUC_V}, + {"KSCms-UHC-H",&pdf_cmap_KSCms_UHC_H}, + {"KSCms-UHC-HW-H",&pdf_cmap_KSCms_UHC_HW_H}, + {"KSCms-UHC-HW-V",&pdf_cmap_KSCms_UHC_HW_V}, + {"KSCms-UHC-V",&pdf_cmap_KSCms_UHC_V}, + {"KSCpc-EUC-H",&pdf_cmap_KSCpc_EUC_H}, + {"UniCNS-UCS2-H",&pdf_cmap_UniCNS_UCS2_H}, + {"UniCNS-UCS2-V",&pdf_cmap_UniCNS_UCS2_V}, + {"UniCNS-UTF16-H",&pdf_cmap_UniCNS_UTF16_H}, + {"UniCNS-UTF16-V",&pdf_cmap_UniCNS_UTF16_V}, + {"UniCNS-X",&pdf_cmap_UniCNS_X}, + {"UniGB-UCS2-H",&pdf_cmap_UniGB_UCS2_H}, + {"UniGB-UCS2-V",&pdf_cmap_UniGB_UCS2_V}, + {"UniGB-UTF16-H",&pdf_cmap_UniGB_UTF16_H}, + {"UniGB-UTF16-V",&pdf_cmap_UniGB_UTF16_V}, + {"UniGB-X",&pdf_cmap_UniGB_X}, + {"UniJIS-UCS2-H",&pdf_cmap_UniJIS_UCS2_H}, + {"UniJIS-UCS2-HW-H",&pdf_cmap_UniJIS_UCS2_HW_H}, + {"UniJIS-UCS2-HW-V",&pdf_cmap_UniJIS_UCS2_HW_V}, + {"UniJIS-UCS2-V",&pdf_cmap_UniJIS_UCS2_V}, + {"UniJIS-UTF16-H",&pdf_cmap_UniJIS_UTF16_H}, + {"UniJIS-UTF16-V",&pdf_cmap_UniJIS_UTF16_V}, + {"UniJIS-X",&pdf_cmap_UniJIS_X}, + {"UniJIS-X16",&pdf_cmap_UniJIS_X16}, + {"UniKS-UCS2-H",&pdf_cmap_UniKS_UCS2_H}, + {"UniKS-UCS2-V",&pdf_cmap_UniKS_UCS2_V}, + {"UniKS-UTF16-H",&pdf_cmap_UniKS_UTF16_H}, + {"UniKS-UTF16-V",&pdf_cmap_UniKS_UTF16_V}, + {"UniKS-X",&pdf_cmap_UniKS_X}, + {"V",&pdf_cmap_V}, }; #if EXTRA_CMAPS -#include "gen_cmap_extra.h" + +extern pdf_cmap pdf_cmap_78_EUC_H; +extern pdf_cmap pdf_cmap_78_EUC_V; +extern pdf_cmap pdf_cmap_78_H; +extern pdf_cmap pdf_cmap_78_RKSJ_H; +extern pdf_cmap pdf_cmap_78_RKSJ_V; +extern pdf_cmap pdf_cmap_78_V; +extern pdf_cmap pdf_cmap_78ms_RKSJ_H; +extern pdf_cmap pdf_cmap_78ms_RKSJ_V; +extern pdf_cmap pdf_cmap_90pv_RKSJ_V; +extern pdf_cmap pdf_cmap_Add_H; +extern pdf_cmap pdf_cmap_Add_V; +extern pdf_cmap pdf_cmap_Adobe_CNS1_0; +extern pdf_cmap pdf_cmap_Adobe_CNS1_1; +extern pdf_cmap pdf_cmap_Adobe_CNS1_2; +extern pdf_cmap pdf_cmap_Adobe_CNS1_3; +extern pdf_cmap pdf_cmap_Adobe_CNS1_4; +extern pdf_cmap pdf_cmap_Adobe_CNS1_5; +extern pdf_cmap pdf_cmap_Adobe_CNS1_6; +extern pdf_cmap pdf_cmap_Adobe_GB1_0; +extern pdf_cmap pdf_cmap_Adobe_GB1_1; +extern pdf_cmap pdf_cmap_Adobe_GB1_2; +extern pdf_cmap pdf_cmap_Adobe_GB1_3; +extern pdf_cmap pdf_cmap_Adobe_GB1_4; +extern pdf_cmap pdf_cmap_Adobe_GB1_5; +extern pdf_cmap pdf_cmap_Adobe_Japan1_0; +extern pdf_cmap pdf_cmap_Adobe_Japan1_1; +extern pdf_cmap pdf_cmap_Adobe_Japan1_2; +extern pdf_cmap pdf_cmap_Adobe_Japan1_3; +extern pdf_cmap pdf_cmap_Adobe_Japan1_4; +extern pdf_cmap pdf_cmap_Adobe_Japan1_5; +extern pdf_cmap pdf_cmap_Adobe_Japan1_6; +extern pdf_cmap pdf_cmap_Adobe_Korea1_0; +extern pdf_cmap pdf_cmap_Adobe_Korea1_1; +extern pdf_cmap pdf_cmap_Adobe_Korea1_2; +extern pdf_cmap pdf_cmap_B5_H; +extern pdf_cmap pdf_cmap_B5_V; +extern pdf_cmap pdf_cmap_CNS1_H; +extern pdf_cmap pdf_cmap_CNS1_V; +extern pdf_cmap pdf_cmap_CNS2_H; +extern pdf_cmap pdf_cmap_CNS2_V; +extern pdf_cmap pdf_cmap_ETHK_B5_H; +extern pdf_cmap pdf_cmap_ETHK_B5_V; +extern pdf_cmap pdf_cmap_Ext_H; +extern pdf_cmap pdf_cmap_Ext_V; +extern pdf_cmap pdf_cmap_GBT_EUC_H; +extern pdf_cmap pdf_cmap_GBT_EUC_V; +extern pdf_cmap pdf_cmap_GBT_H; +extern pdf_cmap pdf_cmap_GBT_V; +extern pdf_cmap pdf_cmap_GBTpc_EUC_H; +extern pdf_cmap pdf_cmap_GBTpc_EUC_V; +extern pdf_cmap pdf_cmap_GB_H; +extern pdf_cmap pdf_cmap_GB_V; +extern pdf_cmap pdf_cmap_HKdla_B5_H; +extern pdf_cmap pdf_cmap_HKdla_B5_V; +extern pdf_cmap pdf_cmap_HKdlb_B5_H; +extern pdf_cmap pdf_cmap_HKdlb_B5_V; +extern pdf_cmap pdf_cmap_HKgccs_B5_H; +extern pdf_cmap pdf_cmap_HKgccs_B5_V; +extern pdf_cmap pdf_cmap_HKm314_B5_H; +extern pdf_cmap pdf_cmap_HKm314_B5_V; +extern pdf_cmap pdf_cmap_HKm471_B5_H; +extern pdf_cmap pdf_cmap_HKm471_B5_V; +extern pdf_cmap pdf_cmap_Hankaku; +extern pdf_cmap pdf_cmap_Hiragana; +extern pdf_cmap pdf_cmap_KSC_H; +extern pdf_cmap pdf_cmap_KSC_Johab_H; +extern pdf_cmap pdf_cmap_KSC_Johab_V; +extern pdf_cmap pdf_cmap_KSC_V; +extern pdf_cmap pdf_cmap_KSCpc_EUC_V; +extern pdf_cmap pdf_cmap_Katakana; +extern pdf_cmap pdf_cmap_NWP_H; +extern pdf_cmap pdf_cmap_NWP_V; +extern pdf_cmap pdf_cmap_RKSJ_H; +extern pdf_cmap pdf_cmap_RKSJ_V; +extern pdf_cmap pdf_cmap_Roman; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF16_H; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF16_V; +extern pdf_cmap pdf_cmap_UniJISPro_UCS2_HW_V; +extern pdf_cmap pdf_cmap_UniJISPro_UCS2_V; +extern pdf_cmap pdf_cmap_WP_Symbol; + static const struct table table_extra[] = { - {"78-EUC-H",&cmap_78_EUC_H}, - {"78-EUC-V",&cmap_78_EUC_V}, - {"78-H",&cmap_78_H}, - {"78-RKSJ-H",&cmap_78_RKSJ_H}, - {"78-RKSJ-V",&cmap_78_RKSJ_V}, - {"78-V",&cmap_78_V}, - {"78ms-RKSJ-H",&cmap_78ms_RKSJ_H}, - {"78ms-RKSJ-V",&cmap_78ms_RKSJ_V}, - {"90pv-RKSJ-V",&cmap_90pv_RKSJ_V}, - {"Add-H",&cmap_Add_H}, - {"Add-V",&cmap_Add_V}, - {"Adobe-CNS1-0",&cmap_Adobe_CNS1_0}, - {"Adobe-CNS1-1",&cmap_Adobe_CNS1_1}, - {"Adobe-CNS1-2",&cmap_Adobe_CNS1_2}, - {"Adobe-CNS1-3",&cmap_Adobe_CNS1_3}, - {"Adobe-CNS1-4",&cmap_Adobe_CNS1_4}, - {"Adobe-CNS1-5",&cmap_Adobe_CNS1_5}, - {"Adobe-CNS1-6",&cmap_Adobe_CNS1_6}, - {"Adobe-GB1-0",&cmap_Adobe_GB1_0}, - {"Adobe-GB1-1",&cmap_Adobe_GB1_1}, - {"Adobe-GB1-2",&cmap_Adobe_GB1_2}, - {"Adobe-GB1-3",&cmap_Adobe_GB1_3}, - {"Adobe-GB1-4",&cmap_Adobe_GB1_4}, - {"Adobe-GB1-5",&cmap_Adobe_GB1_5}, - {"Adobe-Japan1-0",&cmap_Adobe_Japan1_0}, - {"Adobe-Japan1-1",&cmap_Adobe_Japan1_1}, - {"Adobe-Japan1-2",&cmap_Adobe_Japan1_2}, - {"Adobe-Japan1-3",&cmap_Adobe_Japan1_3}, - {"Adobe-Japan1-4",&cmap_Adobe_Japan1_4}, - {"Adobe-Japan1-5",&cmap_Adobe_Japan1_5}, - {"Adobe-Japan1-6",&cmap_Adobe_Japan1_6}, - {"Adobe-Korea1-0",&cmap_Adobe_Korea1_0}, - {"Adobe-Korea1-1",&cmap_Adobe_Korea1_1}, - {"Adobe-Korea1-2",&cmap_Adobe_Korea1_2}, - {"B5-H",&cmap_B5_H}, - {"B5-V",&cmap_B5_V}, - {"CNS1-H",&cmap_CNS1_H}, - {"CNS1-V",&cmap_CNS1_V}, - {"CNS2-H",&cmap_CNS2_H}, - {"CNS2-V",&cmap_CNS2_V}, - {"ETHK-B5-H",&cmap_ETHK_B5_H}, - {"ETHK-B5-V",&cmap_ETHK_B5_V}, - {"Ext-H",&cmap_Ext_H}, - {"Ext-V",&cmap_Ext_V}, - {"GB-H",&cmap_GB_H}, - {"GB-V",&cmap_GB_V}, - {"GBT-EUC-H",&cmap_GBT_EUC_H}, - {"GBT-EUC-V",&cmap_GBT_EUC_V}, - {"GBT-H",&cmap_GBT_H}, - {"GBT-V",&cmap_GBT_V}, - {"GBTpc-EUC-H",&cmap_GBTpc_EUC_H}, - {"GBTpc-EUC-V",&cmap_GBTpc_EUC_V}, - {"HKdla-B5-H",&cmap_HKdla_B5_H}, - {"HKdla-B5-V",&cmap_HKdla_B5_V}, - {"HKdlb-B5-H",&cmap_HKdlb_B5_H}, - {"HKdlb-B5-V",&cmap_HKdlb_B5_V}, - {"HKgccs-B5-H",&cmap_HKgccs_B5_H}, - {"HKgccs-B5-V",&cmap_HKgccs_B5_V}, - {"HKm314-B5-H",&cmap_HKm314_B5_H}, - {"HKm314-B5-V",&cmap_HKm314_B5_V}, - {"HKm471-B5-H",&cmap_HKm471_B5_H}, - {"HKm471-B5-V",&cmap_HKm471_B5_V}, - {"Hankaku",&cmap_Hankaku}, - {"Hiragana",&cmap_Hiragana}, - {"KSC-H",&cmap_KSC_H}, - {"KSC-Johab-H",&cmap_KSC_Johab_H}, - {"KSC-Johab-V",&cmap_KSC_Johab_V}, - {"KSC-V",&cmap_KSC_V}, - {"KSCpc-EUC-V",&cmap_KSCpc_EUC_V}, - {"Katakana",&cmap_Katakana}, - {"NWP-H",&cmap_NWP_H}, - {"NWP-V",&cmap_NWP_V}, - {"RKSJ-H",&cmap_RKSJ_H}, - {"RKSJ-V",&cmap_RKSJ_V}, - {"Roman",&cmap_Roman}, - {"UniJIS2004-UTF16-H",&cmap_UniJIS2004_UTF16_H}, - {"UniJIS2004-UTF16-V",&cmap_UniJIS2004_UTF16_V}, - {"UniJISPro-UCS2-HW-V",&cmap_UniJISPro_UCS2_HW_V}, - {"UniJISPro-UCS2-V",&cmap_UniJISPro_UCS2_V}, - {"WP-Symbol",&cmap_WP_Symbol}, + {"78-EUC-H",&pdf_cmap_78_EUC_H}, + {"78-EUC-V",&pdf_cmap_78_EUC_V}, + {"78-H",&pdf_cmap_78_H}, + {"78-RKSJ-H",&pdf_cmap_78_RKSJ_H}, + {"78-RKSJ-V",&pdf_cmap_78_RKSJ_V}, + {"78-V",&pdf_cmap_78_V}, + {"78ms-RKSJ-H",&pdf_cmap_78ms_RKSJ_H}, + {"78ms-RKSJ-V",&pdf_cmap_78ms_RKSJ_V}, + {"90pv-RKSJ-V",&pdf_cmap_90pv_RKSJ_V}, + {"Add-H",&pdf_cmap_Add_H}, + {"Add-V",&pdf_cmap_Add_V}, + {"Adobe-CNS1-0",&pdf_cmap_Adobe_CNS1_0}, + {"Adobe-CNS1-1",&pdf_cmap_Adobe_CNS1_1}, + {"Adobe-CNS1-2",&pdf_cmap_Adobe_CNS1_2}, + {"Adobe-CNS1-3",&pdf_cmap_Adobe_CNS1_3}, + {"Adobe-CNS1-4",&pdf_cmap_Adobe_CNS1_4}, + {"Adobe-CNS1-5",&pdf_cmap_Adobe_CNS1_5}, + {"Adobe-CNS1-6",&pdf_cmap_Adobe_CNS1_6}, + {"Adobe-GB1-0",&pdf_cmap_Adobe_GB1_0}, + {"Adobe-GB1-1",&pdf_cmap_Adobe_GB1_1}, + {"Adobe-GB1-2",&pdf_cmap_Adobe_GB1_2}, + {"Adobe-GB1-3",&pdf_cmap_Adobe_GB1_3}, + {"Adobe-GB1-4",&pdf_cmap_Adobe_GB1_4}, + {"Adobe-GB1-5",&pdf_cmap_Adobe_GB1_5}, + {"Adobe-Japan1-0",&pdf_cmap_Adobe_Japan1_0}, + {"Adobe-Japan1-1",&pdf_cmap_Adobe_Japan1_1}, + {"Adobe-Japan1-2",&pdf_cmap_Adobe_Japan1_2}, + {"Adobe-Japan1-3",&pdf_cmap_Adobe_Japan1_3}, + {"Adobe-Japan1-4",&pdf_cmap_Adobe_Japan1_4}, + {"Adobe-Japan1-5",&pdf_cmap_Adobe_Japan1_5}, + {"Adobe-Japan1-6",&pdf_cmap_Adobe_Japan1_6}, + {"Adobe-Korea1-0",&pdf_cmap_Adobe_Korea1_0}, + {"Adobe-Korea1-1",&pdf_cmap_Adobe_Korea1_1}, + {"Adobe-Korea1-2",&pdf_cmap_Adobe_Korea1_2}, + {"B5-H",&pdf_cmap_B5_H}, + {"B5-V",&pdf_cmap_B5_V}, + {"CNS1-H",&pdf_cmap_CNS1_H}, + {"CNS1-V",&pdf_cmap_CNS1_V}, + {"CNS2-H",&pdf_cmap_CNS2_H}, + {"CNS2-V",&pdf_cmap_CNS2_V}, + {"ETHK-B5-H",&pdf_cmap_ETHK_B5_H}, + {"ETHK-B5-V",&pdf_cmap_ETHK_B5_V}, + {"Ext-H",&pdf_cmap_Ext_H}, + {"Ext-V",&pdf_cmap_Ext_V}, + {"GB-H",&pdf_cmap_GB_H}, + {"GB-V",&pdf_cmap_GB_V}, + {"GBT-EUC-H",&pdf_cmap_GBT_EUC_H}, + {"GBT-EUC-V",&pdf_cmap_GBT_EUC_V}, + {"GBT-H",&pdf_cmap_GBT_H}, + {"GBT-V",&pdf_cmap_GBT_V}, + {"GBTpc-EUC-H",&pdf_cmap_GBTpc_EUC_H}, + {"GBTpc-EUC-V",&pdf_cmap_GBTpc_EUC_V}, + {"HKdla-B5-H",&pdf_cmap_HKdla_B5_H}, + {"HKdla-B5-V",&pdf_cmap_HKdla_B5_V}, + {"HKdlb-B5-H",&pdf_cmap_HKdlb_B5_H}, + {"HKdlb-B5-V",&pdf_cmap_HKdlb_B5_V}, + {"HKgccs-B5-H",&pdf_cmap_HKgccs_B5_H}, + {"HKgccs-B5-V",&pdf_cmap_HKgccs_B5_V}, + {"HKm314-B5-H",&pdf_cmap_HKm314_B5_H}, + {"HKm314-B5-V",&pdf_cmap_HKm314_B5_V}, + {"HKm471-B5-H",&pdf_cmap_HKm471_B5_H}, + {"HKm471-B5-V",&pdf_cmap_HKm471_B5_V}, + {"Hankaku",&pdf_cmap_Hankaku}, + {"Hiragana",&pdf_cmap_Hiragana}, + {"KSC-H",&pdf_cmap_KSC_H}, + {"KSC-Johab-H",&pdf_cmap_KSC_Johab_H}, + {"KSC-Johab-V",&pdf_cmap_KSC_Johab_V}, + {"KSC-V",&pdf_cmap_KSC_V}, + {"KSCpc-EUC-V",&pdf_cmap_KSCpc_EUC_V}, + {"Katakana",&pdf_cmap_Katakana}, + {"NWP-H",&pdf_cmap_NWP_H}, + {"NWP-V",&pdf_cmap_NWP_V}, + {"RKSJ-H",&pdf_cmap_RKSJ_H}, + {"RKSJ-V",&pdf_cmap_RKSJ_V}, + {"Roman",&pdf_cmap_Roman}, + {"UniJIS2004-UTF16-H",&pdf_cmap_UniJIS2004_UTF16_H}, + {"UniJIS2004-UTF16-V",&pdf_cmap_UniJIS2004_UTF16_V}, + {"UniJISPro-UCS2-HW-V",&pdf_cmap_UniJISPro_UCS2_HW_V}, + {"UniJISPro-UCS2-V",&pdf_cmap_UniJISPro_UCS2_V}, + {"WP-Symbol",&pdf_cmap_WP_Symbol}, }; #endif #if UTF8_CMAPS -#include "gen_cmap_utf8.h" + +extern pdf_cmap pdf_cmap_UniCNS_UTF8_H; +extern pdf_cmap pdf_cmap_UniCNS_UTF8_V; +extern pdf_cmap pdf_cmap_UniGB_UTF8_H; +extern pdf_cmap pdf_cmap_UniGB_UTF8_V; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF8_H; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF8_V; +extern pdf_cmap pdf_cmap_UniJISPro_UTF8_V; +extern pdf_cmap pdf_cmap_UniJIS_UTF8_H; +extern pdf_cmap pdf_cmap_UniJIS_UTF8_V; +extern pdf_cmap pdf_cmap_UniJIS_X8; +extern pdf_cmap pdf_cmap_UniKS_UTF8_H; +extern pdf_cmap pdf_cmap_UniKS_UTF8_V; + static const struct table table_utf8[] = { - {"UniCNS-UTF8-H",&cmap_UniCNS_UTF8_H}, - {"UniCNS-UTF8-V",&cmap_UniCNS_UTF8_V}, - {"UniGB-UTF8-H",&cmap_UniGB_UTF8_H}, - {"UniGB-UTF8-V",&cmap_UniGB_UTF8_V}, - {"UniJIS-UTF8-H",&cmap_UniJIS_UTF8_H}, - {"UniJIS-UTF8-V",&cmap_UniJIS_UTF8_V}, - {"UniJIS-X8",&cmap_UniJIS_X8}, - {"UniJIS2004-UTF8-H",&cmap_UniJIS2004_UTF8_H}, - {"UniJIS2004-UTF8-V",&cmap_UniJIS2004_UTF8_V}, - {"UniJISPro-UTF8-V",&cmap_UniJISPro_UTF8_V}, - {"UniKS-UTF8-H",&cmap_UniKS_UTF8_H}, - {"UniKS-UTF8-V",&cmap_UniKS_UTF8_V}, + {"UniCNS-UTF8-H",&pdf_cmap_UniCNS_UTF8_H}, + {"UniCNS-UTF8-V",&pdf_cmap_UniCNS_UTF8_V}, + {"UniGB-UTF8-H",&pdf_cmap_UniGB_UTF8_H}, + {"UniGB-UTF8-V",&pdf_cmap_UniGB_UTF8_V}, + {"UniJIS-UTF8-H",&pdf_cmap_UniJIS_UTF8_H}, + {"UniJIS-UTF8-V",&pdf_cmap_UniJIS_UTF8_V}, + {"UniJIS-X8",&pdf_cmap_UniJIS_X8}, + {"UniJIS2004-UTF8-H",&pdf_cmap_UniJIS2004_UTF8_H}, + {"UniJIS2004-UTF8-V",&pdf_cmap_UniJIS2004_UTF8_V}, + {"UniJISPro-UTF8-V",&pdf_cmap_UniJISPro_UTF8_V}, + {"UniKS-UTF8-H",&pdf_cmap_UniKS_UTF8_H}, + {"UniKS-UTF8-V",&pdf_cmap_UniKS_UTF8_V}, }; #endif #if UTF32_CMAPS -#include "gen_cmap_utf32.h" + +extern pdf_cmap pdf_cmap_UniCNS_UTF32_H; +extern pdf_cmap pdf_cmap_UniCNS_UTF32_V; +extern pdf_cmap pdf_cmap_UniGB_UTF32_H; +extern pdf_cmap pdf_cmap_UniGB_UTF32_V; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF32_H; +extern pdf_cmap pdf_cmap_UniJIS2004_UTF32_V; +extern pdf_cmap pdf_cmap_UniJISX02132004_UTF32_H; +extern pdf_cmap pdf_cmap_UniJISX02132004_UTF32_V; +extern pdf_cmap pdf_cmap_UniJISX0213_UTF32_H; +extern pdf_cmap pdf_cmap_UniJISX0213_UTF32_V; +extern pdf_cmap pdf_cmap_UniJIS_UTF32_H; +extern pdf_cmap pdf_cmap_UniJIS_UTF32_V; +extern pdf_cmap pdf_cmap_UniJIS_X32; +extern pdf_cmap pdf_cmap_UniKS_UTF32_H; +extern pdf_cmap pdf_cmap_UniKS_UTF32_V; + static const struct table table_utf32[] = { - {"UniCNS-UTF32-H",&cmap_UniCNS_UTF32_H}, - {"UniCNS-UTF32-V",&cmap_UniCNS_UTF32_V}, - {"UniGB-UTF32-H",&cmap_UniGB_UTF32_H}, - {"UniGB-UTF32-V",&cmap_UniGB_UTF32_V}, - {"UniJIS-UTF32-H",&cmap_UniJIS_UTF32_H}, - {"UniJIS-UTF32-V",&cmap_UniJIS_UTF32_V}, - {"UniJIS-X32",&cmap_UniJIS_X32}, - {"UniJIS2004-UTF32-H",&cmap_UniJIS2004_UTF32_H}, - {"UniJIS2004-UTF32-V",&cmap_UniJIS2004_UTF32_V}, - {"UniJISX0213-UTF32-H",&cmap_UniJISX0213_UTF32_H}, - {"UniJISX0213-UTF32-V",&cmap_UniJISX0213_UTF32_V}, - {"UniJISX02132004-UTF32-H",&cmap_UniJISX02132004_UTF32_H}, - {"UniJISX02132004-UTF32-V",&cmap_UniJISX02132004_UTF32_V}, - {"UniKS-UTF32-H",&cmap_UniKS_UTF32_H}, - {"UniKS-UTF32-V",&cmap_UniKS_UTF32_V}, + {"UniCNS-UTF32-H",&pdf_cmap_UniCNS_UTF32_H}, + {"UniCNS-UTF32-V",&pdf_cmap_UniCNS_UTF32_V}, + {"UniGB-UTF32-H",&pdf_cmap_UniGB_UTF32_H}, + {"UniGB-UTF32-V",&pdf_cmap_UniGB_UTF32_V}, + {"UniJIS-UTF32-H",&pdf_cmap_UniJIS_UTF32_H}, + {"UniJIS-UTF32-V",&pdf_cmap_UniJIS_UTF32_V}, + {"UniJIS-X32",&pdf_cmap_UniJIS_X32}, + {"UniJIS2004-UTF32-H",&pdf_cmap_UniJIS2004_UTF32_H}, + {"UniJIS2004-UTF32-V",&pdf_cmap_UniJIS2004_UTF32_V}, + {"UniJISX0213-UTF32-H",&pdf_cmap_UniJISX0213_UTF32_H}, + {"UniJISX0213-UTF32-V",&pdf_cmap_UniJISX0213_UTF32_V}, + {"UniJISX02132004-UTF32-H",&pdf_cmap_UniJISX02132004_UTF32_H}, + {"UniJISX02132004-UTF32-V",&pdf_cmap_UniJISX02132004_UTF32_V}, + {"UniKS-UTF32-H",&pdf_cmap_UniKS_UTF32_H}, + {"UniKS-UTF32-V",&pdf_cmap_UniKS_UTF32_V}, }; #endif diff --git a/source/pdf/pdf-js.c b/source/pdf/pdf-js.c index bca92780..63892d98 100644 --- a/source/pdf/pdf-js.c +++ b/source/pdf/pdf-js.c @@ -549,7 +549,7 @@ static void declare_dom(pdf_js *js) js_setglobal(J, "MuPDF_Doc"); /* for pdf-util.js use */ } -#include "gen_js_util.h" +extern const char fz_source_pdf_pdf_js_util_js[]; static void preload_helpers(pdf_js *js) { 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; |