[poppler] glib/poppler-form-field.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 4 19:47:38 UTC 2023


 glib/poppler-form-field.cc |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit e54d8611d979f0034f81f1c51c2dfcd14200038d
Author: Jan-Michael Brummer <jan.brummer at tabos.org>
Date:   Tue Jul 4 10:53:15 2023 +0200

    Improve poppler_get_available_signing_certificates
    
    Remove #ifdef and error handling
    
    Fixes: https://gitlab.freedesktop.org/poppler/poppler/-/issues/1412

diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index d2206288..d923609b 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -2030,14 +2030,17 @@ void poppler_certificate_info_free(PopplerCertificateInfo *certificate_info)
 GList *poppler_get_available_signing_certificates(void)
 {
     GList *list = nullptr;
-#ifdef ENABLE_NSS3
-    std::vector<std::unique_ptr<X509CertificateInfo>> vCerts = CryptoSign::Factory::createActive()->getAvailableSigningCertificates();
+    auto backend = CryptoSign::Factory::createActive();
 
+    if (!backend) {
+        return nullptr;
+    }
+
+    std::vector<std::unique_ptr<X509CertificateInfo>> vCerts = backend->getAvailableSigningCertificates();
     for (auto &cert : vCerts) {
         PopplerCertificateInfo *certificate_info = create_certificate_info(cert.get());
         list = g_list_append(list, certificate_info);
     }
-#endif
     return list;
 }
 


More information about the poppler mailing list