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