PageRenderTime 126ms CodeModel.GetById 82ms app.highlight 38ms RepoModel.GetById 1ms app.codeStats 1ms

/security/manager/ssl/src/nsNSSModule.cpp

http://github.com/zpao/v8monkey
C++ | 389 lines | 315 code | 25 blank | 49 comment | 28 complexity | b087a265f0971236e899cf70257ef2e5 MD5 | raw file
  1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2 *
  3 * ***** BEGIN LICENSE BLOCK *****
  4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5 *
  6 * The contents of this file are subject to the Mozilla Public License Version
  7 * 1.1 (the "License"); you may not use this file except in compliance with
  8 * the License. You may obtain a copy of the License at
  9 * http://www.mozilla.org/MPL/
 10 *
 11 * Software distributed under the License is distributed on an "AS IS" basis,
 12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 13 * for the specific language governing rights and limitations under the
 14 * License.
 15 *
 16 * The Original Code is mozilla.org code.
 17 *
 18 * The Initial Developer of the Original Code is
 19 * Netscape Communications Corporation.
 20 * Portions created by the Initial Developer are Copyright (C) 1998
 21 * the Initial Developer. All Rights Reserved.
 22 *
 23 * Contributor(s):
 24 *   Hubbie Shaw
 25 *   Doug Turner <dougt@netscape.com>
 26 *   Brian Ryner <bryner@brianryner.com>
 27 *   Kai Engert <kengert@redhat.com>
 28 *
 29 * Alternatively, the contents of this file may be used under the terms of
 30 * either the GNU General Public License Version 2 or later (the "GPL"), or
 31 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 32 * in which case the provisions of the GPL or the LGPL are applicable instead
 33 * of those above. If you wish to allow use of your version of this file only
 34 * under the terms of either the GPL or the LGPL, and not to allow others to
 35 * use your version of this file under the terms of the MPL, indicate your
 36 * decision by deleting the provisions above and replace them with the notice
 37 * and other provisions required by the GPL or the LGPL. If you do not delete
 38 * the provisions above, a recipient may use your version of this file under
 39 * the terms of any one of the MPL, the GPL or the LGPL.
 40 *
 41 * ***** END LICENSE BLOCK ***** */
 42
 43#include "mozilla/ModuleUtils.h"
 44
 45#include "nsNSSComponent.h"
 46#include "nsSSLSocketProvider.h"
 47#include "nsTLSSocketProvider.h"
 48#include "nsKeygenHandler.h"
 49
 50#include "nsSDR.h"
 51
 52#include "nsPK11TokenDB.h"
 53#include "nsPKCS11Slot.h"
 54#include "nsNSSCertificate.h"
 55#include "nsNSSCertificateFakeTransport.h"
 56#include "nsNSSCertificateDB.h"
 57#include "nsNSSCertCache.h"
 58#include "nsCMS.h"
 59#ifdef MOZ_XUL
 60#include "nsCertTree.h"
 61#endif
 62#include "nsCrypto.h"
 63//For the NS_CRYPTO_CONTRACTID define
 64#include "nsDOMCID.h"
 65
 66#include "nsCMSSecureMessage.h"
 67#include "nsCertPicker.h"
 68#include "nsCURILoader.h"
 69#include "nsICategoryManager.h"
 70#include "nsCRLManager.h"
 71#include "nsNTLMAuthModule.h"
 72#include "nsStreamCipher.h"
 73#include "nsKeyModule.h"
 74#include "nsDataSignatureVerifier.h"
 75#include "nsCertOverrideService.h"
 76#include "nsRandomGenerator.h"
 77#include "nsRecentBadCerts.h"
 78#include "nsSSLStatus.h"
 79#include "nsNSSIOLayer.h"
 80#include "NSSErrorsService.h"
 81
 82#include "nsXULAppAPI.h"
 83#define NS_IS_PROCESS_DEFAULT                                                 \
 84    (GeckoProcessType_Default == XRE_GetProcessType())
 85
 86#define NS_NSS_INSTANTIATE(ensureOperator, _InstanceClass)                    \
 87    PR_BEGIN_MACRO                                                            \
 88        _InstanceClass * inst;                                                \
 89        inst = new _InstanceClass();                                          \
 90        if (NULL == inst) {                                                   \
 91            if (ensureOperator == nssLoadingComponent)                        \
 92                EnsureNSSInitialized(nssInitFailed);                          \
 93            rv = NS_ERROR_OUT_OF_MEMORY;                                      \
 94            return rv;                                                        \
 95        }                                                                     \
 96        NS_ADDREF(inst);                                                      \
 97        rv = inst->QueryInterface(aIID, aResult);                             \
 98        NS_RELEASE(inst);                                                     \
 99    PR_END_MACRO
100
101#define NS_NSS_INSTANTIATE_INIT(ensureOperator, _InstanceClass, _InitMethod)  \
102    PR_BEGIN_MACRO                                                            \
103        _InstanceClass * inst;                                                \
104        inst = new _InstanceClass();                                          \
105        if (NULL == inst) {                                                   \
106            if (ensureOperator == nssLoadingComponent)                        \
107                EnsureNSSInitialized(nssInitFailed);                          \
108            rv = NS_ERROR_OUT_OF_MEMORY;                                      \
109            return rv;                                                        \
110        }                                                                     \
111        NS_ADDREF(inst);                                                      \
112        rv = inst->_InitMethod();                                             \
113        if(NS_SUCCEEDED(rv)) {                                                \
114            rv = inst->QueryInterface(aIID, aResult);                         \
115        }                                                                     \
116        NS_RELEASE(inst);                                                     \
117   PR_END_MACRO
118
119
120#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(ensureOperator,                    \
121                                           _InstanceClass)                    \
122   NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator,               \
123                                                _InstanceClass,               \
124                                                _InstanceClass)
125
126// These two macros are ripped off from nsIGenericFactory.h and slightly
127// modified.
128#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator,          \
129                                                     _InstanceClassChrome,    \
130                                                     _InstanceClassContent)   \
131static nsresult                                                               \
132_InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID,         \
133                                  void **aResult)                             \
134{                                                                             \
135    nsresult rv;                                                              \
136                                                                              \
137    *aResult = NULL;                                                          \
138    if (NULL != aOuter) {                                                     \
139        rv = NS_ERROR_NO_AGGREGATION;                                         \
140        return rv;                                                            \
141    }                                                                         \
142                                                                              \
143    if (!EnsureNSSInitialized(ensureOperator))                                \
144        return NS_ERROR_FAILURE;                                              \
145                                                                              \
146    if (NS_IS_PROCESS_DEFAULT)                                                \
147        NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassChrome);             \
148    else                                                                      \
149        NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassContent);            \
150                                                                              \
151    if (ensureOperator == nssLoadingComponent)                                \
152    {                                                                         \
153        if (NS_SUCCEEDED(rv))                                                 \
154            EnsureNSSInitialized(nssInitSucceeded);                           \
155        else                                                                  \
156            EnsureNSSInitialized(nssInitFailed);                              \
157    }                                                                         \
158                                                                              \
159    return rv;                                                                \
160}
161
162 
163#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ensureOperator,               \
164                                                _InstanceClass,               \
165                                                _InitMethod)                  \
166    NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator,         \
167                                                      _InstanceClass,         \
168                                                      _InstanceClass,         \
169                                                      _InitMethod)
170
171#define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator,     \
172                                                _InstanceClassChrome,         \
173                                                _InstanceClassContent,        \
174                                                _InitMethod)                  \
175static nsresult                                                               \
176_InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID,         \
177                                  void **aResult)                             \
178{                                                                             \
179    nsresult rv;                                                              \
180                                                                              \
181    *aResult = NULL;                                                          \
182    if (NULL != aOuter) {                                                     \
183        rv = NS_ERROR_NO_AGGREGATION;                                         \
184        return rv;                                                            \
185    }                                                                         \
186                                                                              \
187    if (!EnsureNSSInitialized(ensureOperator))                                \
188        return NS_ERROR_FAILURE;                                              \
189                                                                              \
190    if (NS_IS_PROCESS_DEFAULT)                                                \
191        NS_NSS_INSTANTIATE_INIT(ensureOperator,                               \
192                                _InstanceClassChrome,                         \
193                                _InitMethod);                                 \
194    else                                                                      \
195        NS_NSS_INSTANTIATE_INIT(ensureOperator,                               \
196                                _InstanceClassContent,                        \
197                                _InitMethod);                                 \
198                                                                              \
199    if (ensureOperator == nssLoadingComponent)                                \
200    {                                                                         \
201        if (NS_SUCCEEDED(rv))                                                 \
202            EnsureNSSInitialized(nssInitSucceeded);                           \
203        else                                                                  \
204            EnsureNSSInitialized(nssInitFailed);                              \
205    }                                                                         \
206                                                                              \
207    return rv;                                                                \
208}
209
210NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssLoadingComponent, nsNSSComponent,
211                                        Init)
212
213// Use the special factory constructor for everything this module implements,
214// because all code could potentially require the NSS library.
215// Our factory constructor takes an additional boolean parameter.
216// Only for the nsNSSComponent, set this to true.
217// All other classes must have this set to false.
218
219NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSSLSocketProvider)
220NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsTLSSocketProvider)
221NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSecretDecoderRing)
222NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPK11TokenDB)
223NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPKCS11ModuleDB)
224NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, PSMContentListener, init)
225NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(nssEnsureOnChromeOnly,
226                                             nsNSSCertificate,
227                                             nsNSSCertificateFakeTransport)
228NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsNSSCertificateDB)
229NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsNSSCertCache)
230#ifdef MOZ_XUL
231NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertTree)
232#endif
233NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCrypto)
234NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPkcs11)
235NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSSecureMessage)
236NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSDecoder)
237NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSEncoder)
238NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSMessage)
239NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertPicker)
240NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCRLManager)
241NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsNTLMAuthModule, InitTest)
242NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCryptoHash)
243NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCryptoHMAC)
244NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsStreamCipher)
245NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsKeyObject)
246NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsKeyObjectFactory)
247NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsDataSignatureVerifier)
248NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsCertOverrideService, Init)
249NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsRandomGenerator)
250NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsRecentBadCertsService, Init)
251NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, nsSSLStatus)
252NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, nsNSSSocketInfo)
253
254typedef mozilla::psm::NSSErrorsService NSSErrorsService;
255NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NSSErrorsService, Init)
256
257NS_DEFINE_NAMED_CID(NS_NSSCOMPONENT_CID);
258NS_DEFINE_NAMED_CID(NS_SSLSOCKETPROVIDER_CID);
259NS_DEFINE_NAMED_CID(NS_STARTTLSSOCKETPROVIDER_CID);
260NS_DEFINE_NAMED_CID(NS_SDR_CID);
261NS_DEFINE_NAMED_CID(NS_PK11TOKENDB_CID);
262NS_DEFINE_NAMED_CID(NS_PKCS11MODULEDB_CID);
263NS_DEFINE_NAMED_CID(NS_PSMCONTENTLISTEN_CID);
264NS_DEFINE_NAMED_CID(NS_X509CERT_CID);
265NS_DEFINE_NAMED_CID(NS_X509CERTDB_CID);
266NS_DEFINE_NAMED_CID(NS_NSSCERTCACHE_CID);
267NS_DEFINE_NAMED_CID(NS_FORMPROCESSOR_CID);
268#ifdef MOZ_XUL
269NS_DEFINE_NAMED_CID(NS_CERTTREE_CID);
270#endif
271NS_DEFINE_NAMED_CID(NS_PKCS11_CID);
272NS_DEFINE_NAMED_CID(NS_CRYPTO_CID);
273NS_DEFINE_NAMED_CID(NS_CMSSECUREMESSAGE_CID);
274NS_DEFINE_NAMED_CID(NS_CMSDECODER_CID);
275NS_DEFINE_NAMED_CID(NS_CMSENCODER_CID);
276NS_DEFINE_NAMED_CID(NS_CMSMESSAGE_CID);
277NS_DEFINE_NAMED_CID(NS_CRYPTO_HASH_CID);
278NS_DEFINE_NAMED_CID(NS_CRYPTO_HMAC_CID);
279NS_DEFINE_NAMED_CID(NS_CERT_PICKER_CID);
280NS_DEFINE_NAMED_CID(NS_CRLMANAGER_CID);
281NS_DEFINE_NAMED_CID(NS_NTLMAUTHMODULE_CID);
282NS_DEFINE_NAMED_CID(NS_STREAMCIPHER_CID);
283NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECT_CID);
284NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECTFACTORY_CID);
285NS_DEFINE_NAMED_CID(NS_DATASIGNATUREVERIFIER_CID);
286NS_DEFINE_NAMED_CID(NS_CERTOVERRIDE_CID);
287NS_DEFINE_NAMED_CID(NS_RANDOMGENERATOR_CID);
288NS_DEFINE_NAMED_CID(NS_RECENTBADCERTS_CID);
289NS_DEFINE_NAMED_CID(NS_SSLSTATUS_CID);
290NS_DEFINE_NAMED_CID(NS_NSSSOCKETINFO_CID);
291NS_DEFINE_NAMED_CID(NS_NSSERRORSSERVICE_CID);
292
293
294static const mozilla::Module::CIDEntry kNSSCIDs[] = {
295  { &kNS_NSSCOMPONENT_CID, false, NULL, nsNSSComponentConstructor },
296  { &kNS_SSLSOCKETPROVIDER_CID, false, NULL, nsSSLSocketProviderConstructor },
297  { &kNS_STARTTLSSOCKETPROVIDER_CID, false, NULL, nsTLSSocketProviderConstructor },
298  { &kNS_SDR_CID, false, NULL, nsSecretDecoderRingConstructor },
299  { &kNS_PK11TOKENDB_CID, false, NULL, nsPK11TokenDBConstructor },
300  { &kNS_PKCS11MODULEDB_CID, false, NULL, nsPKCS11ModuleDBConstructor },
301  { &kNS_PSMCONTENTLISTEN_CID, false, NULL, PSMContentListenerConstructor },
302  { &kNS_X509CERT_CID, false, NULL, nsNSSCertificateConstructor },
303  { &kNS_X509CERTDB_CID, false, NULL, nsNSSCertificateDBConstructor },
304  { &kNS_NSSCERTCACHE_CID, false, NULL, nsNSSCertCacheConstructor },
305  { &kNS_FORMPROCESSOR_CID, false, NULL, nsKeygenFormProcessor::Create },
306#ifdef MOZ_XUL
307  { &kNS_CERTTREE_CID, false, NULL, nsCertTreeConstructor },
308#endif
309  { &kNS_PKCS11_CID, false, NULL, nsPkcs11Constructor },
310  { &kNS_CRYPTO_CID, false, NULL, nsCryptoConstructor },
311  { &kNS_CMSSECUREMESSAGE_CID, false, NULL, nsCMSSecureMessageConstructor },
312  { &kNS_CMSDECODER_CID, false, NULL, nsCMSDecoderConstructor },
313  { &kNS_CMSENCODER_CID, false, NULL, nsCMSEncoderConstructor },
314  { &kNS_CMSMESSAGE_CID, false, NULL, nsCMSMessageConstructor },
315  { &kNS_CRYPTO_HASH_CID, false, NULL, nsCryptoHashConstructor },
316  { &kNS_CRYPTO_HMAC_CID, false, NULL, nsCryptoHMACConstructor },
317  { &kNS_CERT_PICKER_CID, false, NULL, nsCertPickerConstructor },
318  { &kNS_CRLMANAGER_CID, false, NULL, nsCRLManagerConstructor },
319  { &kNS_NTLMAUTHMODULE_CID, false, NULL, nsNTLMAuthModuleConstructor },
320  { &kNS_STREAMCIPHER_CID, false, NULL, nsStreamCipherConstructor },
321  { &kNS_KEYMODULEOBJECT_CID, false, NULL, nsKeyObjectConstructor },
322  { &kNS_KEYMODULEOBJECTFACTORY_CID, false, NULL, nsKeyObjectFactoryConstructor },
323  { &kNS_DATASIGNATUREVERIFIER_CID, false, NULL, nsDataSignatureVerifierConstructor },
324  { &kNS_CERTOVERRIDE_CID, false, NULL, nsCertOverrideServiceConstructor },
325  { &kNS_RANDOMGENERATOR_CID, false, NULL, nsRandomGeneratorConstructor },
326  { &kNS_RECENTBADCERTS_CID, false, NULL, nsRecentBadCertsServiceConstructor },
327  { &kNS_SSLSTATUS_CID, false, NULL, nsSSLStatusConstructor },
328  { &kNS_NSSSOCKETINFO_CID, false, NULL, nsNSSSocketInfoConstructor },
329  { &kNS_NSSERRORSSERVICE_CID, false, NULL, NSSErrorsServiceConstructor },
330  { NULL }
331};
332
333static const mozilla::Module::ContractIDEntry kNSSContracts[] = {
334  { PSM_COMPONENT_CONTRACTID, &kNS_NSSCOMPONENT_CID },
335  { NS_NSS_ERRORS_SERVICE_CONTRACTID, &kNS_NSSERRORSSERVICE_CID },
336  { NS_SSLSOCKETPROVIDER_CONTRACTID, &kNS_SSLSOCKETPROVIDER_CID },
337  { NS_STARTTLSSOCKETPROVIDER_CONTRACTID, &kNS_STARTTLSSOCKETPROVIDER_CID },
338  { NS_SDR_CONTRACTID, &kNS_SDR_CID },
339  { NS_PK11TOKENDB_CONTRACTID, &kNS_PK11TOKENDB_CID },
340  { NS_PKCS11MODULEDB_CONTRACTID, &kNS_PKCS11MODULEDB_CID },
341  { NS_PSMCONTENTLISTEN_CONTRACTID, &kNS_PSMCONTENTLISTEN_CID },
342  { NS_X509CERTDB_CONTRACTID, &kNS_X509CERTDB_CID },
343  { NS_NSSCERTCACHE_CONTRACTID, &kNS_NSSCERTCACHE_CID },
344  { NS_FORMPROCESSOR_CONTRACTID, &kNS_FORMPROCESSOR_CID },
345#ifdef MOZ_XUL
346  { NS_CERTTREE_CONTRACTID, &kNS_CERTTREE_CID },
347#endif
348  { NS_PKCS11_CONTRACTID, &kNS_PKCS11_CID },
349  { NS_CRYPTO_CONTRACTID, &kNS_CRYPTO_CID },
350  { NS_CMSSECUREMESSAGE_CONTRACTID, &kNS_CMSSECUREMESSAGE_CID },
351  { NS_CMSDECODER_CONTRACTID, &kNS_CMSDECODER_CID },
352  { NS_CMSENCODER_CONTRACTID, &kNS_CMSENCODER_CID },
353  { NS_CMSMESSAGE_CONTRACTID, &kNS_CMSMESSAGE_CID },
354  { NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID },
355  { NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID },
356  { NS_CERT_PICKER_CONTRACTID, &kNS_CERT_PICKER_CID },
357  { "@mozilla.org/uriloader/psm-external-content-listener;1", &kNS_PSMCONTENTLISTEN_CID },
358  { NS_CRLMANAGER_CONTRACTID, &kNS_CRLMANAGER_CID },
359  { NS_CRYPTO_FIPSINFO_SERVICE_CONTRACTID, &kNS_PKCS11MODULEDB_CID },
360  { NS_NTLMAUTHMODULE_CONTRACTID, &kNS_NTLMAUTHMODULE_CID },
361  { NS_STREAMCIPHER_CONTRACTID, &kNS_STREAMCIPHER_CID },
362  { NS_KEYMODULEOBJECT_CONTRACTID, &kNS_KEYMODULEOBJECT_CID },
363  { NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &kNS_KEYMODULEOBJECTFACTORY_CID },
364  { NS_DATASIGNATUREVERIFIER_CONTRACTID, &kNS_DATASIGNATUREVERIFIER_CID },
365  { NS_CERTOVERRIDE_CONTRACTID, &kNS_CERTOVERRIDE_CID },
366  { NS_RANDOMGENERATOR_CONTRACTID, &kNS_RANDOMGENERATOR_CID },
367  { NS_RECENTBADCERTS_CONTRACTID, &kNS_RECENTBADCERTS_CID },
368  { NULL }
369};
370
371static const mozilla::Module::CategoryEntry kNSSCategories[] = {
372  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-ca-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
373  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-server-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
374  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-user-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
375  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-email-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
376  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-pkcs7-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
377  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
378  { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/pkix-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
379  { NULL }
380};
381
382static const mozilla::Module kNSSModule = {
383  mozilla::Module::kVersion,
384  kNSSCIDs,
385  kNSSContracts,
386  kNSSCategories
387};
388
389NSMODULE_DEFN(NSS) = &kNSSModule;