[poppler] poppler/SignatureHandler.cc poppler/SignatureHandler.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 16 09:30:50 UTC 2023


 poppler/SignatureHandler.cc |   10 +++++++---
 poppler/SignatureHandler.h  |    3 ---
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit fc802d21df3c70f721c0353ab8862a4632c8018e
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Thu Mar 16 09:54:54 2023 +0100

    Make standalone methods standalone
    
    In previous commits, these functions has been made fully standalone, so
    now make it obvious.

diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc
index 231a8c01..51c532c6 100644
--- a/poppler/SignatureHandler.cc
+++ b/poppler/SignatureHandler.cc
@@ -197,6 +197,10 @@ const SEC_ASN1Template TimeStampReq_Template[] = { { SEC_ASN1_SEQUENCE, 0, nullp
                                                    { 0, 0, nullptr, 0 } };
 */
 
+static NSSCMSMessage *CMS_MessageCreate(SECItem *cms_item);
+static NSSCMSSignedData *CMS_SignedDataCreate(NSSCMSMessage *cms_msg);
+static NSSCMSSignerInfo *CMS_SignerInfoCreate(NSSCMSSignedData *cms_sig_data);
+
 // a dummy, actually
 static char *passwordCallback(PK11SlotInfo * /*slot*/, PRBool /*retry*/, void *arg)
 {
@@ -856,7 +860,7 @@ SignatureHandler::~SignatureHandler()
     }
 }
 
-NSSCMSMessage *SignatureHandler::CMS_MessageCreate(SECItem *cms_item)
+static NSSCMSMessage *CMS_MessageCreate(SECItem *cms_item)
 {
     if (cms_item->data) {
         return NSS_CMSMessage_CreateFromDER(cms_item, nullptr, nullptr /* Content callback */
@@ -869,7 +873,7 @@ NSSCMSMessage *SignatureHandler::CMS_MessageCreate(SECItem *cms_item)
     }
 }
 
-NSSCMSSignedData *SignatureHandler::CMS_SignedDataCreate(NSSCMSMessage *cms_msg)
+static NSSCMSSignedData *CMS_SignedDataCreate(NSSCMSMessage *cms_msg)
 {
     if (!NSS_CMSMessage_IsSigned(cms_msg)) {
         error(errInternal, 0, "Input couldn't be parsed as a CMS signature");
@@ -905,7 +909,7 @@ NSSCMSSignedData *SignatureHandler::CMS_SignedDataCreate(NSSCMSMessage *cms_msg)
     }
 }
 
-NSSCMSSignerInfo *SignatureHandler::CMS_SignerInfoCreate(NSSCMSSignedData *cms_sig_data)
+NSSCMSSignerInfo *CMS_SignerInfoCreate(NSSCMSSignedData *cms_sig_data)
 {
     NSSCMSSignerInfo *signerInfo = NSS_CMSSignedData_GetSignerInfo(cms_sig_data, 0);
     if (!signerInfo) {
diff --git a/poppler/SignatureHandler.h b/poppler/SignatureHandler.h
index b45a27e7..fdc0ebd4 100644
--- a/poppler/SignatureHandler.h
+++ b/poppler/SignatureHandler.h
@@ -78,9 +78,6 @@ private:
     SignatureHandler &operator=(const SignatureHandler &);
 
     unsigned int digestLength(HashAlgorithm digestAlgId);
-    NSSCMSMessage *CMS_MessageCreate(SECItem *cms_item);
-    NSSCMSSignedData *CMS_SignedDataCreate(NSSCMSMessage *cms_msg);
-    NSSCMSSignerInfo *CMS_SignerInfoCreate(NSSCMSSignedData *cms_sig_data);
     HASHContext *initHashContext();
     static void outputCallback(void *arg, const char *buf, unsigned long len);
 


More information about the poppler mailing list