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