diff --git a/netwerk/base/public/MANIFEST_IDL b/netwerk/base/public/MANIFEST_IDL index decb4500be33..2421ac87fbfa 100644 --- a/netwerk/base/public/MANIFEST_IDL +++ b/netwerk/base/public/MANIFEST_IDL @@ -50,6 +50,5 @@ nsIWebFilters.idl nsISecurityEventSink.idl nsISecretDecoderRing.idl nsISecureBrowserUI.idl -nsISecurityManagerComponent.idl nsIByteRangeRequest.idl nsIMultiPartChannel.idl diff --git a/netwerk/base/public/Makefile.in b/netwerk/base/public/Makefile.in index 5dc55bff970f..b476463d1873 100644 --- a/netwerk/base/public/Makefile.in +++ b/netwerk/base/public/Makefile.in @@ -87,7 +87,6 @@ XPIDLSRCS = \ nsISecurityEventSink.idl \ nsISecretDecoderRing.idl \ nsISecureBrowserUI.idl \ - nsISecurityManagerComponent.idl \ nsICachingChannel.idl \ nsIByteRangeRequest.idl \ nsIMultiPartChannel.idl \ diff --git a/netwerk/base/public/nsISecurityManagerComponent.idl b/netwerk/base/public/nsISecurityManagerComponent.idl deleted file mode 100644 index a63d50ea1811..000000000000 --- a/netwerk/base/public/nsISecurityManagerComponent.idl +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * Hubbie Shaw - * Doug Turner - * Mitch Stoltz - * Brian Ryner -*/ - -#include "nsISupports.idl" - -[scriptable, uuid(3ef604be-1dd2-11b2-92cc-faae57e1901a)] -interface nsISecurityManagerComponent : nsISupports -{ - - /** - * Display the Security Advisor. - */ - - string GetPassword(); - void displaySecurityAdvisor(); - -}; - -%{C++ -#define PSM_COMPONENT_CONTRACTID "@mozilla.org/psm;1" -#define PSM_COMPONENT_CLASSNAME "Mozilla PSM Component" -%} - diff --git a/netwerk/macbuild/netwerkIDL.xml b/netwerk/macbuild/netwerkIDL.xml index 57f7bc3581b4..e2098d9a28fa 100644 --- a/netwerk/macbuild/netwerkIDL.xml +++ b/netwerk/macbuild/netwerkIDL.xml @@ -1253,13 +1253,6 @@ Text - - Name - nsISecurityManagerComponent.idl - MacOS - Text - - Name nsISSLSocketProvider.idl @@ -1802,11 +1795,6 @@ nsISecureBrowserUI.idl MacOS - - Name - nsISecurityManagerComponent.idl - MacOS - Name nsISSLSocketProvider.idl @@ -3177,13 +3165,6 @@ Text - - Name - nsISecurityManagerComponent.idl - MacOS - Text - - Name nsISSLSocketProvider.idl @@ -3721,11 +3702,6 @@ nsISecureBrowserUI.idl MacOS - - Name - nsISecurityManagerComponent.idl - MacOS - Name nsISSLSocketProvider.idl @@ -4142,12 +4118,6 @@ nsISecureBrowserUI.idl MacOS - - headers - Name - nsISecurityManagerComponent.idl - MacOS - headers Name diff --git a/security/manager/ssl/src/nsCrypto.cpp b/security/manager/ssl/src/nsCrypto.cpp index 1798488edbc1..9b33cb0d8151 100644 --- a/security/manager/ssl/src/nsCrypto.cpp +++ b/security/manager/ssl/src/nsCrypto.cpp @@ -1447,10 +1447,6 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMFObject** aReturn) nrv = holder->GetJSObject(&script_obj); NS_ENSURE_SUCCESS(nrv, nrv); - // Before doing this, lets' make sure the NSS Component has - // initialized itself. - nsCOMPtr nss = - do_GetService(PSM_COMPONENT_CONTRACTID); //Put up some UI warning that someone is trying to //escrow the private key. //Don't addref this copy. That way ths reference goes away @@ -2039,8 +2035,6 @@ nsCrypto::Alert(const nsAString& aMessage) NS_IMETHODIMP nsCrypto::Logout() { - nsCOMPtr nss = - do_GetService(PSM_COMPONENT_CONTRACTID); PK11_LogoutAll(); return NS_OK; } diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp index 86f86395ca14..d4be0880932d 100644 --- a/security/manager/ssl/src/nsNSSComponent.cpp +++ b/security/manager/ssl/src/nsNSSComponent.cpp @@ -1098,21 +1098,13 @@ nsNSSComponent::Init() } /* nsISupports Implementation for the class */ -NS_IMPL_THREADSAFE_ISUPPORTS6(nsNSSComponent, - nsISecurityManagerComponent, +NS_IMPL_THREADSAFE_ISUPPORTS5(nsNSSComponent, nsISignatureVerifier, nsIEntropyCollector, nsINSSComponent, nsIObserver, nsISupportsWeakReference); -NS_IMETHODIMP -nsNSSComponent::DisplaySecurityAdvisor() -{ - return NS_ERROR_NOT_IMPLEMENTED; // not implemented -} - - //--------------------------------------------- // Functions Implementing nsISignatureVerifier //--------------------------------------------- @@ -1144,15 +1136,6 @@ nsNSSComponent::HashEnd(HASHContext* ctx, unsigned char** hash, return NS_OK; } -NS_IMETHODIMP -nsNSSComponent::GetPassword(char **aRet) -{ - // This functionality is only used in wallet. - // This interface can go away once we get rid of PSM 1.x. - *aRet = nsnull; - return NS_OK; -} - /* Callback functions for decoder. For now, use empty/default functions. */ static void ContentCallback(void *arg, const char *buf, @@ -1611,7 +1594,6 @@ PSMContentDownloader::PSMContentDownloader(PRUint32 type) mDoSilentDownload(PR_FALSE) { NS_INIT_ISUPPORTS(); - mNSS = do_GetService(PSM_COMPONENT_CONTRACTID); } PSMContentDownloader::~PSMContentDownloader() diff --git a/security/manager/ssl/src/nsNSSComponent.h b/security/manager/ssl/src/nsNSSComponent.h index 9bcc006a0c4f..2bf29f3ef05c 100644 --- a/security/manager/ssl/src/nsNSSComponent.h +++ b/security/manager/ssl/src/nsNSSComponent.h @@ -28,7 +28,6 @@ #define _nsNSSComponent_h_ #include "nsCOMPtr.h" -#include "nsISecurityManagerComponent.h" #include "nsISignatureVerifier.h" #include "nsIURIContentListener.h" #include "nsIStreamListener.h" @@ -50,6 +49,9 @@ #define NS_NSSCOMPONENT_CID \ {0xa277189c, 0x1dd1, 0x11b2, {0xa8, 0xc9, 0xe4, 0xe8, 0xbf, 0xb1, 0x33, 0x8e}} +#define PSM_COMPONENT_CONTRACTID "@mozilla.org/psm;1" +#define PSM_COMPONENT_CLASSNAME "Mozilla PSM Component" + //Define an interface that we can use to look up from the //callbacks passed to NSS. @@ -91,7 +93,6 @@ protected: PRUint32 mType; PRBool mDoSilentDownload; nsAutoString mCrlAutoDownloadKey; - nsCOMPtr mNSS; nsCOMPtr mURI; nsresult handleContentDownloadError(nsresult errCode); }; @@ -130,8 +131,7 @@ class NS_NO_VTABLE nsINSSComponent : public nsISupports { struct PRLock; // Implementation of the PSM component interface. -class nsNSSComponent : public nsISecurityManagerComponent, - public nsISignatureVerifier, +class nsNSSComponent : public nsISignatureVerifier, public nsIEntropyCollector, public nsINSSComponent, public nsIObserver, @@ -145,7 +145,6 @@ public: virtual ~nsNSSComponent(); NS_DECL_ISUPPORTS - NS_DECL_NSISECURITYMANAGERCOMPONENT NS_DECL_NSISIGNATUREVERIFIER NS_DECL_NSIENTROPYCOLLECTOR NS_DECL_NSIOBSERVER diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index bdc2d055de0d..687fd5739b7d 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -42,7 +42,6 @@ #include "prnetdb.h" #include "nsIPrompt.h" #include "nsIPref.h" -#include "nsISecurityManagerComponent.h" #include "nsIServiceManager.h" #include "nsIWebProgressListener.h" #include "nsIChannel.h" @@ -1110,7 +1109,7 @@ nsSSLIOLayerWrite(PRFileDesc* fd, const void* buf, PRInt32 amount) return bytesWritten; } -nsresult InitNSSMethods() +static void InitNSSMethods() { nsSSLIOLayerIdentity = PR_GetUniqueIdentity("NSS layer"); nsSSLIOLayerMethods = *PR_GetDefaultIOMethods(); @@ -1120,14 +1119,6 @@ nsresult InitNSSMethods() nsSSLIOLayerMethods.available = nsSSLIOLayerAvailable; nsSSLIOLayerMethods.write = nsSSLIOLayerWrite; nsSSLIOLayerMethods.read = nsSSLIOLayerRead; - - /* Make sure NSS has been loaded. - * We rely on the NSS component to keep itself loaded - * until the application shuts down. - */ - nsresult rv; - nsCOMPtr loader = do_GetService(PSM_COMPONENT_CONTRACTID, &rv); - return rv; } nsresult @@ -1141,8 +1132,7 @@ nsSSLIOLayerNewSocket(const char *host, { // XXX - this code is duplicated in nsSSLIOLayerAddToSocket if (firstTime) { - nsresult rv = InitNSSMethods(); - if (NS_FAILED(rv)) return rv; + InitNSSMethods(); gTLSIntolerantSites = new nsHashtable(16, PR_TRUE); if (!gTLSIntolerantSites) return NS_ERROR_OUT_OF_MEMORY; firstTime = PR_FALSE; @@ -2229,8 +2219,7 @@ nsSSLIOLayerAddToSocket(const char* host, // XXX - this code is duplicated in nsSSLIONewSocket if (firstTime) { - rv = InitNSSMethods(); - if (NS_FAILED(rv)) return rv; + InitNSSMethods(); gTLSIntolerantSites = new nsHashtable(16, PR_TRUE); if (!gTLSIntolerantSites) return NS_ERROR_OUT_OF_MEMORY; firstTime = PR_FALSE; diff --git a/security/manager/ssl/src/nsNSSModule.cpp b/security/manager/ssl/src/nsNSSModule.cpp index 27c8641154fe..89789cfd55a5 100644 --- a/security/manager/ssl/src/nsNSSModule.cpp +++ b/security/manager/ssl/src/nsNSSModule.cpp @@ -61,7 +61,7 @@ static void EnsureNSSInitialized(PRBool triggeredByNSSComponent) haveLoaded = PR_TRUE; if (triggeredByNSSComponent) { - // Me must prevent a recursion, as nsNSSComponent creates + // We must prevent a recursion, as nsNSSComponent creates // additional instances return; } diff --git a/security/manager/ssl/src/nsSDR.cpp b/security/manager/ssl/src/nsSDR.cpp index 289fca60cdd2..255e39dc1740 100644 --- a/security/manager/ssl/src/nsSDR.cpp +++ b/security/manager/ssl/src/nsSDR.cpp @@ -32,7 +32,6 @@ #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIServiceManager.h" -#include "nsISecurityManagerComponent.h" #include "nsIWindowWatcher.h" #include "nsIPrompt.h" #include "nsProxiedService.h" @@ -107,10 +106,6 @@ nsSecretDecoderRing::nsSecretDecoderRing() { // initialize superclass NS_INIT_ISUPPORTS(); - - // (Possibly) create the Security Manager component to get things - // initialized - nsCOMPtr nss = do_GetService(PSM_COMPONENT_CONTRACTID); } // nsSecretDecoderRing destructor