bug 1217602 - remove nsIPKIParamBlock r=Cykesiopka
authorDavid Keeler <dkeeler@mozilla.com>
Thu, 22 Oct 2015 13:11:40 -0700
changeset 269572 23f0dcfdcce1de9293704d6e59a679eed76eeede
parent 269571 92d383d8d282e9fb35302836f9e44717c2d1d4cc
child 269573 08493e40a4ad44fb3d05d4c19ab8fd923a8de737
push id67132
push userdkeeler@mozilla.com
push dateMon, 26 Oct 2015 22:26:40 +0000
treeherdermozilla-inbound@23f0dcfdcce1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCykesiopka
bugs1217602
milestone44.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 1217602 - remove nsIPKIParamBlock r=Cykesiopka nsIPKIParamBlock was unnecessary.
security/manager/pki/moz.build
security/manager/pki/nsIPKIParamBlock.idl
security/manager/pki/nsNSSDialogHelper.cpp
security/manager/pki/nsNSSDialogHelper.h
security/manager/pki/nsNSSDialogs.cpp
security/manager/pki/nsPKIModule.cpp
security/manager/pki/nsPKIParamBlock.cpp
security/manager/pki/nsPKIParamBlock.h
security/manager/pki/resources/content/certManager.js
security/manager/pki/resources/content/deletecert.js
security/manager/pki/resources/content/downloadcert.js
security/manager/pki/resources/content/editcerts.js
security/manager/pki/resources/content/viewCertDetails.js
--- a/security/manager/pki/moz.build
+++ b/security/manager/pki/moz.build
@@ -3,26 +3,24 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['resources']
 
 XPIDL_SOURCES += [
     'nsIASN1Tree.idl',
-    'nsIPKIParamBlock.idl',
 ]
 
 XPIDL_MODULE = 'pippki'
 
 UNIFIED_SOURCES += [
     'nsASN1Tree.cpp',
     'nsNSSDialogHelper.cpp',
     'nsNSSDialogs.cpp',
     'nsPKIModule.cpp',
-    'nsPKIParamBlock.cpp',
 ]
 
 GENERATED_INCLUDES += [
     '/dist/public/nss',
 ]
 
 FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/security/manager/pki/nsIPKIParamBlock.idl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-[scriptable, uuid(b6fe3d78-1dd1-11b2-9058-ced9016984c8)]
-interface nsIPKIParamBlock : nsISupports {
-
-  void setISupportAtIndex(in long index, in nsISupports object);
-  nsISupports getISupportAtIndex(in long index);
-};
--- a/security/manager/pki/nsNSSDialogHelper.cpp
+++ b/security/manager/pki/nsNSSDialogHelper.cpp
@@ -1,32 +1,28 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsNSSDialogHelper.h"
-#include "nsIWindowWatcher.h"
+
+#include "mozilla/dom/ScriptSettings.h"
 #include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
+#include "nsIDOMWindow.h"
 #include "nsIServiceManager.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "mozilla/dom/ScriptSettings.h"
+#include "nsIWindowWatcher.h"
 
 static const char kOpenDialogParam[] = "centerscreen,chrome,modal,titlebar";
 static const char kOpenWindowParam[] = "centerscreen,chrome,titlebar";
 
 nsresult
-nsNSSDialogHelper::openDialog(
-    nsIDOMWindow *window,
-    const char *url,
-    nsISupports *params,
-    bool modal)
+nsNSSDialogHelper::openDialog(nsIDOMWindow* window, const char* url,
+                              nsISupports* params, bool modal)
 {
 #ifdef MOZ_WIDGET_GONK
   // On b2g devices, we need to proxy the dialog creation & management
   // to Gaia.
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif
 
   nsresult rv;
@@ -53,9 +49,8 @@ nsNSSDialogHelper::openDialog(
                                  "_blank",
                                  modal
                                  ? kOpenDialogParam
                                  : kOpenWindowParam,
                                  params,
                                  getter_AddRefs(newWindow));
   return rv;
 }
-
--- a/security/manager/pki/nsNSSDialogHelper.h
+++ b/security/manager/pki/nsNSSDialogHelper.h
@@ -2,29 +2,26 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsNSSDialogHelper_h
 #define nsNSSDialogHelper_h
 
-#include "nsIDOMWindow.h"
+class nsIDOMWindow;
+class nsISupports;
 
 /**
  * Common class that uses the window watcher service to open a
  * standard dialog, with or without a parent context. The params
  * parameter can be an nsISupportsArray so any number of additional
  * arguments can be used.
  */
 class nsNSSDialogHelper
 {
 public:
-  //The params is going to be either a nsIPKIParamBlock or
-  //nsIDialogParamBlock
-  static nsresult openDialog(
-                  nsIDOMWindow *window,
-                  const char *url,
-                  nsISupports *params,
-                  bool modal = true);
+  // params is a nsIDialogParamBlock or a nsIKeygenThread
+  static nsresult openDialog(nsIDOMWindow* window, const char* url,
+                             nsISupports* params, bool modal = true);
 };
 
 #endif
--- a/security/manager/pki/nsNSSDialogs.cpp
+++ b/security/manager/pki/nsNSSDialogs.cpp
@@ -20,17 +20,16 @@
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIX509Cert.h"
 #include "nsIX509CertDB.h"
 #include "nsIDateTimeFormat.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsPromiseFlatString.h"
 
 #include "nsNSSDialogs.h"
-#include "nsPKIParamBlock.h"
 #include "nsIKeygenThread.h"
 #include "nsIProtectedAuthThread.h"
 #include "nsNSSDialogHelper.h"
 #include "nsIWindowWatcher.h"
 #include "nsIX509CertValidity.h"
 
 #include "nsEmbedCID.h"
 #include "nsIPromptService.h"
@@ -106,60 +105,65 @@ nsNSSDialogs::SetPassword(nsIInterfaceRe
 NS_IMETHODIMP 
 nsNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor *ctx, 
                                     nsIX509Cert *cert,
                                     uint32_t *_trust,
                                     bool *_retval)
 {
   nsresult rv;
 
-  *_retval = true;
+  nsCOMPtr<nsIMutableArray> dlgArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
+  if (!dlgArray) {
+    return NS_ERROR_FAILURE;
+  }
+  rv = dlgArray->AppendElement(cert, false);
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
+  nsCOMPtr<nsIDialogParamBlock> dlgParamBlock(
+    do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
+  if (!dlgParamBlock) {
+    return NS_ERROR_FAILURE;
+  }
+  rv = dlgParamBlock->SetObjects(dlgArray);
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
 
   // Get the parent window for the dialog
   nsCOMPtr<nsIDOMWindow> parent = do_GetInterface(ctx);
-
-  nsCOMPtr<nsIPKIParamBlock> block =
-           do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
-  if (!block)
-    return NS_ERROR_FAILURE;
-
-  rv = block->SetISupportAtIndex(1, cert);
-  if (NS_FAILED(rv))
-    return rv;
-
   rv = nsNSSDialogHelper::openDialog(parent, 
                                      "chrome://pippki/content/downloadcert.xul",
-                                     block);
-  if (NS_FAILED(rv)) return rv;
+                                     dlgParamBlock);
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
 
   int32_t status;
   int32_t ssl, email, objsign;
 
-  nsCOMPtr<nsIDialogParamBlock> dlgParamBlock = do_QueryInterface(block);
-  
   rv = dlgParamBlock->GetInt(1, &status);
   if (NS_FAILED(rv)) return rv;
   rv = dlgParamBlock->GetInt(2, &ssl);
   if (NS_FAILED(rv)) return rv;
   rv = dlgParamBlock->GetInt(3, &email);
   if (NS_FAILED(rv)) return rv;
   rv = dlgParamBlock->GetInt(4, &objsign);
   if (NS_FAILED(rv)) return rv;
  
   *_trust = nsIX509CertDB::UNTRUSTED;
   *_trust |= (ssl) ? nsIX509CertDB::TRUSTED_SSL : 0;
   *_trust |= (email) ? nsIX509CertDB::TRUSTED_EMAIL : 0;
   *_trust |= (objsign) ? nsIX509CertDB::TRUSTED_OBJSIGN : 0;
 
-  *_retval = (status == 0)?false:true;
+  *_retval = (status != 0);
 
   return rv;
 }
 
-
 NS_IMETHODIMP 
 nsNSSDialogs::NotifyCACertExists(nsIInterfaceRequestor *ctx)
 {
   nsresult rv;
 
   nsCOMPtr<nsIPromptService> promptSvc(do_GetService(NS_PROMPTSERVICE_CONTRACTID));
   if (!promptSvc)
     return NS_ERROR_FAILURE;
@@ -373,38 +377,42 @@ nsNSSDialogs::GetPKCS12FilePassword(nsII
     _password.Assign(pwTemp);
     free(pwTemp);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP 
-nsNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx, 
-                       nsIX509Cert *cert)
+nsNSSDialogs::ViewCert(nsIInterfaceRequestor* ctx, nsIX509Cert* cert)
 {
-  nsresult rv;
-
-  nsCOMPtr<nsIPKIParamBlock> block =
-           do_CreateInstance(NS_PKIPARAMBLOCK_CONTRACTID);
-  if (!block)
+  nsCOMPtr<nsIMutableArray> dlgArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
+  if (!dlgArray) {
     return NS_ERROR_FAILURE;
-
-  rv = block->SetISupportAtIndex(1, cert);
-  if (NS_FAILED(rv))
+  }
+  nsresult rv = dlgArray->AppendElement(cert, false);
+  if (NS_FAILED(rv)) {
     return rv;
+  }
+  nsCOMPtr<nsIDialogParamBlock> dlgParamBlock(
+    do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
+  if (!dlgParamBlock) {
+    return NS_ERROR_FAILURE;
+  }
+  rv = dlgParamBlock->SetObjects(dlgArray);
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
 
   // Get the parent window for the dialog
   nsCOMPtr<nsIDOMWindow> parent = do_GetInterface(ctx);
-
-  rv = nsNSSDialogHelper::openDialog(parent,
-                                     "chrome://pippki/content/certViewer.xul",
-                                     block,
-                                     false);
-  return rv;
+  return nsNSSDialogHelper::openDialog(parent,
+                                       "chrome://pippki/content/certViewer.xul",
+                                       dlgParamBlock,
+                                       false);
 }
 
 NS_IMETHODIMP
 nsNSSDialogs::DisplayGeneratingKeypairInfo(nsIInterfaceRequestor *aCtx, nsIKeygenThread *runnable) 
 {
   nsresult rv;
 
   // Get the parent window for the dialog
--- a/security/manager/pki/nsPKIModule.cpp
+++ b/security/manager/pki/nsPKIModule.cpp
@@ -2,44 +2,39 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ModuleUtils.h"
 
 #include "nsNSSDialogs.h"
-#include "nsPKIParamBlock.h"
 #include "nsASN1Tree.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNSSDialogs, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPKIParamBlock, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSASN1Tree)
 
 NS_DEFINE_NAMED_CID(NS_NSSDIALOGS_CID);
 NS_DEFINE_NAMED_CID(NS_NSSASN1OUTINER_CID);
-NS_DEFINE_NAMED_CID(NS_PKIPARAMBLOCK_CID);
 
 
 static const mozilla::Module::CIDEntry kPKICIDs[] = {
   { &kNS_NSSDIALOGS_CID, false, nullptr, nsNSSDialogsConstructor },
   { &kNS_NSSASN1OUTINER_CID, false, nullptr, nsNSSASN1TreeConstructor },
-  { &kNS_PKIPARAMBLOCK_CID, false, nullptr, nsPKIParamBlockConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kPKIContracts[] = {
   { NS_TOKENPASSWORDSDIALOG_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_CERTIFICATEDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_CLIENTAUTHDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_CERTPICKDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_TOKENDIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_GENERATINGKEYPAIRINFODIALOGS_CONTRACTID, &kNS_NSSDIALOGS_CID },
   { NS_ASN1TREE_CONTRACTID, &kNS_NSSASN1OUTINER_CID },
-  { NS_PKIPARAMBLOCK_CONTRACTID, &kNS_PKIPARAMBLOCK_CID },
   { nullptr }
 };
 
 static const mozilla::Module kPKIModule = {
   mozilla::Module::kVersion,
   kPKICIDs,
   kPKIContracts
 };
deleted file mode 100644
--- a/security/manager/pki/nsPKIParamBlock.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsPKIParamBlock.h"
-#include "nsIServiceManager.h"
-#include "nsIDialogParamBlock.h"
-#include "nsIMutableArray.h"
-
-NS_IMPL_ISUPPORTS(nsPKIParamBlock, nsIPKIParamBlock, nsIDialogParamBlock)
-
-nsPKIParamBlock::nsPKIParamBlock()
-{
-}
-
-nsresult
-nsPKIParamBlock::Init()
-{
-  mDialogParamBlock = do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID);
-  return !mDialogParamBlock ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
-}
-
-nsPKIParamBlock::~nsPKIParamBlock()
-{
-}
-
-
-NS_IMETHODIMP 
-nsPKIParamBlock::SetNumberStrings( int32_t inNumStrings )
-{
-  return mDialogParamBlock->SetNumberStrings(inNumStrings);
-}
-
-NS_IMETHODIMP 
-nsPKIParamBlock::SetInt(int32_t inIndex, int32_t inInt)
-{
-  return mDialogParamBlock->SetInt(inIndex, inInt);
-}
-
-NS_IMETHODIMP 
-nsPKIParamBlock::GetInt(int32_t inIndex, int32_t *outInt)
-{
-  return mDialogParamBlock->GetInt(inIndex, outInt);
-}
-
-
-NS_IMETHODIMP 
-nsPKIParamBlock::GetString(int32_t inIndex, char16_t **_retval)
-{
-  return mDialogParamBlock->GetString(inIndex, _retval);
-}
-
-NS_IMETHODIMP 
-nsPKIParamBlock::SetString(int32_t inIndex, const char16_t *inString)
-{
-  return mDialogParamBlock->SetString(inIndex, inString);
-}
-
-NS_IMETHODIMP
-nsPKIParamBlock::GetObjects(nsIMutableArray * *aObjects)
-{
-  return mDialogParamBlock->GetObjects(aObjects);
-}
-
-NS_IMETHODIMP
-nsPKIParamBlock::SetObjects(nsIMutableArray * aObjects)
-{
-  return mDialogParamBlock->SetObjects(aObjects);
-}
-
-
-
-NS_IMETHODIMP 
-nsPKIParamBlock::SetISupportAtIndex(int32_t index, nsISupports *object)
-{
-  if (!mSupports) {
-    mSupports = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
-    if (!mSupports) {
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-  }
-  // Ignore any InsertElementAt error, because this function always did that
-  mSupports->InsertElementAt(object, index-1);
-  return NS_OK;
-}
-
-NS_IMETHODIMP 
-nsPKIParamBlock::GetISupportAtIndex(int32_t index, nsISupports **_retval)
-{
-  NS_ENSURE_ARG(_retval);
-
-  return mSupports->GetElementAt(index - 1, _retval);
-}
-
-
deleted file mode 100644
--- a/security/manager/pki/nsPKIParamBlock.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef _NSPKIPARAMBLOCK_
-#define _NSPKIPARAMBLOCK_
-#include "nsCOMPtr.h"
-#include "nsIPKIParamBlock.h"
-#include "nsIDialogParamBlock.h"
-#include "nsISupportsArray.h"
-
-#define NS_PKIPARAMBLOCK_CID \
-  { 0x0bec75a8, 0x1dd2, 0x11b2, \
-    { 0x86, 0x3a, 0xf6, 0x9f, 0x77, 0xc3, 0x13, 0x71 }}
-
-#define NS_PKIPARAMBLOCK_CONTRACTID "@mozilla.org/security/pkiparamblock;1"
-
-class nsPKIParamBlock : public nsIPKIParamBlock,
-                        public nsIDialogParamBlock
-{
-public:
- 
-  nsPKIParamBlock();
-  nsresult Init();
-
-  NS_DECL_NSIPKIPARAMBLOCK
-  NS_DECL_NSIDIALOGPARAMBLOCK
-  NS_DECL_THREADSAFE_ISUPPORTS
-private:
-  virtual ~nsPKIParamBlock();
-  nsCOMPtr<nsIDialogParamBlock> mDialogParamBlock;
-  nsCOMPtr<nsISupportsArray>    mSupports;
-};
-
-#endif //_NSPKIPARAMBLOCK_
--- a/security/manager/pki/resources/content/certManager.js
+++ b/security/manager/pki/resources/content/certManager.js
@@ -6,18 +6,16 @@ const nsIFilePicker = Components.interfa
 const nsFilePicker = "@mozilla.org/filepicker;1";
 const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
 const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
 const nsIX509Cert = Components.interfaces.nsIX509Cert;
 const nsICertTree = Components.interfaces.nsICertTree;
 const nsCertTree = "@mozilla.org/security/nsCertTree;1";
 const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
 const nsDialogParamBlock = "@mozilla.org/embedcomp/dialogparam;1";
-const nsIPKIParamBlock    = Components.interfaces.nsIPKIParamBlock;
-const nsPKIParamBlock    = "@mozilla.org/security/pkiparamblock;1";
 
 const gCertFileTypes = "*.p7b; *.crt; *.cert; *.cer; *.pem; *.der";
 
 var { NetUtil } = Components.utils.import("resource://gre/modules/NetUtil.jsm", {});
 var { Services } = Components.utils.import("resource://gre/modules/Services.jsm", {});
 
 var key;
 
--- a/security/manager/pki/resources/content/deletecert.js
+++ b/security/manager/pki/resources/content/deletecert.js
@@ -1,16 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const nsIX509Cert = Components.interfaces.nsIX509Cert;
 const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
 const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
-const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
 const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
 
 var certdb;
 var gParams;
 
 function setWindowName()
 {
   gParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
--- a/security/manager/pki/resources/content/downloadcert.js
+++ b/security/manager/pki/resources/content/downloadcert.js
@@ -1,27 +1,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
-const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
 const nsIX509Cert = Components.interfaces.nsIX509Cert;
 
-var pkiParams;
 var params;
 var caName;
 var cert;
 
 function onLoad()
 {
-  pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
-  params = pkiParams.QueryInterface(nsIDialogParamBlock);
-  var isupport = pkiParams.getISupportAtIndex(1);
-  cert = isupport.QueryInterface(nsIX509Cert);
+  params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
+  cert = params.objects.queryElementAt(0, nsIX509Cert);
 
   caName = cert.commonName; 
 
   var bundle = document.getElementById("pippki_bundle");
 
   if (!caName.length)
     caName = bundle.getString("unnamedCA");
 
--- a/security/manager/pki/resources/content/editcerts.js
+++ b/security/manager/pki/resources/content/editcerts.js
@@ -1,16 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const nsIX509Cert = Components.interfaces.nsIX509Cert;
 const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
 const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
-const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
 
 var certdb;
 var cert;
 
 function doPrompt(msg)
 {
   let prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
     getService(Components.interfaces.nsIPromptService);
--- a/security/manager/pki/resources/content/viewCertDetails.js
+++ b/security/manager/pki/resources/content/viewCertDetails.js
@@ -2,22 +2,22 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const nsIX509Cert = Components.interfaces.nsIX509Cert;
 const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
 const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
 const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
 const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
-const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
 const nsIASN1Object = Components.interfaces.nsIASN1Object;
 const nsIASN1Sequence = Components.interfaces.nsIASN1Sequence;
 const nsIASN1PrintableItem = Components.interfaces.nsIASN1PrintableItem;
 const nsIASN1Tree = Components.interfaces.nsIASN1Tree;
 const nsASN1Tree = "@mozilla.org/security/nsASN1Tree;1"
+const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
 
 var bundle;
 
 function doPrompt(msg)
 {
   let prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
     getService(Components.interfaces.nsIPromptService);
   prompts.alert(window, null, msg);
@@ -73,19 +73,18 @@ function setWindowName()
     //      by "tokenname:certname", which is what we have.
     //var tokenName = "";
     //var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
     //var token = pk11db.findTokenByName(tokenName);
 
     //var cert = certdb.findCertByNickname(token, myName);
     cert = certdb.findCertByNickname(null, myName);
   } else {
-    var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
-    var isupport = pkiParams.getISupportAtIndex(1);
-    cert = isupport.QueryInterface(nsIX509Cert);
+    var params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
+    var cert = params.objects.queryElementAt(0, nsIX509Cert);
     document.title = certDetails + '"' + cert.windowTitle + '"'; // XXX l10n?
   }
 
   //
   //  Set the cert attributes for viewing
   //
 
   //  The chain of trust