workaround clang-14 bug
[LibreOffice.git] / external / poppler / disable-nss-and-gpgmepp.patch.1
blob1fc9ede6035c030fa5cc8fc09d6b3279df19a22b
1 disable NSS/GPGMEPP dependent code.
3 --- poppler/poppler/Form.cc.orig        2023-06-05 19:29:14.000000000 +0900
4 +++ poppler/poppler/Form.cc     2023-06-17 16:51:27.873431500 +0900
5 @@ -64,7 +64,7 @@
6  #include "Form.h"
7  #include "PDFDoc.h"
8  #include "DateInfo.h"
9 -#include "CryptoSignBackend.h"
10 +/*#include "CryptoSignBackend.h"*/
11  #include "SignatureInfo.h"
12  #include "CertificateInfo.h"
13  #include "XRef.h"
14 @@ -584,7 +584,7 @@
15  {
16      return static_cast<FormFieldSignature *>(field)->validateSignatureResult();
17  }
19 +#if 0
20  // update hash with the specified range of data from the file
21  static bool hashFileRange(FILE *f, CryptoSign::SigningInterface *handler, Goffset start, Goffset end)
22  {
23 @@ -608,10 +608,12 @@
24      delete[] buf;
25      return true;
26  }
27 +#endif
29  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,
30                                         const std::optional<GooString> &userPassword)
31  {
32 +#if 0
33      auto backend = CryptoSign::Factory::createActive();
34      if (!backend) {
35          return false;
36 @@ -697,8 +699,8 @@
37      signatureField->setSignature(*signature);
39      fclose(file);
41 -    return true;
42 +#endif
43 +    return false;
44  }
46  static std::tuple<double, double> calculateDxDy(int rot, const PDFRectangle *rect)
47 @@ -2355,6 +2357,7 @@
49  void FormFieldSignature::hashSignedDataBlock(CryptoSign::VerificationInterface *handler, Goffset block_len)
50  {
51 +#if 0
52      if (!handler) {
53          return;
54      }
55 @@ -2374,6 +2377,7 @@
56              i += BLOCK_SIZE;
57          }
58      }
59 +#endif
60  }
62  FormSignatureType FormWidgetSignature::signatureType() const
63 @@ -2395,6 +2399,7 @@
65  SignatureInfo *FormFieldSignature::validateSignatureAsync(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA, const std::function<void()> &doneCallback)
66  {
67 +#if 0
68      auto backend = CryptoSign::Factory::createActive();
69      if (!backend) {
70          if (doneCallback) {
71 @@ -2497,6 +2502,7 @@
73      signature_handler->validateCertificateAsync(std::chrono::system_clock::from_time_t(validationTime), ocspRevocationCheck, enableAIA, doneCallback);
75 +#endif
76      return signature_info;
77  }
79 @@ -2508,10 +2508,13 @@
81  CertificateValidationStatus FormFieldSignature::validateSignatureResult()
82  {
83 +#if 0
84      if (!signature_handler) {
85          return CERTIFICATE_GENERIC_ERROR;
86      }
87      return signature_handler->validateCertificateResult();
88 +#endif
89 +    return CERTIFICATE_GENERIC_ERROR;
90  }
92  std::vector<Goffset> FormFieldSignature::getSignedRangeBounds() const
94 --- poppler/poppler/Form.h      2024-05-13 10:18:04.303912457 +0200
95 +++ poppler/poppler/Form.h      2024-05-13 11:41:51.547002511 +0200
96 @@ -669,7 +669,6 @@
97      double customAppearanceLeftFontSize = 20;
98      Ref imageResource = Ref::INVALID();
99      std::unique_ptr<X509CertificateInfo> certificate_info;
100 -    std::unique_ptr<CryptoSign::VerificationInterface> signature_handler;
102      void print(int indent) override;
103  };