MozillaFirefox/mozilla-shared-nss-db.patch
Wolfgang Rosenauer 8915242f46 - update to Firefox 28.0 (bnc#868603)
* MFSA 2014-15/CVE-2014-1493/CVE-2014-1494
    Miscellaneous memory safety hazards
  * MFSA 2014-17/CVE-2014-1497 (bmo#966311)
    Out of bounds read during WAV file decoding
  * MFSA 2014-18/CVE-2014-1498 (bmo#935618)
    crypto.generateCRMFRequest does not validate type of key
  * MFSA 2014-19/CVE-2014-1499 (bmo#961512)
    Spoofing attack on WebRTC permission prompt
  * MFSA 2014-20/CVE-2014-1500 (bmo#956524)
    onbeforeunload and Javascript navigation DOS
  * MFSA 2014-22/CVE-2014-1502 (bmo#972622)
    WebGL content injection from one domain to rendering in another
  * MFSA 2014-23/CVE-2014-1504 (bmo#911547)
    Content Security Policy for data: documents not preserved by
    session restore
  * MFSA 2014-26/CVE-2014-1508 (bmo#963198)
    Information disclosure through polygon rendering in MathML
  * MFSA 2014-27/CVE-2014-1509 (bmo#966021)
    Memory corruption in Cairo during PDF font rendering
  * MFSA 2014-28/CVE-2014-1505 (bmo#941887)
    SVG filters information disclosure through feDisplacementMap
  * MFSA 2014-29/CVE-2014-1510/CVE-2014-1511 (bmo#982906, bmo#982909)
    Privilege escalation using WebIDL-implemented APIs
  * MFSA 2014-30/CVE-2014-1512 (bmo#982957)
    Use-after-free in TypeObject
  * MFSA 2014-31/CVE-2014-1513 (bmo#982974)
    Out-of-bounds read/write through neutering ArrayBuffer objects
  * MFSA 2014-32/CVE-2014-1514 (bmo#983344)
    Out-of-bounds write through TypedArrayObject after neutering

OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=370
2014-03-18 19:44:32 +00:00

142 lines
4.8 KiB
Diff

From: Hans Petter Jansson <hpj@copyleft.no>
Wolfgang Rosenauer <wr@rosenauer.org>
Subject: use libnsssharedhelper if available at compile time
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1)
References:
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -8042,16 +8042,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)
dnl ========================================================
+dnl Check for nss-shared-helper
+dnl ========================================================
+
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper,
+ [MOZ_ENABLE_NSSHELPER=1],
+ [MOZ_ENABLE_NSSHELPER=])
+
+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)
+
+dnl ========================================================
dnl disable xul
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(xul,
[ --disable-xul Disable XUL],
MOZ_XUL= )
if test "$MOZ_XUL"; then
AC_DEFINE(MOZ_XUL)
else
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/src/Makefile.in
@@ -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/.
+
+LOCAL_INCLUDES += $(NSSHELPER_CFLAGS)
+EXTRA_DSO_LDOPTS += $(NSSHELPER_LIBS)
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
@@ -3,16 +3,23 @@
* 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/. */
#ifdef MOZ_LOGGING
#define FORCE_PR_LOG 1
#endif
+#ifdef MOZ_ENABLE_NSSHELPER
+#pragma GCC visibility push(default)
+#include <nss-shared-helper.h>
+#pragma GCC visibility pop
+#include "prenv.h"
+#endif
+
#include "nsNSSComponent.h"
#include "CertVerifier.h"
#include "mozilla/Telemetry.h"
#include "nsCertVerificationThread.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsComponentManagerUtils.h"
#include "nsDirectoryServiceDefs.h"
@@ -1207,18 +1214,35 @@ nsNSSComponent::InitializeNSS()
ConfigureInternalPKCS11Token();
// The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs
// module by NSS_Initialize because we will load it in InstallLoadableRoots
// later. It also allows us to work around a bug in the system NSS in
// Ubuntu 8.04, which loads any nonexistent "<configdir>/libnssckbi.so" as
// "/usr/lib/nss/libnssckbi.so".
uint32_t init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE;
- SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "",
- SECMOD_DB, init_flags);
+
+ SECStatus init_rv = SECFailure;
+#ifdef MOZ_ENABLE_NSSHELPER
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) {
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
+ SECMOD_DB, init_flags);
+ } else {
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), init_flags);
+
+ if (init_rv != SECSuccess) {
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get()));
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
+ SECMOD_DB, init_flags);
+ }
+ }
+#else
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
+ SECMOD_DB, init_flags);
+#endif
if (init_rv != SECSuccess) {
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get()));
// try to init r/o
init_flags |= NSS_INIT_READONLY;
init_rv = ::NSS_Initialize(profileStr.get(), "", "",
SECMOD_DB, init_flags);
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -245,17 +245,17 @@ endif
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
SDK_LIBRARY = $(IMPORT_LIBRARY)
else
SDK_LIBRARY = $(SHARED_LIBRARY)
endif
EXTRA_DSO_LDOPTS += $(LIBS_DIR)
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS)
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
CXXFLAGS += $(TK_CFLAGS)
OS_LIBS += \
-framework SystemConfiguration \
-framework QTKit \
-framework IOKit \
-F$(MACOS_PRIVATE_FRAMEWORKS_DIR) -framework CoreUI \