Merge mozilla-central and mozilla-inbound
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 20 Jul 2011 15:54:18 -0400
changeset 73117 9e064c13693c85afce84e004d08e2aba4dd118c3
parent 73116 bedd0f79b82d19f5988e449dc7fad2a4582efb6a (current diff)
parent 73076 6a97d5d47ef8da7990f7f448b184248e04379734 (diff)
child 73118 8d56702130fbfc2efaef57ecb24e8e6f8234271b
push id20819
push usermak77@bonardo.net
push dateThu, 21 Jul 2011 12:32:52 +0000
treeherdermozilla-central@036c28e4e0f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone8.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
Merge mozilla-central and mozilla-inbound
--- a/mobile/app/Makefile.in
+++ b/mobile/app/Makefile.in
@@ -83,17 +83,21 @@ ifdef _MSC_VER
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 endif #LIBXUL_SDK
 
 include $(topsrcdir)/config/rules.mk
 
 GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+ifndef MOZ_BUILD_DATE
 APP_BUILDID = $(shell $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid)
+else
+APP_BUILDID = $(MOZ_BUILD_DATE)
+endif
 APP_ICON = mobile
 APP_SPLASH = splash
 
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) \
            -DGRE_BUILDID=$(GRE_BUILDID) \
            -DAPP_BUILDID=$(APP_BUILDID) \
            -DAPP_NAME=$(MOZ_APP_NAME) \
            -DAPP_VERSION=$(MOZ_APP_VERSION) \
--- a/security/manager/pki/resources/content/certManager.js
+++ b/security/manager/pki/resources/content/certManager.js
@@ -100,23 +100,24 @@ function LoadCerts()
    .treeBoxObject.view = userTreeView;
 
   orphanTreeView = Components.classes[nsCertTree]
                       .createInstance(nsICertTree);
   orphanTreeView.loadCertsFromCache(certcache, nsIX509Cert.UNKNOWN_CERT);
   document.getElementById('orphan-tree')
    .treeBoxObject.view = orphanTreeView;
 
+  enableBackupAllButton();
+}
+
+function enableBackupAllButton()
+{
   var rowCnt = userTreeView.rowCount;
-  var enableBackupAllButton=document.getElementById('mine_backupAllButton');
-  if(rowCnt < 1) {
-    enableBackupAllButton.setAttribute("disabled",true);
-  } else  {
-    enableBackupAllButton.setAttribute("enabled",true);
-  }
+  var backupAllButton=document.getElementById('mine_backupAllButton');
+  backupAllButton.disabled = (rowCnt < 1);
 }
 
 function getSelectedCerts()
 {
   var ca_tab = document.getElementById("ca_tab");
   var mine_tab = document.getElementById("mine_tab");
   var others_tab = document.getElementById("others_tab");
   var websites_tab = document.getElementById("websites_tab");
@@ -423,16 +424,17 @@ function restoreCerts()
     certdb.importPKCS12File(null, fp.file);
 
     var certcache = Components.classes[nsNSSCertCache].createInstance(nsINSSCertCache);
     certcache.cacheAllCerts();
     userTreeView.loadCertsFromCache(certcache, nsIX509Cert.USER_CERT);
     userTreeView.selection.clearSelection();
     caTreeView.loadCertsFromCache(certcache, nsIX509Cert.CA_CERT);
     caTreeView.selection.clearSelection();
+    enableBackupAllButton();
   }
 }
 
 function exportCerts()
 {
   getSelectedCerts();
   var numcerts = selected_certs.length;
   if (!numcerts)
@@ -523,16 +525,19 @@ function deleteCerts()
     for (t=numcerts-1; t>=0; t--)
     {
       treeView.deleteEntryObject(selected_index[t]);
     }
 
     selected_tree_items = [];
     selected_index = [];
     treeView.selection.clearSelection();
+    if (selTabID == 'mine_tab') {
+      enableBackupAllButton();
+    }
   }
 }
 
 function viewCerts()
 {
   getSelectedCerts();
   var numcerts = selected_certs.length;
   if (!numcerts)
--- a/security/manager/ssl/src/nsUsageArrayHelper.cpp
+++ b/security/manager/ssl/src/nsUsageArrayHelper.cpp
@@ -176,30 +176,34 @@ nsUsageArrayHelper::GetUsagesArray(const
     if (nssComponent) {
       nssComponent->SkipOcsp();
     }
   }
   
   PRUint32 &count = *_count;
   count = 0;
   SECCertificateUsage usages = 0;
-  SECStatus verifyResult;
-
+  int err = 0;
+  
 if (!nsNSSComponent::globalConstFlagUsePKIXVerification) {
-  verifyResult =
+  // CERT_VerifyCertificateNow returns SECFailure unless the certificate is
+  // valid for all the given usages. Hoewver, we are only looking for the list
+  // of usages for which the cert *is* valid.
+  (void)
   CERT_VerifyCertificateNow(defaultcertdb, mCert, PR_TRUE,
 			    certificateUsageSSLClient |
 			    certificateUsageSSLServer |
 			    certificateUsageSSLServerWithStepUp |
 			    certificateUsageEmailSigner |
 			    certificateUsageEmailRecipient |
 			    certificateUsageObjectSigner |
 			    certificateUsageSSLCA |
 			    certificateUsageStatusResponder,
 			    NULL, &usages);
+  err = PR_GetError();
 }
 else {
   nsresult nsrv;
   nsCOMPtr<nsINSSComponent> inss = do_GetService(kNSSComponentCID, &nsrv);
   if (!inss)
     return nsrv;
   nsRefPtr<nsCERTValInParamWrapper> survivingParams;
   if (localOnly)
@@ -210,30 +214,23 @@ else {
   if (NS_FAILED(nsrv))
     return nsrv;
 
   CERTValOutParam cvout[2];
   cvout[0].type = cert_po_usages;
   cvout[0].value.scalar.usages = 0;
   cvout[1].type = cert_po_end;
   
-  verifyResult =
   CERT_PKIXVerifyCert(mCert, certificateUsageCheckAllUsages,
                       survivingParams->GetRawPointerForNSS(),
                       cvout, NULL);
-
+  err = PR_GetError();
   usages = cvout[0].value.scalar.usages;
 }
 
-  if (verifyResult != SECSuccess) {
-    int err = PR_GetError();
-    verifyFailed(_verified, err);
-    return NS_OK;
-  }
-
   // The following list of checks must be < max_returned_out_array_size
   
   check(suffix, usages & certificateUsageSSLClient, count, outUsages);
   check(suffix, usages & certificateUsageSSLServer, count, outUsages);
   check(suffix, usages & certificateUsageSSLServerWithStepUp, count, outUsages);
   check(suffix, usages & certificateUsageEmailSigner, count, outUsages);
   check(suffix, usages & certificateUsageEmailRecipient, count, outUsages);
   check(suffix, usages & certificateUsageObjectSigner, count, outUsages);
@@ -249,11 +246,15 @@ else {
 #if 0
   check(suffix, usages & certificateUsageAnyCA, count, outUsages);
 #endif
 
   if (!nsNSSComponent::globalConstFlagUsePKIXVerification && localOnly && nssComponent) {
     nssComponent->SkipOcspOff();
   }
 
-  *_verified = nsNSSCertificate::VERIFIED_OK;
+  if (count == 0) {
+    verifyFailed(_verified, err);
+  } else {
+    *_verified = nsNSSCertificate::VERIFIED_OK;
+  }
   return NS_OK;
 }