author | Wolfgang Rosenauer <wr@rosenauer.org> |
Thu, 11 Dec 2014 21:39:01 +0100 | |
branch | firefox35 |
changeset 817 | 8ee1122377bb |
parent 807 | f54c68340963 |
child 828 | 59013b3a51f5 |
permissions | -rw-r--r-- |
1 | 1 |
From: Hans Petter Jansson <hpj@copyleft.no> |
2 |
Wolfgang Rosenauer <wr@rosenauer.org> |
|
3 |
Subject: use libnsssharedhelper if available at compile time |
|
4 |
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1) |
|
5 |
References: |
|
6 |
||
7 |
diff --git a/configure.in b/configure.in |
|
8 |
--- a/configure.in |
|
9 |
+++ b/configure.in |
|
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
10 |
@@ -8302,16 +8302,31 @@ if test "$MOZ_ENABLE_SKIA"; then |
703 | 11 |
MOZ_ENABLE_SKIA_GPU=1 |
12 |
AC_DEFINE(USE_SKIA_GPU) |
|
13 |
AC_SUBST(MOZ_ENABLE_SKIA_GPU) |
|
14 |
fi |
|
15 |
fi |
|
16 |
AC_SUBST(MOZ_ENABLE_SKIA) |
|
1 | 17 |
|
18 |
dnl ======================================================== |
|
19 |
+dnl Check for nss-shared-helper |
|
20 |
+dnl ======================================================== |
|
21 |
+ |
|
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
22 |
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper, |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
23 |
+ [MOZ_ENABLE_NSSHELPER=1], |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
24 |
+ [MOZ_ENABLE_NSSHELPER=]) |
1 | 25 |
+ |
26 |
+if test "$MOZ_ENABLE_NSSHELPER"; then |
|
27 |
+ AC_DEFINE(MOZ_ENABLE_NSSHELPER) |
|
28 |
+fi |
|
29 |
+AC_SUBST(MOZ_ENABLE_NSSHELPER) |
|
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
30 |
+AC_SUBST_LIST(NSSHELPER_CFLAGS) |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
31 |
+AC_SUBST_LIST(NSSHELPER_LIBS) |
1 | 32 |
+ |
33 |
+dnl ======================================================== |
|
703 | 34 |
dnl disable xul |
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
35 |
dnl ======================================================== |
703 | 36 |
MOZ_ARG_DISABLE_BOOL(xul, |
37 |
[ --disable-xul Disable XUL], |
|
38 |
MOZ_XUL= ) |
|
39 |
if test "$MOZ_XUL"; then |
|
40 |
AC_DEFINE(MOZ_XUL) |
|
41 |
else |
|
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
42 |
diff --git a/security/manager/ssl/src/moz.build b/security/manager/ssl/src/moz.build |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
43 |
--- a/security/manager/ssl/src/moz.build |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
44 |
+++ b/security/manager/ssl/src/moz.build |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
45 |
@@ -95,16 +95,19 @@ FAIL_ON_WARNINGS = True |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
46 |
|
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
47 |
FINAL_LIBRARY = 'xul' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
48 |
|
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
49 |
LOCAL_INCLUDES += [ |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
50 |
'../../../certverifier', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
51 |
'../../../pkix/include', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
52 |
] |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
53 |
|
804 | 54 |
+CXXFLAGS += sorted(CONFIG['NSSHELPER_CFLAGS']) |
55 |
+OS_LIBS += sorted(CONFIG['NSSHELPER_LIBS']) |
|
686
ab25aac2aa83
Firefox 26.0b5 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
680
diff
changeset
|
56 |
+ |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
57 |
if CONFIG['NSS_DISABLE_DBM']: |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
58 |
DEFINES['NSS_DISABLE_DBM'] = '1' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
59 |
|
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
60 |
DEFINES['SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES'] = 'True' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
61 |
DEFINES['NSS_ENABLE_ECC'] = 'True' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
62 |
for var in ('DLL_PREFIX', 'DLL_SUFFIX'): |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
63 |
DEFINES[var] = '"%s"' % CONFIG[var] |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
64 |
|
1 | 65 |
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp |
66 |
--- a/security/manager/ssl/src/nsNSSComponent.cpp |
|
67 |
+++ b/security/manager/ssl/src/nsNSSComponent.cpp |
|
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
68 |
@@ -1,14 +1,21 @@ |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
69 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
70 |
* |
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
71 |
* This Source Code Form is subject to the terms of the Mozilla Public |
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
72 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
73 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1 | 74 |
|
75 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
76 |
+#pragma GCC visibility push(default) |
|
77 |
+#include <nss-shared-helper.h> |
|
78 |
+#pragma GCC visibility pop |
|
79 |
+#include "prenv.h" |
|
80 |
+#endif |
|
81 |
+ |
|
82 |
#include "nsNSSComponent.h" |
|
653 | 83 |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
84 |
#include "ExtendedValidation.h" |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
85 |
#include "NSSCertDBTrustDomain.h" |
699 | 86 |
#include "mozilla/Telemetry.h" |
1 | 87 |
#include "nsCertVerificationThread.h" |
659 | 88 |
#include "nsAppDirectoryServiceDefs.h" |
89 |
#include "nsComponentManagerUtils.h" |
|
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
90 |
@@ -945,17 +952,31 @@ nsNSSComponent::InitializeNSS() |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
91 |
if (NS_FAILED(rv)) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
92 |
nsPSMInitPanic::SetPanic(); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
93 |
return NS_ERROR_NOT_AVAILABLE; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
94 |
} |
1 | 95 |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
96 |
SECStatus init_rv = SECFailure; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
97 |
if (!profileStr.IsEmpty()) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
98 |
// First try to initialize the NSS DB in read/write mode. |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
99 |
- SECStatus init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 100 |
+#ifdef MOZ_ENABLE_NSSHELPER |
101 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
102 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 103 |
+ } else { |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
104 |
+ uint32_t flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
105 |
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), flags); |
1 | 106 |
+ |
107 |
+ if (init_rv != SECSuccess) { |
|
108 |
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get())); |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
109 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 110 |
+ } |
111 |
+ } |
|
112 |
+#else |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
113 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 114 |
+#endif |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
115 |
// If that fails, attempt read-only mode. |
1 | 116 |
if (init_rv != SECSuccess) { |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
117 |
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init NSS r/w in %s\n", profileStr.get())); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
118 |
init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), true); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
119 |
} |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
120 |
if (init_rv != SECSuccess) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
121 |
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("could not init in r/o either\n")); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
122 |
} |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
123 |
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
124 |
--- a/toolkit/library/moz.build |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
125 |
+++ b/toolkit/library/moz.build |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
126 |
@@ -213,16 +213,18 @@ if CONFIG['MOZ_B2G_CAMERA']: |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
127 |
'stagefright_omx', |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
128 |
] |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
129 |
|
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
130 |
if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android': |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
131 |
OS_LIBS += [ |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
132 |
'rt', |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
133 |
] |
289
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
134 |
|
804 | 135 |
+OS_LIBS += sorted(CONFIG['NSSHELPER_LIBS']) |
779 | 136 |
+ |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
137 |
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS'] |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
138 |
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
139 |
|
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
140 |
if CONFIG['MOZ_NATIVE_JPEG']: |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
141 |
OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
142 |
|
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
143 |
if CONFIG['MOZ_NATIVE_PNG']: |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
144 |
OS_LIBS += CONFIG['MOZ_PNG_LIBS'] |