bug 1397471 - nsNSSCertificateDB::GetCerts needs to wait until the loadable roots have been loaded r=Cykesiopka
authorDavid Keeler <dkeeler@mozilla.com>
Wed, 06 Sep 2017 14:29:17 -0700
changeset 428982 75e4a2e292967513f19c32c59d104df0f49a1cb3
parent 428981 26d748e596426e844646403acd5f0e93c1b3019b
child 428983 5391c8a2ffddb40b82cfd63c9c6c7554e598b87c
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCykesiopka
bugs1397471, 1372656
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1397471 - nsNSSCertificateDB::GetCerts needs to wait until the loadable roots have been loaded r=Cykesiopka This was missed in the original implementation of bug 1372656. MozReview-Commit-ID: 8Sm26YlxZ7l
security/manager/ssl/nsNSSCertificateDB.cpp
--- a/security/manager/ssl/nsNSSCertificateDB.cpp
+++ b/security/manager/ssl/nsNSSCertificateDB.cpp
@@ -1340,16 +1340,21 @@ nsNSSCertificateDB::SetCertTrustFromStri
 NS_IMETHODIMP
 nsNSSCertificateDB::GetCerts(nsIX509CertList **_retval)
 {
   nsNSSShutDownPreventionLock locker;
   if (isAlreadyShutDown()) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
+  nsresult rv = BlockUntilLoadableRootsLoaded();
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
+
   nsCOMPtr<nsIInterfaceRequestor> ctx = new PipUIContext();
   nsCOMPtr<nsIX509CertList> nssCertList;
   UniqueCERTCertList certList(PK11_ListCerts(PK11CertListUnique, ctx));
 
   // nsNSSCertList 1) adopts certList, and 2) handles the nullptr case fine.
   // (returns an empty list)
   nssCertList = new nsNSSCertList(Move(certList), locker);