summaryrefslogtreecommitdiff
path: root/external/poppler/disable-nss-and-gpgmepp.patch.1
blob: 1fc9ede6035c030fa5cc8fc09d6b3279df19a22b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
disable NSS/GPGMEPP dependent code.

--- poppler/poppler/Form.cc.orig	2023-06-05 19:29:14.000000000 +0900
+++ poppler/poppler/Form.cc	2023-06-17 16:51:27.873431500 +0900
@@ -64,7 +64,7 @@
 #include "Form.h"
 #include "PDFDoc.h"
 #include "DateInfo.h"
-#include "CryptoSignBackend.h"
+/*#include "CryptoSignBackend.h"*/
 #include "SignatureInfo.h"
 #include "CertificateInfo.h"
 #include "XRef.h"
@@ -584,7 +584,7 @@
 {
     return static_cast<FormFieldSignature *>(field)->validateSignatureResult();
 }
-
+#if 0
 // update hash with the specified range of data from the file
 static bool hashFileRange(FILE *f, CryptoSign::SigningInterface *handler, Goffset start, Goffset end)
 {
@@ -608,10 +608,12 @@
     delete[] buf;
     return true;
 }
+#endif

 bool FormWidgetSignature::signDocument(const std::string &saveFilename, const std::string &certNickname, const std::string &password, const GooString *reason, const GooString *location, const std::optional<GooString> &ownerPassword,
                                        const std::optional<GooString> &userPassword)
 {
+#if 0
     auto backend = CryptoSign::Factory::createActive();
     if (!backend) {
         return false;
@@ -697,8 +699,8 @@
     signatureField->setSignature(*signature);

     fclose(file);
-
-    return true;
+#endif
+    return false;
 }

 static std::tuple<double, double> calculateDxDy(int rot, const PDFRectangle *rect)
@@ -2355,6 +2357,7 @@

 void FormFieldSignature::hashSignedDataBlock(CryptoSign::VerificationInterface *handler, Goffset block_len)
 {
+#if 0
     if (!handler) {
         return;
     }
@@ -2374,6 +2377,7 @@
             i += BLOCK_SIZE;
         }
     }
+#endif
 }

 FormSignatureType FormWidgetSignature::signatureType() const
@@ -2395,6 +2399,7 @@
 
 SignatureInfo *FormFieldSignature::validateSignatureAsync(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA, const std::function<void()> &doneCallback)
 {
+#if 0
     auto backend = CryptoSign::Factory::createActive();
     if (!backend) {
         if (doneCallback) {
@@ -2497,6 +2502,7 @@
 
     signature_handler->validateCertificateAsync(std::chrono::system_clock::from_time_t(validationTime), ocspRevocationCheck, enableAIA, doneCallback);
 
+#endif
     return signature_info;
 }

@@ -2508,10 +2508,13 @@
 
 CertificateValidationStatus FormFieldSignature::validateSignatureResult()
 {
+#if 0
     if (!signature_handler) {
         return CERTIFICATE_GENERIC_ERROR;
     }
     return signature_handler->validateCertificateResult();
+#endif
+    return CERTIFICATE_GENERIC_ERROR;
 }
 
 std::vector<Goffset> FormFieldSignature::getSignedRangeBounds() const

--- poppler/poppler/Form.h	2024-05-13 10:18:04.303912457 +0200
+++ poppler/poppler/Form.h	2024-05-13 11:41:51.547002511 +0200
@@ -669,7 +669,6 @@
     double customAppearanceLeftFontSize = 20;
     Ref imageResource = Ref::INVALID();
     std::unique_ptr<X509CertificateInfo> certificate_info;
-    std::unique_ptr<CryptoSign::VerificationInterface> signature_handler;
 
     void print(int indent) override;
 };