[poppler] poppler/SignatureHandler.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 1 22:24:02 UTC 2022


 poppler/SignatureHandler.cc |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 602f39aa5c00f2dd2a61f1b4a781720ae3bc6070
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Feb 1 23:19:00 2022 +0100

    Windows: Fix path where to look for firefox NSS DB

diff --git a/poppler/SignatureHandler.cc b/poppler/SignatureHandler.cc
index 23c057f9..43fc974e 100644
--- a/poppler/SignatureHandler.cc
+++ b/poppler/SignatureHandler.cc
@@ -666,9 +666,13 @@ std::unique_ptr<X509CertificateInfo> SignatureHandler::getCertificateInfo() cons
     }
 }
 
-static std::optional<std::string> getDefaultFirefoxCertDB_Linux()
+static std::optional<std::string> getDefaultFirefoxCertDB()
 {
+#ifdef _WIN32
+    const std::string firefoxPath = std::string(getenv("HOME")) + "/AppData/Roaming/Mozilla/Firefox/Profiles/";
+#else
     const std::string firefoxPath = std::string(getenv("HOME")) + "/.mozilla/firefox/";
+#endif
 
     GDir firefoxDir(firefoxPath.c_str());
     std::unique_ptr<GDirEntry> entry;
@@ -706,7 +710,7 @@ void SignatureHandler::setNSSDir(const GooString &nssDir)
         initSuccess = (NSS_Init(nssDir.c_str()) == SECSuccess);
         sNssDir = nssDir.toStr();
     } else {
-        const std::optional<std::string> certDBPath = getDefaultFirefoxCertDB_Linux();
+        const std::optional<std::string> certDBPath = getDefaultFirefoxCertDB();
         if (!certDBPath) {
             initSuccess = (NSS_Init("sql:/etc/pki/nssdb") == SECSuccess);
             sNssDir = "sql:/etc/pki/nssdb";


More information about the poppler mailing list