[poppler] utils/pdfsig.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 4 08:04:46 UTC 2022


 utils/pdfsig.cc |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 9f5e62f4c4fb69338b66f4a590cba6f2926c3a31
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jan 3 15:02:27 2022 +0100

    pdfsig: Fix signing with -sign if nss password is needed

diff --git a/utils/pdfsig.cc b/utils/pdfsig.cc
index 56e87d82..a3dee865 100644
--- a/utils/pdfsig.cc
+++ b/utils/pdfsig.cc
@@ -6,7 +6,7 @@
 //
 // Copyright 2015 André Guerreiro <aguerreiro1985 at gmail.com>
 // Copyright 2015 André Esser <bepandre at hotmail.com>
-// Copyright 2015, 2017-2021 Albert Astals Cid <aacid at kde.org>
+// Copyright 2015, 2017-2022 Albert Astals Cid <aacid at kde.org>
 // Copyright 2016 Markus Kilås <digital at markuspage.com>
 // Copyright 2017, 2019 Hans-Ulrich Jüttner <huj at froreich-bioscientia.de>
 // Copyright 2017, 2019 Adrian Johnson <ajohnson at redneon.com>
@@ -365,6 +365,14 @@ int main(int argc, char *argv[])
             printf("A nickname of the signing certificate must be given\n");
             return 2;
         }
+
+        bool getCertsError;
+        // We need to call this otherwise NSS spins forever
+        getAvailableSigningCertificates(&getCertsError);
+        if (getCertsError) {
+            return 2;
+        }
+
         FormFieldSignature *ffs = signatures.at(signatureNumber - 1);
         Goffset file_size = 0;
         GooString *sig = ffs->getCheckedSignature(&file_size);


More information about the poppler mailing list