From 6b0596a14cd39a742a8e2caa27cab71a76b17bc9 Mon Sep 17 00:00:00 2001 From: Cykesiopka Date: Sun, 5 Mar 2017 18:30:31 +0800 Subject: [PATCH] Bug 1344441 - Move various Necko IDLs that really ought to be PSM IDLs. r=keeler,mcmanus These IDLs conceptually are PSM APIs, and are implemented in PSM as well. nsICryptoFIPSInfo.idl is similar but is removed instead because: 1. It's unused even by addons. 2. The only thing it provides is also available through nsIPKCS11ModuleDB.idl. MozReview-Commit-ID: K8R0wDAhjLq --HG-- rename : netwerk/base/nsICryptoHMAC.idl => security/manager/ssl/nsICryptoHMAC.idl rename : netwerk/base/nsICryptoHash.idl => security/manager/ssl/nsICryptoHash.idl rename : netwerk/base/nsINSSErrorsService.idl => security/manager/ssl/nsINSSErrorsService.idl extra : rebase_source : 3eca83901e14cea714d402046303790d283cff74 --- netwerk/base/moz.build | 4 ---- netwerk/base/nsICryptoFIPSInfo.idl | 15 --------------- security/manager/ssl/moz.build | 3 +++ .../manager/ssl}/nsICryptoHMAC.idl | 0 .../manager/ssl}/nsICryptoHash.idl | 0 .../manager/ssl}/nsINSSErrorsService.idl | 0 security/manager/ssl/nsNSSModule.cpp | 1 - security/manager/ssl/nsPKCS11Slot.cpp | 8 +------- security/manager/ssl/nsPKCS11Slot.h | 3 --- 9 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 netwerk/base/nsICryptoFIPSInfo.idl rename {netwerk/base => security/manager/ssl}/nsICryptoHMAC.idl (100%) rename {netwerk/base => security/manager/ssl}/nsICryptoHash.idl (100%) rename {netwerk/base => security/manager/ssl}/nsINSSErrorsService.idl (100%) diff --git a/netwerk/base/moz.build b/netwerk/base/moz.build index 22cf1d8f607d..79fa555f3eb7 100644 --- a/netwerk/base/moz.build +++ b/netwerk/base/moz.build @@ -35,9 +35,6 @@ XPIDL_SOURCES += [ 'nsIClassifiedChannel.idl', 'nsIClassOfService.idl', 'nsIContentSniffer.idl', - 'nsICryptoFIPSInfo.idl', - 'nsICryptoHash.idl', - 'nsICryptoHMAC.idl', 'nsIDashboard.idl', 'nsIDashboardEventNotifier.idl', 'nsIDeprecationWarner.idl', @@ -72,7 +69,6 @@ XPIDL_SOURCES += [ 'nsINetworkPredictor.idl', 'nsINetworkPredictorVerifier.idl', 'nsINetworkProperties.idl', - 'nsINSSErrorsService.idl', 'nsINullChannel.idl', 'nsIParentChannel.idl', 'nsIParentRedirectingChannel.idl', diff --git a/netwerk/base/nsICryptoFIPSInfo.idl b/netwerk/base/nsICryptoFIPSInfo.idl deleted file mode 100644 index 1defc56abc02..000000000000 --- a/netwerk/base/nsICryptoFIPSInfo.idl +++ /dev/null @@ -1,15 +0,0 @@ -/* 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(99e81922-7318-4431-b3aa-78b3cb4119bb)] -interface nsICryptoFIPSInfo : nsISupports -{ - readonly attribute boolean isFIPSModeActive; -}; - -%{C++ -#define NS_CRYPTO_FIPSINFO_SERVICE_CONTRACTID "@mozilla.org/crypto/fips-info-service;1" -%} diff --git a/security/manager/ssl/moz.build b/security/manager/ssl/moz.build index 3ccceb7882d3..7150867906bb 100644 --- a/security/manager/ssl/moz.build +++ b/security/manager/ssl/moz.build @@ -17,11 +17,14 @@ XPIDL_SOURCES += [ 'nsICertOverrideService.idl', 'nsIClientAuthDialogs.idl', 'nsIContentSignatureVerifier.idl', + 'nsICryptoHash.idl', + 'nsICryptoHMAC.idl', 'nsIDataSignatureVerifier.idl', 'nsIGenKeypairInfoDlg.idl', 'nsIKeygenThread.idl', 'nsIKeyModule.idl', 'nsILocalCertService.idl', + 'nsINSSErrorsService.idl', 'nsINSSU2FToken.idl', 'nsINSSVersion.idl', 'nsIPK11Token.idl', diff --git a/netwerk/base/nsICryptoHMAC.idl b/security/manager/ssl/nsICryptoHMAC.idl similarity index 100% rename from netwerk/base/nsICryptoHMAC.idl rename to security/manager/ssl/nsICryptoHMAC.idl diff --git a/netwerk/base/nsICryptoHash.idl b/security/manager/ssl/nsICryptoHash.idl similarity index 100% rename from netwerk/base/nsICryptoHash.idl rename to security/manager/ssl/nsICryptoHash.idl diff --git a/netwerk/base/nsINSSErrorsService.idl b/security/manager/ssl/nsINSSErrorsService.idl similarity index 100% rename from netwerk/base/nsINSSErrorsService.idl rename to security/manager/ssl/nsINSSErrorsService.idl diff --git a/security/manager/ssl/nsNSSModule.cpp b/security/manager/ssl/nsNSSModule.cpp index b6b7043113e6..fe2be7293597 100644 --- a/security/manager/ssl/nsNSSModule.cpp +++ b/security/manager/ssl/nsNSSModule.cpp @@ -246,7 +246,6 @@ static const mozilla::Module::ContractIDEntry kNSSContracts[] = { { NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID }, { NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID }, { "@mozilla.org/uriloader/psm-external-content-listener;1", &kNS_PSMCONTENTLISTEN_CID }, - { NS_CRYPTO_FIPSINFO_SERVICE_CONTRACTID, &kNS_PKCS11MODULEDB_CID }, { NS_NTLMAUTHMODULE_CONTRACTID, &kNS_NTLMAUTHMODULE_CID }, { NS_KEYMODULEOBJECT_CONTRACTID, &kNS_KEYMODULEOBJECT_CID }, { NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &kNS_KEYMODULEOBJECTFACTORY_CID }, diff --git a/security/manager/ssl/nsPKCS11Slot.cpp b/security/manager/ssl/nsPKCS11Slot.cpp index fb001b2de498..04973ad8b841 100644 --- a/security/manager/ssl/nsPKCS11Slot.cpp +++ b/security/manager/ssl/nsPKCS11Slot.cpp @@ -360,7 +360,7 @@ nsPKCS11Module::ListSlots(nsISimpleEnumerator** _retval) return array->Enumerate(_retval); } -NS_IMPL_ISUPPORTS(nsPKCS11ModuleDB, nsIPKCS11ModuleDB, nsICryptoFIPSInfo) +NS_IMPL_ISUPPORTS(nsPKCS11ModuleDB, nsIPKCS11ModuleDB) nsPKCS11ModuleDB::nsPKCS11ModuleDB() { @@ -565,9 +565,3 @@ nsPKCS11ModuleDB::GetIsFIPSEnabled(bool* aIsFIPSEnabled) *aIsFIPSEnabled = PK11_IsFIPS(); return NS_OK; } - -NS_IMETHODIMP -nsPKCS11ModuleDB::GetIsFIPSModeActive(bool* aIsFIPSModeActive) -{ - return GetIsFIPSEnabled(aIsFIPSModeActive); -} diff --git a/security/manager/ssl/nsPKCS11Slot.h b/security/manager/ssl/nsPKCS11Slot.h index 978df377c429..a34f5b9064c4 100644 --- a/security/manager/ssl/nsPKCS11Slot.h +++ b/security/manager/ssl/nsPKCS11Slot.h @@ -8,7 +8,6 @@ #define nsPKCS11Slot_h #include "ScopedNSSTypes.h" -#include "nsICryptoFIPSInfo.h" #include "nsIPKCS11Module.h" #include "nsIPKCS11ModuleDB.h" #include "nsIPKCS11Slot.h" @@ -64,13 +63,11 @@ private: }; class nsPKCS11ModuleDB : public nsIPKCS11ModuleDB - , public nsICryptoFIPSInfo , public nsNSSShutDownObject { public: NS_DECL_ISUPPORTS NS_DECL_NSIPKCS11MODULEDB - NS_DECL_NSICRYPTOFIPSINFO nsPKCS11ModuleDB();