diff --git a/security/apps/AppSignatureVerification.cpp b/security/apps/AppSignatureVerification.cpp index aaf75026fb77..c7016f359410 100644 --- a/security/apps/AppSignatureVerification.cpp +++ b/security/apps/AppSignatureVerification.cpp @@ -40,7 +40,7 @@ using namespace mozilla::pkix; using namespace mozilla; using namespace mozilla::psm; -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; namespace { diff --git a/security/apps/AppTrustDomain.cpp b/security/apps/AppTrustDomain.cpp index 7995aa22464d..a1dc797ede3a 100644 --- a/security/apps/AppTrustDomain.cpp +++ b/security/apps/AppTrustDomain.cpp @@ -37,7 +37,7 @@ using namespace mozilla::pkix; -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; static const unsigned int DEFAULT_MIN_RSA_BITS = 2048; static char kDevImportedDER[] = diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp index 9248e8ff3087..246b963ca9c7 100644 --- a/security/certverifier/CertVerifier.cpp +++ b/security/certverifier/CertVerifier.cpp @@ -22,7 +22,7 @@ using namespace mozilla::pkix; using namespace mozilla::psm; -mozilla::LazyLogModule gCertVerifierLog("certverifier"); +PRLogModuleInfo* gCertVerifierLog = nullptr; namespace mozilla { namespace psm { @@ -52,6 +52,9 @@ CertVerifier::~CertVerifier() void InitCertVerifierLog() { + if (!gCertVerifierLog) { + gCertVerifierLog = PR_NewLogModule("certverifier"); + } } Result diff --git a/security/certverifier/ExtendedValidation.cpp b/security/certverifier/ExtendedValidation.cpp index 2ca9aec7120a..08749d597e8c 100644 --- a/security/certverifier/ExtendedValidation.cpp +++ b/security/certverifier/ExtendedValidation.cpp @@ -16,7 +16,7 @@ #include "prerror.h" #include "prinit.h" -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; #define CONST_OID static const unsigned char #define OI(x) { siDEROID, (unsigned char*) x, sizeof x } diff --git a/security/certverifier/NSSCertDBTrustDomain.cpp b/security/certverifier/NSSCertDBTrustDomain.cpp index 2150ae583664..e58db0c23a11 100644 --- a/security/certverifier/NSSCertDBTrustDomain.cpp +++ b/security/certverifier/NSSCertDBTrustDomain.cpp @@ -33,7 +33,7 @@ using namespace mozilla; using namespace mozilla::pkix; -extern LazyLogModule gCertVerifierLog; +extern PRLogModuleInfo* gCertVerifierLog; static const uint64_t ServerFailureDelaySeconds = 5 * 60; diff --git a/security/certverifier/OCSPCache.cpp b/security/certverifier/OCSPCache.cpp index 8b1679fe4e53..58a37f4ed358 100644 --- a/security/certverifier/OCSPCache.cpp +++ b/security/certverifier/OCSPCache.cpp @@ -32,7 +32,7 @@ #include "ScopedNSSTypes.h" #include "secerr.h" -extern mozilla::LazyLogModule gCertVerifierLog; +extern PRLogModuleInfo* gCertVerifierLog; using namespace mozilla::pkix; diff --git a/security/certverifier/OCSPRequestor.cpp b/security/certverifier/OCSPRequestor.cpp index 8ac370aaed7b..c750447e6283 100644 --- a/security/certverifier/OCSPRequestor.cpp +++ b/security/certverifier/OCSPRequestor.cpp @@ -16,7 +16,7 @@ #include "nsServiceManagerUtils.h" #include "secerr.h" -extern mozilla::LazyLogModule gCertVerifierLog; +extern PRLogModuleInfo* gCertVerifierLog; namespace mozilla { diff --git a/security/manager/ssl/CertBlocklist.cpp b/security/manager/ssl/CertBlocklist.cpp index 01ceeecec599..2fc8e09cff5d 100644 --- a/security/manager/ssl/CertBlocklist.cpp +++ b/security/manager/ssl/CertBlocklist.cpp @@ -34,7 +34,7 @@ using namespace mozilla::pkix; #define PREF_MAX_STALENESS_IN_SECONDS "security.onecrl.maximum_staleness_in_seconds" #define PREF_ONECRL_VIA_AMO "security.onecrl.via.amo" -static LazyLogModule gCertBlockPRLog("CertBlock"); +static PRLogModuleInfo* gCertBlockPRLog; uint32_t CertBlocklist::sLastBlocklistUpdate = 0U; uint32_t CertBlocklist::sLastKintoUpdate = 0U; @@ -130,6 +130,9 @@ CertBlocklist::CertBlocklist() , mBackingFileIsInitialized(false) , mBackingFile(nullptr) { + if (!gCertBlockPRLog) { + gCertBlockPRLog = PR_NewLogModule("CertBlock"); + } } CertBlocklist::~CertBlocklist() diff --git a/security/manager/ssl/PSMContentListener.cpp b/security/manager/ssl/PSMContentListener.cpp index 1ccc9cab954d..faa9f6542acc 100644 --- a/security/manager/ssl/PSMContentListener.cpp +++ b/security/manager/ssl/PSMContentListener.cpp @@ -29,7 +29,7 @@ #include "mozilla/Logging.h" -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; namespace mozilla { namespace psm { diff --git a/security/manager/ssl/PublicKeyPinningService.cpp b/security/manager/ssl/PublicKeyPinningService.cpp index d9098f1768e2..d6fcd0bf53a0 100644 --- a/security/manager/ssl/PublicKeyPinningService.cpp +++ b/security/manager/ssl/PublicKeyPinningService.cpp @@ -23,7 +23,8 @@ using namespace mozilla; using namespace mozilla::pkix; using namespace mozilla::psm; -LazyLogModule gPublicKeyPinningLog("PublicKeyPinningService"); +PRLogModuleInfo* gPublicKeyPinningLog = + PR_NewLogModule("PublicKeyPinningService"); /** Computes in the location specified by base64Out the SHA256 digest diff --git a/security/manager/ssl/RootCertificateTelemetryUtils.cpp b/security/manager/ssl/RootCertificateTelemetryUtils.cpp index e97b6acbb3e5..6070bc89dba3 100644 --- a/security/manager/ssl/RootCertificateTelemetryUtils.cpp +++ b/security/manager/ssl/RootCertificateTelemetryUtils.cpp @@ -13,7 +13,8 @@ namespace mozilla { namespace psm { -mozilla::LazyLogModule gPublicKeyPinningTelemetryLog("PublicKeyPinningTelemetryService"); +PRLogModuleInfo* gPublicKeyPinningTelemetryLog = + PR_NewLogModule("PublicKeyPinningTelemetryService"); // Used in the BinarySearch method, this does a memcmp between the pointer // provided to its construtor and whatever the binary search is looking for. diff --git a/security/manager/ssl/SSLServerCertVerification.cpp b/security/manager/ssl/SSLServerCertVerification.cpp index f20c85e59655..96457fa50417 100644 --- a/security/manager/ssl/SSLServerCertVerification.cpp +++ b/security/manager/ssl/SSLServerCertVerification.cpp @@ -133,7 +133,7 @@ #include "secport.h" #include "sslerr.h" -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; using namespace mozilla::pkix; diff --git a/security/manager/ssl/nsCertTree.cpp b/security/manager/ssl/nsCertTree.cpp index 615d82c4f92d..839bddabea23 100644 --- a/security/manager/ssl/nsCertTree.cpp +++ b/security/manager/ssl/nsCertTree.cpp @@ -26,7 +26,7 @@ using namespace mozilla; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; static NS_DEFINE_CID(kCertOverrideCID, NS_CERTOVERRIDE_CID); diff --git a/security/manager/ssl/nsNSSCallbacks.cpp b/security/manager/ssl/nsNSSCallbacks.cpp index 05588a4e647f..6fb8e3080aa3 100644 --- a/security/manager/ssl/nsNSSCallbacks.cpp +++ b/security/manager/ssl/nsNSSCallbacks.cpp @@ -28,7 +28,7 @@ using namespace mozilla; using namespace mozilla::psm; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; static void AccumulateCipherSuite(Telemetry::ID probe, const SSLChannelInfo& channelInfo); diff --git a/security/manager/ssl/nsNSSCertificate.cpp b/security/manager/ssl/nsNSSCertificate.cpp index 0471cf3de1c0..7f8aa7a05a5c 100644 --- a/security/manager/ssl/nsNSSCertificate.cpp +++ b/security/manager/ssl/nsNSSCertificate.cpp @@ -57,7 +57,7 @@ using namespace mozilla; using namespace mozilla::psm; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; // This is being stored in an uint32_t that can otherwise // only take values from nsIX509Cert's list of cert types. diff --git a/security/manager/ssl/nsNSSCertificateDB.cpp b/security/manager/ssl/nsNSSCertificateDB.cpp index 7392abf609b4..b2332554546c 100644 --- a/security/manager/ssl/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/nsNSSCertificateDB.cpp @@ -56,7 +56,7 @@ using namespace mozilla; using namespace mozilla::psm; using mozilla::psm::SharedSSLState; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; static nsresult attemptToLogInWithDefaultPassword() diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index 17e6d620e8cc..db9f2bf74a4e 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -55,7 +55,7 @@ using namespace mozilla; using namespace mozilla::psm; -LazyLogModule gPIPNSSLog("pipnss"); +PRLogModuleInfo* gPIPNSSLog = nullptr; int nsNSSComponent::mInstanceCount = 0; @@ -221,6 +221,8 @@ nsNSSComponent::nsNSSComponent() #endif mCertVerificationThread(nullptr) { + if (!gPIPNSSLog) + gPIPNSSLog = PR_NewLogModule("pipnss"); MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("nsNSSComponent::ctor\n")); NS_ASSERTION( (0 == mInstanceCount), "nsNSSComponent is a singleton, but instantiated multiple times!"); diff --git a/security/manager/ssl/nsNSSIOLayer.cpp b/security/manager/ssl/nsNSSIOLayer.cpp index e7ee097b7ace..4da30ff7088d 100644 --- a/security/manager/ssl/nsNSSIOLayer.cpp +++ b/security/manager/ssl/nsNSSIOLayer.cpp @@ -82,7 +82,7 @@ static const bool FALSE_START_REQUIRE_NPN_DEFAULT = false; } // unnamed namespace -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; nsNSSSocketInfo::nsNSSSocketInfo(SharedSSLState& aState, uint32_t providerFlags) : mFd(nullptr), diff --git a/security/manager/ssl/nsNSSShutDown.cpp b/security/manager/ssl/nsNSSShutDown.cpp index b2337cdf798e..e1d36dc0eefa 100644 --- a/security/manager/ssl/nsNSSShutDown.cpp +++ b/security/manager/ssl/nsNSSShutDown.cpp @@ -7,7 +7,7 @@ using namespace mozilla; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; struct ObjectHashEntry : PLDHashEntryHdr { nsNSSShutDownObject *obj; diff --git a/security/manager/ssl/nsNTLMAuthModule.cpp b/security/manager/ssl/nsNTLMAuthModule.cpp index 1135cea7fef9..ed541b158219 100644 --- a/security/manager/ssl/nsNTLMAuthModule.cpp +++ b/security/manager/ssl/nsNTLMAuthModule.cpp @@ -28,10 +28,18 @@ #include "prsystem.h" static bool sNTLMv1Forced = false; -static mozilla::LazyLogModule sNTLMLog("NTLM"); -#define LOG(x) MOZ_LOG(sNTLMLog, mozilla::LogLevel::Debug, x) -#define LOG_ENABLED() MOZ_LOG_TEST(sNTLMLog, mozilla::LogLevel::Debug) +static PRLogModuleInfo * +GetNTLMLog() +{ + static PRLogModuleInfo *sNTLMLog; + if (!sNTLMLog) + sNTLMLog = PR_NewLogModule("NTLM"); + return sNTLMLog; +} + +#define LOG(x) MOZ_LOG(GetNTLMLog(), mozilla::LogLevel::Debug, x) +#define LOG_ENABLED() MOZ_LOG_TEST(GetNTLMLog(), mozilla::LogLevel::Debug) static void des_makekey(const uint8_t *raw, uint8_t *key); static void des_encrypt(const uint8_t *key, const uint8_t *src, uint8_t *hash); diff --git a/security/manager/ssl/nsPK11TokenDB.cpp b/security/manager/ssl/nsPK11TokenDB.cpp index 6ccb693a8c00..2f84689af8f0 100644 --- a/security/manager/ssl/nsPK11TokenDB.cpp +++ b/security/manager/ssl/nsPK11TokenDB.cpp @@ -14,7 +14,7 @@ #include "nsPK11TokenDB.h" -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; NS_IMPL_ISUPPORTS(nsPK11Token, nsIPK11Token) diff --git a/security/manager/ssl/nsPKCS11Slot.cpp b/security/manager/ssl/nsPKCS11Slot.cpp index 6adf2f2c9baa..a2a253a341fb 100644 --- a/security/manager/ssl/nsPKCS11Slot.cpp +++ b/security/manager/ssl/nsPKCS11Slot.cpp @@ -13,7 +13,7 @@ using mozilla::LogLevel; -extern mozilla::LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; NS_IMPL_ISUPPORTS(nsPKCS11Slot, nsIPKCS11Slot) diff --git a/security/manager/ssl/nsPKCS12Blob.cpp b/security/manager/ssl/nsPKCS12Blob.cpp index bf71ba01d5d1..3932b1646474 100644 --- a/security/manager/ssl/nsPKCS12Blob.cpp +++ b/security/manager/ssl/nsPKCS12Blob.cpp @@ -32,8 +32,9 @@ #include "secerr.h" +extern PRLogModuleInfo* gPIPNSSLog; + using namespace mozilla; -extern LazyLogModule gPIPNSSLog; #define PIP_PKCS12_TMPFILENAME NS_LITERAL_CSTRING(".pip_p12tmp") #define PIP_PKCS12_BUFFER_SIZE 2048 diff --git a/security/manager/ssl/nsSecureBrowserUIImpl.cpp b/security/manager/ssl/nsSecureBrowserUIImpl.cpp index bf1d47b1db95..eff7088bcc4f 100644 --- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp +++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp @@ -49,7 +49,7 @@ using namespace mozilla; // this enables LogLevel::Debug level information and places all output in // the file nspr.log // -LazyLogModule gSecureDocLog("nsSecureBrowserUI"); +PRLogModuleInfo* gSecureDocLog = nullptr; struct RequestHashEntry : PLDHashEntryHdr { void *r; @@ -117,6 +117,9 @@ nsSecureBrowserUIImpl::nsSecureBrowserUIImpl() MOZ_ASSERT(NS_IsMainThread()); ResetStateTracking(); + + if (!gSecureDocLog) + gSecureDocLog = PR_NewLogModule("nsSecureBrowserUI"); } NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl, diff --git a/security/manager/ssl/nsSecurityHeaderParser.cpp b/security/manager/ssl/nsSecurityHeaderParser.cpp index 9fb9f0d6dc68..7fc7e16d98a2 100644 --- a/security/manager/ssl/nsSecurityHeaderParser.cpp +++ b/security/manager/ssl/nsSecurityHeaderParser.cpp @@ -46,9 +46,17 @@ IsQuotedPairSymbol(signed char chr) { return (chr >= 0); } -static mozilla::LazyLogModule sSHParserLog("nsSecurityHeaderParser"); +static PRLogModuleInfo * +GetSHParserLog() +{ + static PRLogModuleInfo *sSHParserLog; + if (!sSHParserLog) { + sSHParserLog = PR_NewLogModule("nsSecurityHeaderParser"); + } + return sSHParserLog; +} -#define SHPARSERLOG(args) MOZ_LOG(sSHParserLog, mozilla::LogLevel::Debug, args) +#define SHPARSERLOG(args) MOZ_LOG(GetSHParserLog(), mozilla::LogLevel::Debug, args) nsSecurityHeaderParser::nsSecurityHeaderParser(const char *aHeader) : mCursor(aHeader) diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp index 2c4f020d8183..706cf4ef8b43 100644 --- a/security/manager/ssl/nsSiteSecurityService.cpp +++ b/security/manager/ssl/nsSiteSecurityService.cpp @@ -41,9 +41,16 @@ using namespace mozilla; using namespace mozilla::psm; -static LazyLogModule gSSSLog("nsSSService"); +static PRLogModuleInfo * +GetSSSLog() +{ + static PRLogModuleInfo *gSSSLog; + if (!gSSSLog) + gSSSLog = PR_NewLogModule("nsSSService"); + return gSSSLog; +} -#define SSSLOG(args) MOZ_LOG(gSSSLog, mozilla::LogLevel::Debug, args) +#define SSSLOG(args) MOZ_LOG(GetSSSLog(), mozilla::LogLevel::Debug, args) //////////////////////////////////////////////////////////////////////////////// diff --git a/security/manager/ssl/nsUsageArrayHelper.cpp b/security/manager/ssl/nsUsageArrayHelper.cpp index 5576065021aa..e02452a612f2 100644 --- a/security/manager/ssl/nsUsageArrayHelper.cpp +++ b/security/manager/ssl/nsUsageArrayHelper.cpp @@ -19,7 +19,7 @@ using namespace mozilla; using namespace mozilla::psm; -extern LazyLogModule gPIPNSSLog; +extern PRLogModuleInfo* gPIPNSSLog; static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); // XXX? needed?::