[poppler] poppler/SignatureHandler.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 18 14:54:34 UTC 2022


 poppler/SignatureHandler.cc |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 799848525e9f07b8ff7de1fb6d41cb082de364e6
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jan 18 15:41:56 2022 +0100

    SignatureHandler: Fix crashes on Windows
    
    We should not use SEC_ASN1_XTRN since on Windows that means
    SEC_ASN1_DYNAMIC which means the third parameter is a function.
    
    IssuerSerialTemplate is not a function
    
    SECOID_AlgorithmIDTemplate was a function, but that was also a mistake
    since it's defined as a template in secoid.h

diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc
index 36b970a1..23c057f9 100644
--- a/poppler/SignatureHandler.cc
+++ b/poppler/SignatureHandler.cc
@@ -31,6 +31,7 @@
 
 /* NSS headers */
 #include <secmod.h>
+#include <secoid.h>
 #include <keyhi.h>
 #include <secder.h>
 #include <pk11pub.h>
@@ -193,12 +194,10 @@ const SEC_ASN1Template IssuerSerialTemplate[] = {
  * }
  */
 
-SEC_ASN1_MKSUB(SECOID_AlgorithmIDTemplate)
-
 const SEC_ASN1Template ESSCertIDv2Template[] = { { SEC_ASN1_SEQUENCE, 0, nullptr, sizeof(ESSCertIDv2) },
-                                                 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(ESSCertIDv2, hashAlgorithm), SEC_ASN1_SUB(SECOID_AlgorithmIDTemplate), 0 },
+                                                 { SEC_ASN1_INLINE, offsetof(ESSCertIDv2, hashAlgorithm), SEC_ASN1_GET(SECOID_AlgorithmIDTemplate), 0 },
                                                  { SEC_ASN1_OCTET_STRING, offsetof(ESSCertIDv2, certHash), nullptr, 0 },
-                                                 { SEC_ASN1_INLINE | SEC_ASN1_XTRN, offsetof(ESSCertIDv2, issuerSerial), IssuerSerialTemplate, 0 },
+                                                 { SEC_ASN1_INLINE, offsetof(ESSCertIDv2, issuerSerial), IssuerSerialTemplate, 0 },
                                                  { 0, 0, nullptr, 0 } };
 
 /**


More information about the poppler mailing list