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 : #include "nsNSSVersion.h"
82 :
83 : #include "nsXULAppAPI.h"
84 : #define NS_IS_PROCESS_DEFAULT \
85 : (GeckoProcessType_Default == XRE_GetProcessType())
86 :
87 : #define NS_NSS_INSTANTIATE(ensureOperator, _InstanceClass) \
88 : PR_BEGIN_MACRO \
89 : _InstanceClass * inst; \
90 : inst = new _InstanceClass(); \
91 : if (NULL == inst) { \
92 : if (ensureOperator == nssLoadingComponent) \
93 : EnsureNSSInitialized(nssInitFailed); \
94 : rv = NS_ERROR_OUT_OF_MEMORY; \
95 : return rv; \
96 : } \
97 : NS_ADDREF(inst); \
98 : rv = inst->QueryInterface(aIID, aResult); \
99 : NS_RELEASE(inst); \
100 : PR_END_MACRO
101 :
102 : #define NS_NSS_INSTANTIATE_INIT(ensureOperator, _InstanceClass, _InitMethod) \
103 : PR_BEGIN_MACRO \
104 : _InstanceClass * inst; \
105 : inst = new _InstanceClass(); \
106 : if (NULL == inst) { \
107 : if (ensureOperator == nssLoadingComponent) \
108 : EnsureNSSInitialized(nssInitFailed); \
109 : rv = NS_ERROR_OUT_OF_MEMORY; \
110 : return rv; \
111 : } \
112 : NS_ADDREF(inst); \
113 : rv = inst->_InitMethod(); \
114 : if(NS_SUCCEEDED(rv)) { \
115 : rv = inst->QueryInterface(aIID, aResult); \
116 : } \
117 : NS_RELEASE(inst); \
118 : PR_END_MACRO
119 :
120 :
121 : #define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(ensureOperator, \
122 : _InstanceClass) \
123 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator, \
124 : _InstanceClass, \
125 : _InstanceClass)
126 :
127 : // These two macros are ripped off from nsIGenericFactory.h and slightly
128 : // modified.
129 : #define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(ensureOperator, \
130 : _InstanceClassChrome, \
131 : _InstanceClassContent) \
132 : static nsresult \
133 : _InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID, \
134 : void **aResult) \
135 : { \
136 : nsresult rv; \
137 : \
138 : *aResult = NULL; \
139 : if (NULL != aOuter) { \
140 : rv = NS_ERROR_NO_AGGREGATION; \
141 : return rv; \
142 : } \
143 : \
144 : if (!EnsureNSSInitialized(ensureOperator)) \
145 : return NS_ERROR_FAILURE; \
146 : \
147 : if (NS_IS_PROCESS_DEFAULT) \
148 : NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassChrome); \
149 : else \
150 : NS_NSS_INSTANTIATE(ensureOperator, _InstanceClassContent); \
151 : \
152 : if (ensureOperator == nssLoadingComponent) \
153 : { \
154 : if (NS_SUCCEEDED(rv)) \
155 : EnsureNSSInitialized(nssInitSucceeded); \
156 : else \
157 : EnsureNSSInitialized(nssInitFailed); \
158 : } \
159 : \
160 : return rv; \
161 : }
162 :
163 :
164 : #define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ensureOperator, \
165 : _InstanceClass, \
166 : _InitMethod) \
167 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator, \
168 : _InstanceClass, \
169 : _InstanceClass, \
170 : _InitMethod)
171 :
172 : #define NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT_BYPROCESS(ensureOperator, \
173 : _InstanceClassChrome, \
174 : _InstanceClassContent, \
175 : _InitMethod) \
176 : static nsresult \
177 : _InstanceClassChrome##Constructor(nsISupports *aOuter, REFNSIID aIID, \
178 : void **aResult) \
179 : { \
180 : nsresult rv; \
181 : \
182 : *aResult = NULL; \
183 : if (NULL != aOuter) { \
184 : rv = NS_ERROR_NO_AGGREGATION; \
185 : return rv; \
186 : } \
187 : \
188 : if (!EnsureNSSInitialized(ensureOperator)) \
189 : return NS_ERROR_FAILURE; \
190 : \
191 : if (NS_IS_PROCESS_DEFAULT) \
192 : NS_NSS_INSTANTIATE_INIT(ensureOperator, \
193 : _InstanceClassChrome, \
194 : _InitMethod); \
195 : else \
196 : NS_NSS_INSTANTIATE_INIT(ensureOperator, \
197 : _InstanceClassContent, \
198 : _InitMethod); \
199 : \
200 : if (ensureOperator == nssLoadingComponent) \
201 : { \
202 : if (NS_SUCCEEDED(rv)) \
203 : EnsureNSSInitialized(nssInitSucceeded); \
204 : else \
205 : EnsureNSSInitialized(nssInitFailed); \
206 : } \
207 : \
208 : return rv; \
209 : }
210 :
211 656 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssLoadingComponent, nsNSSComponent,
212 328 : Init)
213 :
214 : // Use the special factory constructor for everything this module implements,
215 : // because all code could potentially require the NSS library.
216 : // Our factory constructor takes an additional boolean parameter.
217 : // Only for the nsNSSComponent, set this to true.
218 : // All other classes must have this set to false.
219 :
220 10 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSSLSocketProvider)
221 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsTLSSocketProvider)
222 130 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsSecretDecoderRing)
223 104 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPK11TokenDB)
224 76 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPKCS11ModuleDB)
225 656 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, PSMContentListener, init)
226 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_BYPROCESS(nssEnsureOnChromeOnly,
227 : nsNSSCertificate,
228 0 : nsNSSCertificateFakeTransport)
229 8 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsNSSCertificateDB)
230 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsNSSCertCache)
231 : #ifdef MOZ_XUL
232 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertTree)
233 : #endif
234 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCrypto)
235 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsPkcs11)
236 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSSecureMessage)
237 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSDecoder)
238 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSEncoder)
239 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCMSMessage)
240 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCertPicker)
241 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCRLManager)
242 2 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsNTLMAuthModule, InitTest)
243 2932 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCryptoHash)
244 3116 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsCryptoHMAC)
245 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsStreamCipher)
246 3352 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsKeyObject)
247 76 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsKeyObjectFactory)
248 6 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsDataSignatureVerifier)
249 70 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsCertOverrideService, Init)
250 6566 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsure, nsRandomGenerator)
251 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nssEnsure, nsRecentBadCertsService, Init)
252 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, nsSSLStatus)
253 0 : NS_NSS_GENERIC_FACTORY_CONSTRUCTOR(nssEnsureOnChromeOnly, nsNSSSocketInfo)
254 :
255 : typedef mozilla::psm::NSSErrorsService NSSErrorsService;
256 0 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NSSErrorsService, Init)
257 0 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSVersion)
258 :
259 : NS_DEFINE_NAMED_CID(NS_NSSCOMPONENT_CID);
260 : NS_DEFINE_NAMED_CID(NS_SSLSOCKETPROVIDER_CID);
261 : NS_DEFINE_NAMED_CID(NS_STARTTLSSOCKETPROVIDER_CID);
262 : NS_DEFINE_NAMED_CID(NS_SDR_CID);
263 : NS_DEFINE_NAMED_CID(NS_PK11TOKENDB_CID);
264 : NS_DEFINE_NAMED_CID(NS_PKCS11MODULEDB_CID);
265 : NS_DEFINE_NAMED_CID(NS_PSMCONTENTLISTEN_CID);
266 : NS_DEFINE_NAMED_CID(NS_X509CERT_CID);
267 : NS_DEFINE_NAMED_CID(NS_X509CERTDB_CID);
268 : NS_DEFINE_NAMED_CID(NS_NSSCERTCACHE_CID);
269 : NS_DEFINE_NAMED_CID(NS_FORMPROCESSOR_CID);
270 : #ifdef MOZ_XUL
271 : NS_DEFINE_NAMED_CID(NS_CERTTREE_CID);
272 : #endif
273 : NS_DEFINE_NAMED_CID(NS_PKCS11_CID);
274 : NS_DEFINE_NAMED_CID(NS_CRYPTO_CID);
275 : NS_DEFINE_NAMED_CID(NS_CMSSECUREMESSAGE_CID);
276 : NS_DEFINE_NAMED_CID(NS_CMSDECODER_CID);
277 : NS_DEFINE_NAMED_CID(NS_CMSENCODER_CID);
278 : NS_DEFINE_NAMED_CID(NS_CMSMESSAGE_CID);
279 : NS_DEFINE_NAMED_CID(NS_CRYPTO_HASH_CID);
280 : NS_DEFINE_NAMED_CID(NS_CRYPTO_HMAC_CID);
281 : NS_DEFINE_NAMED_CID(NS_CERT_PICKER_CID);
282 : NS_DEFINE_NAMED_CID(NS_CRLMANAGER_CID);
283 : NS_DEFINE_NAMED_CID(NS_NTLMAUTHMODULE_CID);
284 : NS_DEFINE_NAMED_CID(NS_STREAMCIPHER_CID);
285 : NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECT_CID);
286 : NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECTFACTORY_CID);
287 : NS_DEFINE_NAMED_CID(NS_DATASIGNATUREVERIFIER_CID);
288 : NS_DEFINE_NAMED_CID(NS_CERTOVERRIDE_CID);
289 : NS_DEFINE_NAMED_CID(NS_RANDOMGENERATOR_CID);
290 : NS_DEFINE_NAMED_CID(NS_RECENTBADCERTS_CID);
291 : NS_DEFINE_NAMED_CID(NS_SSLSTATUS_CID);
292 : NS_DEFINE_NAMED_CID(NS_NSSSOCKETINFO_CID);
293 : NS_DEFINE_NAMED_CID(NS_NSSERRORSSERVICE_CID);
294 : NS_DEFINE_NAMED_CID(NS_NSSVERSION_CID);
295 :
296 : static const mozilla::Module::CIDEntry kNSSCIDs[] = {
297 : { &kNS_NSSCOMPONENT_CID, false, NULL, nsNSSComponentConstructor },
298 : { &kNS_SSLSOCKETPROVIDER_CID, false, NULL, nsSSLSocketProviderConstructor },
299 : { &kNS_STARTTLSSOCKETPROVIDER_CID, false, NULL, nsTLSSocketProviderConstructor },
300 : { &kNS_SDR_CID, false, NULL, nsSecretDecoderRingConstructor },
301 : { &kNS_PK11TOKENDB_CID, false, NULL, nsPK11TokenDBConstructor },
302 : { &kNS_PKCS11MODULEDB_CID, false, NULL, nsPKCS11ModuleDBConstructor },
303 : { &kNS_PSMCONTENTLISTEN_CID, false, NULL, PSMContentListenerConstructor },
304 : { &kNS_X509CERT_CID, false, NULL, nsNSSCertificateConstructor },
305 : { &kNS_X509CERTDB_CID, false, NULL, nsNSSCertificateDBConstructor },
306 : { &kNS_NSSCERTCACHE_CID, false, NULL, nsNSSCertCacheConstructor },
307 : { &kNS_FORMPROCESSOR_CID, false, NULL, nsKeygenFormProcessor::Create },
308 : #ifdef MOZ_XUL
309 : { &kNS_CERTTREE_CID, false, NULL, nsCertTreeConstructor },
310 : #endif
311 : { &kNS_PKCS11_CID, false, NULL, nsPkcs11Constructor },
312 : { &kNS_CRYPTO_CID, false, NULL, nsCryptoConstructor },
313 : { &kNS_CMSSECUREMESSAGE_CID, false, NULL, nsCMSSecureMessageConstructor },
314 : { &kNS_CMSDECODER_CID, false, NULL, nsCMSDecoderConstructor },
315 : { &kNS_CMSENCODER_CID, false, NULL, nsCMSEncoderConstructor },
316 : { &kNS_CMSMESSAGE_CID, false, NULL, nsCMSMessageConstructor },
317 : { &kNS_CRYPTO_HASH_CID, false, NULL, nsCryptoHashConstructor },
318 : { &kNS_CRYPTO_HMAC_CID, false, NULL, nsCryptoHMACConstructor },
319 : { &kNS_CERT_PICKER_CID, false, NULL, nsCertPickerConstructor },
320 : { &kNS_CRLMANAGER_CID, false, NULL, nsCRLManagerConstructor },
321 : { &kNS_NTLMAUTHMODULE_CID, false, NULL, nsNTLMAuthModuleConstructor },
322 : { &kNS_STREAMCIPHER_CID, false, NULL, nsStreamCipherConstructor },
323 : { &kNS_KEYMODULEOBJECT_CID, false, NULL, nsKeyObjectConstructor },
324 : { &kNS_KEYMODULEOBJECTFACTORY_CID, false, NULL, nsKeyObjectFactoryConstructor },
325 : { &kNS_DATASIGNATUREVERIFIER_CID, false, NULL, nsDataSignatureVerifierConstructor },
326 : { &kNS_CERTOVERRIDE_CID, false, NULL, nsCertOverrideServiceConstructor },
327 : { &kNS_RANDOMGENERATOR_CID, false, NULL, nsRandomGeneratorConstructor },
328 : { &kNS_RECENTBADCERTS_CID, false, NULL, nsRecentBadCertsServiceConstructor },
329 : { &kNS_SSLSTATUS_CID, false, NULL, nsSSLStatusConstructor },
330 : { &kNS_NSSSOCKETINFO_CID, false, NULL, nsNSSSocketInfoConstructor },
331 : { &kNS_NSSERRORSSERVICE_CID, false, NULL, NSSErrorsServiceConstructor },
332 : { &kNS_NSSVERSION_CID, false, NULL, nsNSSVersionConstructor },
333 : { NULL }
334 : };
335 :
336 : static const mozilla::Module::ContractIDEntry kNSSContracts[] = {
337 : { PSM_COMPONENT_CONTRACTID, &kNS_NSSCOMPONENT_CID },
338 : { NS_NSS_ERRORS_SERVICE_CONTRACTID, &kNS_NSSERRORSSERVICE_CID },
339 : { NS_NSSVERSION_CONTRACTID, &kNS_NSSVERSION_CID },
340 : { NS_SSLSOCKETPROVIDER_CONTRACTID, &kNS_SSLSOCKETPROVIDER_CID },
341 : { NS_STARTTLSSOCKETPROVIDER_CONTRACTID, &kNS_STARTTLSSOCKETPROVIDER_CID },
342 : { NS_SDR_CONTRACTID, &kNS_SDR_CID },
343 : { NS_PK11TOKENDB_CONTRACTID, &kNS_PK11TOKENDB_CID },
344 : { NS_PKCS11MODULEDB_CONTRACTID, &kNS_PKCS11MODULEDB_CID },
345 : { NS_PSMCONTENTLISTEN_CONTRACTID, &kNS_PSMCONTENTLISTEN_CID },
346 : { NS_X509CERTDB_CONTRACTID, &kNS_X509CERTDB_CID },
347 : { NS_NSSCERTCACHE_CONTRACTID, &kNS_NSSCERTCACHE_CID },
348 : { NS_FORMPROCESSOR_CONTRACTID, &kNS_FORMPROCESSOR_CID },
349 : #ifdef MOZ_XUL
350 : { NS_CERTTREE_CONTRACTID, &kNS_CERTTREE_CID },
351 : #endif
352 : { NS_PKCS11_CONTRACTID, &kNS_PKCS11_CID },
353 : { NS_CRYPTO_CONTRACTID, &kNS_CRYPTO_CID },
354 : { NS_CMSSECUREMESSAGE_CONTRACTID, &kNS_CMSSECUREMESSAGE_CID },
355 : { NS_CMSDECODER_CONTRACTID, &kNS_CMSDECODER_CID },
356 : { NS_CMSENCODER_CONTRACTID, &kNS_CMSENCODER_CID },
357 : { NS_CMSMESSAGE_CONTRACTID, &kNS_CMSMESSAGE_CID },
358 : { NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID },
359 : { NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID },
360 : { NS_CERT_PICKER_CONTRACTID, &kNS_CERT_PICKER_CID },
361 : { "@mozilla.org/uriloader/psm-external-content-listener;1", &kNS_PSMCONTENTLISTEN_CID },
362 : { NS_CRLMANAGER_CONTRACTID, &kNS_CRLMANAGER_CID },
363 : { NS_CRYPTO_FIPSINFO_SERVICE_CONTRACTID, &kNS_PKCS11MODULEDB_CID },
364 : { NS_NTLMAUTHMODULE_CONTRACTID, &kNS_NTLMAUTHMODULE_CID },
365 : { NS_STREAMCIPHER_CONTRACTID, &kNS_STREAMCIPHER_CID },
366 : { NS_KEYMODULEOBJECT_CONTRACTID, &kNS_KEYMODULEOBJECT_CID },
367 : { NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &kNS_KEYMODULEOBJECTFACTORY_CID },
368 : { NS_DATASIGNATUREVERIFIER_CONTRACTID, &kNS_DATASIGNATUREVERIFIER_CID },
369 : { NS_CERTOVERRIDE_CONTRACTID, &kNS_CERTOVERRIDE_CID },
370 : { NS_RANDOMGENERATOR_CONTRACTID, &kNS_RANDOMGENERATOR_CID },
371 : { NS_RECENTBADCERTS_CONTRACTID, &kNS_RECENTBADCERTS_CID },
372 : { NULL }
373 : };
374 :
375 : static const mozilla::Module::CategoryEntry kNSSCategories[] = {
376 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-ca-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
377 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-server-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
378 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-user-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
379 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-email-cert", "@mozilla.org/uriloader/psm-external-content-listener;1" },
380 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-pkcs7-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
381 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
382 : { NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/pkix-crl", "@mozilla.org/uriloader/psm-external-content-listener;1" },
383 : { NULL }
384 : };
385 :
386 : static const mozilla::Module kNSSModule = {
387 : mozilla::Module::kVersion,
388 : kNSSCIDs,
389 : kNSSContracts,
390 : kNSSCategories
391 : };
392 :
393 : NSMODULE_DEFN(NSS) = &kNSSModule;
|