2009-07-21 12:08:52 +02:00
|
|
|
From: Hans Petter Jansson <hpj@copyleft.no>
|
|
|
|
Wolfgang Rosenauer <wr@rosenauer.org>
|
|
|
|
Subject: use libnsssharedhelper if available at compile time
|
2012-07-16 10:37:53 +02:00
|
|
|
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1)
|
2009-07-21 12:08:52 +02:00
|
|
|
References:
|
|
|
|
|
|
|
|
diff --git a/configure.in b/configure.in
|
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
2014-07-28 15:29:31 +02:00
|
|
|
@@ -8231,16 +8231,31 @@ if test "$MOZ_ENABLE_SKIA"; then
|
|
|
|
MOZ_ENABLE_SKIA_GPU=1
|
|
|
|
AC_DEFINE(USE_SKIA_GPU)
|
|
|
|
AC_SUBST(MOZ_ENABLE_SKIA_GPU)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AC_SUBST(MOZ_ENABLE_SKIA)
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
dnl ========================================================
|
2009-01-09 01:36:46 +01:00
|
|
|
+dnl Check for nss-shared-helper
|
|
|
|
+dnl ========================================================
|
|
|
|
+
|
2010-12-10 10:44:42 +01:00
|
|
|
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper,
|
2011-06-28 20:42:13 +02:00
|
|
|
+ [MOZ_ENABLE_NSSHELPER=1],
|
|
|
|
+ [MOZ_ENABLE_NSSHELPER=])
|
2009-01-09 01:36:46 +01:00
|
|
|
+
|
|
|
|
+if test "$MOZ_ENABLE_NSSHELPER"; then
|
|
|
|
+ AC_DEFINE(MOZ_ENABLE_NSSHELPER)
|
|
|
|
+fi
|
|
|
|
+AC_SUBST(MOZ_ENABLE_NSSHELPER)
|
|
|
|
+AC_SUBST(NSSHELPER_CFLAGS)
|
|
|
|
+AC_SUBST(NSSHELPER_LIBS)
|
2010-07-24 17:36:48 +02:00
|
|
|
+
|
|
|
|
+dnl ========================================================
|
2014-07-28 15:29:31 +02:00
|
|
|
dnl disable xul
|
2013-09-16 11:26:56 +02:00
|
|
|
dnl ========================================================
|
2014-07-28 15:29:31 +02:00
|
|
|
MOZ_ARG_DISABLE_BOOL(xul,
|
|
|
|
[ --disable-xul Disable XUL],
|
|
|
|
MOZ_XUL= )
|
|
|
|
if test "$MOZ_XUL"; then
|
|
|
|
AC_DEFINE(MOZ_XUL)
|
|
|
|
else
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in
|
2014-07-28 15:29:31 +02:00
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
2009-07-21 12:08:52 +02:00
|
|
|
+++ b/security/manager/ssl/src/Makefile.in
|
2014-07-28 15:29:31 +02:00
|
|
|
@@ -0,0 +1,8 @@
|
|
|
|
+#! gmake
|
|
|
|
+#
|
|
|
|
+# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
+# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
+
|
2013-09-16 11:26:56 +02:00
|
|
|
+LOCAL_INCLUDES += $(NSSHELPER_CFLAGS)
|
2011-09-26 15:57:38 +02:00
|
|
|
+EXTRA_DSO_LDOPTS += $(NSSHELPER_LIBS)
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp
|
|
|
|
--- a/security/manager/ssl/src/nsNSSComponent.cpp
|
|
|
|
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
|
2013-09-16 11:26:56 +02:00
|
|
|
@@ -3,16 +3,23 @@
|
2012-08-28 21:12:48 +02:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-07-24 17:36:48 +02:00
|
|
|
|
2013-09-16 11:26:56 +02:00
|
|
|
#ifdef MOZ_LOGGING
|
|
|
|
#define FORCE_PR_LOG 1
|
|
|
|
#endif
|
|
|
|
|
2009-01-09 01:36:46 +01:00
|
|
|
+#ifdef MOZ_ENABLE_NSSHELPER
|
|
|
|
+#pragma GCC visibility push(default)
|
|
|
|
+#include <nss-shared-helper.h>
|
|
|
|
+#pragma GCC visibility pop
|
|
|
|
+#include "prenv.h"
|
|
|
|
+#endif
|
2010-07-24 17:36:48 +02:00
|
|
|
+
|
2009-01-09 01:36:46 +01:00
|
|
|
#include "nsNSSComponent.h"
|
2010-07-24 17:36:48 +02:00
|
|
|
|
2014-07-28 15:29:31 +02:00
|
|
|
#include "ExtendedValidation.h"
|
|
|
|
#include "NSSCertDBTrustDomain.h"
|
|
|
|
#include "mozilla/Telemetry.h"
|
2013-09-16 11:26:56 +02:00
|
|
|
#include "nsCertVerificationThread.h"
|
2010-07-24 17:36:48 +02:00
|
|
|
#include "nsAppDirectoryServiceDefs.h"
|
2013-09-16 11:26:56 +02:00
|
|
|
#include "nsComponentManagerUtils.h"
|
2014-07-28 15:29:31 +02:00
|
|
|
@@ -1141,17 +1148,31 @@ nsNSSComponent::InitializeNSS()
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsPSMInitPanic::SetPanic();
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
SECStatus init_rv = SECFailure;
|
|
|
|
if (!profileStr.IsEmpty()) {
|
|
|
|
// First try to initialize the NSS DB in read/write mode.
|
|
|
|
- SECStatus init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false);
|
2009-01-09 01:36:46 +01:00
|
|
|
+#ifdef MOZ_ENABLE_NSSHELPER
|
2011-12-20 09:05:23 +01:00
|
|
|
+ if (PR_GetEnv("MOZ_TB_NO_NSSHELPER")) {
|
2014-07-28 15:29:31 +02:00
|
|
|
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false);
|
2009-01-09 01:36:46 +01:00
|
|
|
+ } else {
|
2014-07-28 15:29:31 +02:00
|
|
|
+ uint32_t flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE;
|
|
|
|
+ init_rv = ::nsshelp_open_db ("Thunderbird", profileStr.get(), flags);
|
2009-01-09 01:36:46 +01:00
|
|
|
+
|
|
|
|
+ if (init_rv != SECSuccess) {
|
|
|
|
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get()));
|
2014-07-28 15:29:31 +02:00
|
|
|
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false);
|
2009-01-09 01:36:46 +01:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#else
|
2014-07-28 15:29:31 +02:00
|
|
|
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false);
|
2009-01-09 01:36:46 +01:00
|
|
|
+#endif
|
2014-07-28 15:29:31 +02:00
|
|
|
// If that fails, attempt read-only mode.
|
2009-01-09 01:36:46 +01:00
|
|
|
if (init_rv != SECSuccess) {
|
2014-07-28 15:29:31 +02:00
|
|
|
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init NSS r/w in %s\n", profileStr.get()));
|
|
|
|
init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), true);
|
|
|
|
}
|
|
|
|
if (init_rv != SECSuccess) {
|
|
|
|
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init in r/o either\n"));
|
|
|
|
}
|
|
|
|
diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk
|
|
|
|
--- a/toolkit/library/libxul.mk
|
|
|
|
+++ b/toolkit/library/libxul.mk
|
|
|
|
@@ -146,17 +146,17 @@ OS_LIBS += $(call EXPAND_LIBNAME,mfuuid
|
2011-08-02 14:57:20 +02:00
|
|
|
endif
|
2014-07-28 15:29:31 +02:00
|
|
|
|
|
|
|
ifdef MOZ_DIRECTSHOW
|
|
|
|
OS_LIBS += $(call EXPAND_LIBNAME,dmoguids wmcodecdspuuid strmiids msdmo)
|
2010-07-24 17:36:48 +02:00
|
|
|
endif
|
2009-07-21 12:08:52 +02:00
|
|
|
|
2013-09-16 11:26:56 +02:00
|
|
|
EXTRA_DSO_LDOPTS += $(LIBS_DIR)
|
2011-08-02 14:57:20 +02:00
|
|
|
|
2011-06-28 20:42:13 +02:00
|
|
|
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
|
|
|
|
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS)
|
2009-01-09 01:36:46 +01:00
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
2011-06-28 20:42:13 +02:00
|
|
|
OS_LIBS += \
|
2014-07-28 15:29:31 +02:00
|
|
|
$(TK_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (OpenBSD,$(OS_ARCH))
|