2001-01-10 01:32:29 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-31 09:33:35 +00:00
|
|
|
* 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/. */
|
2001-01-10 01:32:29 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
#include "mozilla/ModuleUtils.h"
|
2001-01-10 01:32:29 +00:00
|
|
|
|
|
|
|
#include "nsNSSComponent.h"
|
|
|
|
#include "nsSSLSocketProvider.h"
|
|
|
|
#include "nsTLSSocketProvider.h"
|
2001-05-03 01:00:56 +00:00
|
|
|
#include "nsKeygenHandler.h"
|
2001-01-10 01:32:29 +00:00
|
|
|
|
2001-01-31 18:03:49 +00:00
|
|
|
#include "nsSDR.h"
|
|
|
|
|
2001-02-06 23:01:33 +00:00
|
|
|
#include "nsPK11TokenDB.h"
|
2001-05-15 20:40:28 +00:00
|
|
|
#include "nsPKCS11Slot.h"
|
2001-02-26 21:50:54 +00:00
|
|
|
#include "nsNSSCertificate.h"
|
2010-10-26 11:57:18 +00:00
|
|
|
#include "nsNSSCertificateFakeTransport.h"
|
2002-09-17 18:51:22 +00:00
|
|
|
#include "nsNSSCertificateDB.h"
|
2003-04-11 00:56:27 +00:00
|
|
|
#ifdef MOZ_XUL
|
2002-03-29 02:46:01 +00:00
|
|
|
#include "nsCertTree.h"
|
2003-04-11 00:56:27 +00:00
|
|
|
#endif
|
2001-05-15 23:15:12 +00:00
|
|
|
#include "nsCrypto.h"
|
2013-06-03 07:08:26 +00:00
|
|
|
#include "nsCryptoHash.h"
|
2001-05-15 23:15:12 +00:00
|
|
|
//For the NS_CRYPTO_CONTRACTID define
|
|
|
|
#include "nsDOMCID.h"
|
2013-06-22 22:57:15 +00:00
|
|
|
#include "nsNetCID.h"
|
2001-10-30 23:52:01 +00:00
|
|
|
#include "nsCertPicker.h"
|
2001-11-30 00:07:13 +00:00
|
|
|
#include "nsCURILoader.h"
|
|
|
|
#include "nsICategoryManager.h"
|
2003-11-18 02:20:34 +00:00
|
|
|
#include "nsNTLMAuthModule.h"
|
2006-08-12 06:39:47 +00:00
|
|
|
#include "nsKeyModule.h"
|
2007-09-03 17:32:39 +00:00
|
|
|
#include "nsDataSignatureVerifier.h"
|
2007-10-03 11:47:26 +00:00
|
|
|
#include "nsCertOverrideService.h"
|
2007-10-12 22:48:07 +00:00
|
|
|
#include "nsRandomGenerator.h"
|
2007-11-30 18:05:54 +00:00
|
|
|
#include "nsSSLStatus.h"
|
2012-04-30 04:00:22 +00:00
|
|
|
#include "TransportSecurityInfo.h"
|
2010-10-28 15:46:00 +00:00
|
|
|
#include "NSSErrorsService.h"
|
2012-03-01 16:29:48 +00:00
|
|
|
#include "nsNSSVersion.h"
|
2001-01-31 18:03:49 +00:00
|
|
|
|
2010-10-26 11:57:18 +00:00
|
|
|
#include "nsXULAppAPI.h"
|
2013-06-22 22:57:15 +00:00
|
|
|
|
|
|
|
#include "PSMContentListener.h"
|
|
|
|
|
2010-10-26 11:57:18 +00:00
|
|
|
#define NS_IS_PROCESS_DEFAULT \
|
|
|
|
(GeckoProcessType_Default == XRE_GetProcessType())
|
|
|
|
|
|
|
|
#define NS_NSS_INSTANTIATE(ensureOperator, _InstanceClass) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
_InstanceClass * inst; \
|
|
|
|
inst = new _InstanceClass(); \
|
|
|
|
NS_ADDREF(inst); \
|
|
|
|
rv = inst->QueryInterface(aIID, aResult); \
|
|
|
|
NS_RELEASE(inst); \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
|
|
|
#define NS_NSS_INSTANTIATE_INIT(ensureOperator, _InstanceClass, _InitMethod) \
|
|
|
|
PR_BEGIN_MACRO \
|
|
|
|
_InstanceClass * inst; \
|
|
|
|
inst = new _InstanceClass(); \
|
|
|
|
NS_ADDREF(inst); \
|
|
|
|
rv = inst->_InitMethod(); \
|
|
|
|
if(NS_SUCCEEDED(rv)) { \
|
|
|
|
rv = inst->QueryInterface(aIID, aResult); \
|
|
|
|
} \
|
|
|
|
NS_RELEASE(inst); \
|
|
|
|
PR_END_MACRO
|
|
|
|
|
|
|
|
|
|
|
|
#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(ensureOperator, \
|
|
|
|
_InstanceClass) \
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator, \
|
|
|
|
_InstanceClass, \
|
|
|
|
_InstanceClass)
|
|
|
|
|
2001-11-29 23:36:34 +00:00
|
|
|
// These two macros are ripped off from nsIGenericFactory.h and slightly
|
|
|
|
// modified.
|
2010-10-26 11:57:18 +00:00
|
|
|
#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator, \
|
|
|
|
_InstanceClassChrome, \
|
|
|
|
_InstanceClassContent) \
|
2010-06-10 18:11:40 +00:00
|
|
|
static nsresult \
|
2010-10-26 11:57:18 +00:00
|
|
|
_InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID, \
|
|
|
|
void **aResult) \
|
2001-11-29 23:36:34 +00:00
|
|
|
{ \
|
|
|
|
nsresult rv; \
|
|
|
|
\
|
2012-10-17 20:48:36 +00:00
|
|
|
*aResult = nullptr; \
|
|
|
|
if (nullptr != aOuter) { \
|
2001-11-29 23:36:34 +00:00
|
|
|
rv = NS_ERROR_NO_AGGREGATION; \
|
|
|
|
return rv; \
|
|
|
|
} \
|
|
|
|
\
|
2015-01-16 19:59:25 +00:00
|
|
|
if (!NS_IS_PROCESS_DEFAULT && \
|
|
|
|
ensureOperator == nssEnsureChromeOrContent) { \
|
|
|
|
if (!EnsureNSSInitializedChromeOrContent()) { \
|
|
|
|
return NS_ERROR_FAILURE; \
|
|
|
|
} \
|
|
|
|
} else if (!EnsureNSSInitialized(ensureOperator)) { \
|
2010-10-26 11:57:18 +00:00
|
|
|
return NS_ERROR_FAILURE; \
|
2015-01-16 19:59:25 +00:00
|
|
|
} \
|
2009-02-28 14:06:40 +00:00
|
|
|
\
|
2010-10-26 11:57:18 +00:00
|
|
|
if (NS_IS_PROCESS_DEFAULT) \
|
|
|
|
NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassChrome); \
|
|
|
|
else \
|
|
|
|
NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassContent); \
|
2001-11-29 23:36:34 +00:00
|
|
|
\
|
2010-10-26 11:57:18 +00:00
|
|
|
if (ensureOperator == nssLoadingComponent) \
|
2009-02-28 14:06:40 +00:00
|
|
|
{ \
|
|
|
|
if (NS_SUCCEEDED(rv)) \
|
|
|
|
EnsureNSSInitialized(nssInitSucceeded); \
|
|
|
|
else \
|
|
|
|
EnsureNSSInitialized(nssInitFailed); \
|
|
|
|
} \
|
|
|
|
\
|
2001-11-29 23:36:34 +00:00
|
|
|
return rv; \
|
2010-10-26 11:57:18 +00:00
|
|
|
}
|
2001-11-29 23:36:34 +00:00
|
|
|
|
|
|
|
|
2010-10-26 11:57:18 +00:00
|
|
|
#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ensureOperator, \
|
|
|
|
_InstanceClass, \
|
|
|
|
_InitMethod) \
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator, \
|
|
|
|
_InstanceClass, \
|
|
|
|
_InstanceClass, \
|
|
|
|
_InitMethod)
|
|
|
|
|
|
|
|
#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator, \
|
|
|
|
_InstanceClassChrome, \
|
|
|
|
_InstanceClassContent, \
|
|
|
|
_InitMethod) \
|
2010-06-10 18:11:40 +00:00
|
|
|
static nsresult \
|
2010-10-26 11:57:18 +00:00
|
|
|
_InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID, \
|
|
|
|
void **aResult) \
|
2001-11-29 23:36:34 +00:00
|
|
|
{ \
|
|
|
|
nsresult rv; \
|
|
|
|
\
|
2015-04-22 11:44:23 +00:00
|
|
|
*aResult = nullptr; \
|
|
|
|
if (nullptr != aOuter) { \
|
2001-11-29 23:36:34 +00:00
|
|
|
rv = NS_ERROR_NO_AGGREGATION; \
|
|
|
|
return rv; \
|
|
|
|
} \
|
|
|
|
\
|
2015-04-22 11:44:23 +00:00
|
|
|
if (!EnsureNSSInitialized(ensureOperator)) \
|
2010-10-26 11:57:18 +00:00
|
|
|
return NS_ERROR_FAILURE; \
|
2009-02-28 14:06:40 +00:00
|
|
|
\
|
2010-10-26 11:57:18 +00:00
|
|
|
if (NS_IS_PROCESS_DEFAULT) \
|
|
|
|
NS_NSS_INSTANTIATE_INIT(ensureOperator, \
|
|
|
|
_InstanceClassChrome, \
|
|
|
|
_InitMethod); \
|
|
|
|
else \
|
|
|
|
NS_NSS_INSTANTIATE_INIT(ensureOperator, \
|
|
|
|
_InstanceClassContent, \
|
|
|
|
_InitMethod); \
|
2001-11-29 23:36:34 +00:00
|
|
|
\
|
2010-10-26 11:57:18 +00:00
|
|
|
if (ensureOperator == nssLoadingComponent) \
|
2009-02-28 14:06:40 +00:00
|
|
|
{ \
|
|
|
|
if (NS_SUCCEEDED(rv)) \
|
|
|
|
EnsureNSSInitialized(nssInitSucceeded); \
|
|
|
|
else \
|
|
|
|
EnsureNSSInitialized(nssInitFailed); \
|
|
|
|
} \
|
|
|
|
\
|
2001-11-29 23:36:34 +00:00
|
|
|
return rv; \
|
2010-10-26 11:57:18 +00:00
|
|
|
}
|
2001-11-29 23:36:34 +00:00
|
|
|
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssLoadingComponent, nsNSSComponent,
|
|
|
|
Init)
|
2001-11-29 23:36:34 +00:00
|
|
|
|
2012-04-30 04:00:22 +00:00
|
|
|
using namespace mozilla::psm;
|
2015-03-03 14:51:05 +00:00
|
|
|
|
2012-04-30 04:00:22 +00:00
|
|
|
namespace {
|
|
|
|
|
2001-11-29 23:36:34 +00:00
|
|
|
// Use the special factory constructor for everything this module implements,
|
|
|
|
// because all code could potentially require the NSS library.
|
|
|
|
// Our factory constructor takes an additional boolean parameter.
|
2011-10-17 14:59:28 +00:00
|
|
|
// Only for the nsNSSComponent, set this to true.
|
|
|
|
// All other classes must have this set to false.
|
2001-11-29 23:36:34 +00:00
|
|
|
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSSLSocketProvider)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsTLSSocketProvider)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSecretDecoderRing)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPK11TokenDB)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPKCS11ModuleDB)
|
2015-04-22 11:44:23 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, PSMContentListener, init)
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(nssEnsureOnChromeOnly,
|
|
|
|
nsNSSCertificate,
|
|
|
|
nsNSSCertificateFakeTransport)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsNSSCertificateDB)
|
2014-09-16 22:49:37 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(nssEnsureOnChromeOnly,
|
|
|
|
nsNSSCertList,
|
|
|
|
nsNSSCertListFakeTransport)
|
2003-04-11 00:56:27 +00:00
|
|
|
#ifdef MOZ_XUL
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertTree)
|
2003-04-11 00:56:27 +00:00
|
|
|
#endif
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPkcs11)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertPicker)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsNTLMAuthModule, InitTest)
|
2015-01-16 19:59:25 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureChromeOrContent, nsCryptoHash)
|
2015-03-03 14:51:05 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureChromeOrContent, nsCryptoHMAC)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureChromeOrContent, nsKeyObject)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureChromeOrContent, nsKeyObjectFactory)
|
2010-10-26 11:57:18 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsDataSignatureVerifier)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsRandomGenerator)
|
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, nsSSLStatus)
|
2012-04-30 04:00:22 +00:00
|
|
|
NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, TransportSecurityInfo)
|
2001-01-10 01:32:29 +00:00
|
|
|
|
2010-10-28 15:46:00 +00:00
|
|
|
typedef mozilla::psm::NSSErrorsService NSSErrorsService;
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NSSErrorsService, Init)
|
2012-03-01 16:29:48 +00:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSVersion)
|
2014-10-24 17:46:30 +00:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsCertOverrideService, Init)
|
2010-10-28 15:46:00 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_NSSCOMPONENT_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_SSLSOCKETPROVIDER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_STARTTLSSOCKETPROVIDER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_SDR_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PK11TOKENDB_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PKCS11MODULEDB_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_PSMCONTENTLISTEN_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_X509CERT_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_X509CERTDB_CID);
|
2014-02-04 06:25:50 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_X509CERTLIST_CID);
|
2010-06-10 18:11:40 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_FORMPROCESSOR_CID);
|
2003-04-11 00:56:27 +00:00
|
|
|
#ifdef MOZ_XUL
|
2010-06-10 18:11:40 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_CERTTREE_CID);
|
2003-04-11 00:56:27 +00:00
|
|
|
#endif
|
2010-06-10 18:11:40 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_PKCS11_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CRYPTO_HASH_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CRYPTO_HMAC_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CERT_PICKER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_NTLMAUTHMODULE_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECT_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECTFACTORY_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_DATASIGNATUREVERIFIER_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_CERTOVERRIDE_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_RANDOMGENERATOR_CID);
|
|
|
|
NS_DEFINE_NAMED_CID(NS_SSLSTATUS_CID);
|
2012-04-30 04:00:22 +00:00
|
|
|
NS_DEFINE_NAMED_CID(TRANSPORTSECURITYINFO_CID);
|
2010-10-28 15:46:00 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_NSSERRORSSERVICE_CID);
|
2012-03-01 16:29:48 +00:00
|
|
|
NS_DEFINE_NAMED_CID(NS_NSSVERSION_CID);
|
2010-06-10 18:11:40 +00:00
|
|
|
|
|
|
|
static const mozilla::Module::CIDEntry kNSSCIDs[] = {
|
2012-10-17 20:48:36 +00:00
|
|
|
{ &kNS_NSSCOMPONENT_CID, false, nullptr, nsNSSComponentConstructor },
|
|
|
|
{ &kNS_SSLSOCKETPROVIDER_CID, false, nullptr, nsSSLSocketProviderConstructor },
|
|
|
|
{ &kNS_STARTTLSSOCKETPROVIDER_CID, false, nullptr, nsTLSSocketProviderConstructor },
|
|
|
|
{ &kNS_SDR_CID, false, nullptr, nsSecretDecoderRingConstructor },
|
|
|
|
{ &kNS_PK11TOKENDB_CID, false, nullptr, nsPK11TokenDBConstructor },
|
|
|
|
{ &kNS_PKCS11MODULEDB_CID, false, nullptr, nsPKCS11ModuleDBConstructor },
|
|
|
|
{ &kNS_PSMCONTENTLISTEN_CID, false, nullptr, PSMContentListenerConstructor },
|
|
|
|
{ &kNS_X509CERT_CID, false, nullptr, nsNSSCertificateConstructor },
|
|
|
|
{ &kNS_X509CERTDB_CID, false, nullptr, nsNSSCertificateDBConstructor },
|
2014-02-04 06:25:50 +00:00
|
|
|
{ &kNS_X509CERTLIST_CID, false, nullptr, nsNSSCertListConstructor },
|
2012-10-17 20:48:36 +00:00
|
|
|
{ &kNS_FORMPROCESSOR_CID, false, nullptr, nsKeygenFormProcessor::Create },
|
2010-06-10 18:11:40 +00:00
|
|
|
#ifdef MOZ_XUL
|
2012-10-17 20:48:36 +00:00
|
|
|
{ &kNS_CERTTREE_CID, false, nullptr, nsCertTreeConstructor },
|
2010-06-10 18:11:40 +00:00
|
|
|
#endif
|
2012-10-17 20:48:36 +00:00
|
|
|
{ &kNS_PKCS11_CID, false, nullptr, nsPkcs11Constructor },
|
|
|
|
{ &kNS_CRYPTO_HASH_CID, false, nullptr, nsCryptoHashConstructor },
|
|
|
|
{ &kNS_CRYPTO_HMAC_CID, false, nullptr, nsCryptoHMACConstructor },
|
|
|
|
{ &kNS_CERT_PICKER_CID, false, nullptr, nsCertPickerConstructor },
|
|
|
|
{ &kNS_NTLMAUTHMODULE_CID, false, nullptr, nsNTLMAuthModuleConstructor },
|
|
|
|
{ &kNS_KEYMODULEOBJECT_CID, false, nullptr, nsKeyObjectConstructor },
|
|
|
|
{ &kNS_KEYMODULEOBJECTFACTORY_CID, false, nullptr, nsKeyObjectFactoryConstructor },
|
|
|
|
{ &kNS_DATASIGNATUREVERIFIER_CID, false, nullptr, nsDataSignatureVerifierConstructor },
|
|
|
|
{ &kNS_CERTOVERRIDE_CID, false, nullptr, nsCertOverrideServiceConstructor },
|
|
|
|
{ &kNS_RANDOMGENERATOR_CID, false, nullptr, nsRandomGeneratorConstructor },
|
|
|
|
{ &kNS_SSLSTATUS_CID, false, nullptr, nsSSLStatusConstructor },
|
|
|
|
{ &kTRANSPORTSECURITYINFO_CID, false, nullptr, TransportSecurityInfoConstructor },
|
|
|
|
{ &kNS_NSSERRORSSERVICE_CID, false, nullptr, NSSErrorsServiceConstructor },
|
|
|
|
{ &kNS_NSSVERSION_CID, false, nullptr, nsNSSVersionConstructor },
|
|
|
|
{ nullptr }
|
2010-06-10 18:11:40 +00:00
|
|
|
};
|
2007-10-19 19:16:34 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
static const mozilla::Module::ContractIDEntry kNSSContracts[] = {
|
|
|
|
{ PSM_COMPONENT_CONTRACTID, &kNS_NSSCOMPONENT_CID },
|
2010-10-28 15:46:00 +00:00
|
|
|
{ NS_NSS_ERRORS_SERVICE_CONTRACTID, &kNS_NSSERRORSSERVICE_CID },
|
2012-03-01 16:29:48 +00:00
|
|
|
{ NS_NSSVERSION_CONTRACTID, &kNS_NSSVERSION_CID },
|
2010-06-10 18:11:40 +00:00
|
|
|
{ NS_SSLSOCKETPROVIDER_CONTRACTID, &kNS_SSLSOCKETPROVIDER_CID },
|
|
|
|
{ NS_STARTTLSSOCKETPROVIDER_CONTRACTID, &kNS_STARTTLSSOCKETPROVIDER_CID },
|
|
|
|
{ NS_SDR_CONTRACTID, &kNS_SDR_CID },
|
|
|
|
{ NS_PK11TOKENDB_CONTRACTID, &kNS_PK11TOKENDB_CID },
|
|
|
|
{ NS_PKCS11MODULEDB_CONTRACTID, &kNS_PKCS11MODULEDB_CID },
|
|
|
|
{ NS_PSMCONTENTLISTEN_CONTRACTID, &kNS_PSMCONTENTLISTEN_CID },
|
|
|
|
{ NS_X509CERTDB_CONTRACTID, &kNS_X509CERTDB_CID },
|
2014-02-04 06:25:50 +00:00
|
|
|
{ NS_X509CERTLIST_CONTRACTID, &kNS_X509CERTLIST_CID },
|
2010-06-10 18:11:40 +00:00
|
|
|
{ NS_FORMPROCESSOR_CONTRACTID, &kNS_FORMPROCESSOR_CID },
|
|
|
|
#ifdef MOZ_XUL
|
|
|
|
{ NS_CERTTREE_CONTRACTID, &kNS_CERTTREE_CID },
|
|
|
|
#endif
|
|
|
|
{ NS_PKCS11_CONTRACTID, &kNS_PKCS11_CID },
|
|
|
|
{ NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID },
|
|
|
|
{ NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID },
|
|
|
|
{ NS_CERT_PICKER_CONTRACTID, &kNS_CERT_PICKER_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 },
|
|
|
|
{ NS_DATASIGNATUREVERIFIER_CONTRACTID, &kNS_DATASIGNATUREVERIFIER_CID },
|
|
|
|
{ NS_CERTOVERRIDE_CONTRACTID, &kNS_CERTOVERRIDE_CID },
|
|
|
|
{ NS_RANDOMGENERATOR_CONTRACTID, &kNS_RANDOMGENERATOR_CID },
|
2012-10-17 20:48:36 +00:00
|
|
|
{ nullptr }
|
2010-06-10 18:11:40 +00:00
|
|
|
};
|
2007-11-30 18:05:54 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
static const mozilla::Module::CategoryEntry kNSSCategories[] = {
|
|
|
|
{ NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-ca-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
|
|
|
|
{ NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-server-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
|
|
|
|
{ NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-user-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
|
|
|
|
{ NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-email-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
|
2012-10-17 20:48:36 +00:00
|
|
|
{ nullptr }
|
2010-06-10 18:11:40 +00:00
|
|
|
};
|
2007-11-30 18:05:54 +00:00
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
static const mozilla::Module kNSSModule = {
|
|
|
|
mozilla::Module::kVersion,
|
|
|
|
kNSSCIDs,
|
|
|
|
kNSSContracts,
|
|
|
|
kNSSCategories
|
2001-01-10 01:32:29 +00:00
|
|
|
};
|
|
|
|
|
2012-04-30 04:00:22 +00:00
|
|
|
} // unnamed namespace
|
|
|
|
|
2010-06-10 18:11:40 +00:00
|
|
|
NSMODULE_DEFN(NSS) = &kNSSModule;
|