Avoid potential negative array index access to cached text.
[LibreOffice.git] / external / poppler / disable-nss-and-gpgmepp.patch.1
blob01b442f53a1c8dcd5c63426fbfeb8eea75a43ec1
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 @@ -577,7 +577,7 @@
15  {
16      return static_cast<FormFieldSignature *>(field)->validateSignature(doVerifyCert, forceRevalidation, validationTime, ocspRevocationCheck, enableAIA);
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 @@ -607,10 +607,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 @@ -698,6 +700,8 @@
37      fclose(file);
39      return true;
40 +#endif
41 +    return false;
42  }
44  bool FormWidgetSignature::signDocumentWithAppearance(const std::string &saveFilename, const std::string &certNickname, const std::string &password, const GooString *reason, const GooString *location,
45 @@ -2316,6 +2320,7 @@
47  void FormFieldSignature::hashSignedDataBlock(CryptoSign::VerificationInterface *handler, Goffset block_len)
48  {
49 +#if 0
50      if (!handler) {
51          return;
52      }
53 @@ -2335,6 +2340,7 @@
54              i += BLOCK_SIZE;
55          }
56      }
57 +#endif
58  }
60  FormSignatureType FormWidgetSignature::signatureType() const
61 @@ -2349,6 +2355,7 @@
63  SignatureInfo *FormFieldSignature::validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime, bool ocspRevocationCheck, bool enableAIA)
64  {
65 +#if 0
66      auto backend = CryptoSign::Factory::createActive();
67      if (!backend) {
68          return signature_info;
69 @@ -2425,6 +2432,7 @@
70      const CertificateValidationStatus cert_val_state = signature_handler->validateCertificate(std::chrono::system_clock::from_time_t(validationTime), ocspRevocationCheck, enableAIA);
71      signature_info->setCertificateValStatus(cert_val_state);
73 +#endif
74      return signature_info;
75  }