author | Wolfgang Rosenauer <wr@rosenauer.org> |
Tue, 11 Nov 2014 21:46:09 +0100 | |
changeset 805 | e14da82b1332 |
parent 804 | c64eecb7772c |
child 807 | f54c68340963 |
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 |
|
804 | 10 |
@@ -8199,16 +8199,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 |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
45 |
@@ -91,16 +91,19 @@ FAIL_ON_WARNINGS = True |
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 |
|
596 | 68 |
@@ -3,16 +3,23 @@ |
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
69 |
* 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
|
70 |
* 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
|
71 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1 | 72 |
|
596 | 73 |
#ifdef MOZ_LOGGING |
74 |
#define FORCE_PR_LOG 1 |
|
75 |
#endif |
|
76 |
||
1 | 77 |
+#ifdef MOZ_ENABLE_NSSHELPER |
78 |
+#pragma GCC visibility push(default) |
|
79 |
+#include <nss-shared-helper.h> |
|
80 |
+#pragma GCC visibility pop |
|
81 |
+#include "prenv.h" |
|
82 |
+#endif |
|
83 |
+ |
|
84 |
#include "nsNSSComponent.h" |
|
653 | 85 |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
86 |
#include "ExtendedValidation.h" |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
87 |
#include "NSSCertDBTrustDomain.h" |
699 | 88 |
#include "mozilla/Telemetry.h" |
1 | 89 |
#include "nsCertVerificationThread.h" |
659 | 90 |
#include "nsAppDirectoryServiceDefs.h" |
91 |
#include "nsComponentManagerUtils.h" |
|
804 | 92 |
@@ -943,17 +950,31 @@ nsNSSComponent::InitializeNSS() |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
93 |
if (NS_FAILED(rv)) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
94 |
nsPSMInitPanic::SetPanic(); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
95 |
return NS_ERROR_NOT_AVAILABLE; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
96 |
} |
1 | 97 |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
98 |
SECStatus init_rv = SECFailure; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
99 |
if (!profileStr.IsEmpty()) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
100 |
// 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
|
101 |
- SECStatus init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 102 |
+#ifdef MOZ_ENABLE_NSSHELPER |
103 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
104 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 105 |
+ } else { |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
106 |
+ uint32_t flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
107 |
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), flags); |
1 | 108 |
+ |
109 |
+ if (init_rv != SECSuccess) { |
|
110 |
+ 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
|
111 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 112 |
+ } |
113 |
+ } |
|
114 |
+#else |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
115 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false); |
1 | 116 |
+#endif |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
117 |
// If that fails, attempt read-only mode. |
1 | 118 |
if (init_rv != SECSuccess) { |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
119 |
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
|
120 |
init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), true); |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
121 |
} |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
122 |
if (init_rv != SECSuccess) { |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
123 |
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
|
124 |
} |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
125 |
diff --git a/toolkit/library/libxul.mozbuild b/toolkit/library/libxul.mozbuild |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
126 |
--- a/toolkit/library/libxul.mozbuild |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
127 |
+++ b/toolkit/library/libxul.mozbuild |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
128 |
@@ -22,16 +22,18 @@ DELAYLOAD_DLLS += [ |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
129 |
'psapi.dll', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
130 |
'rasapi32.dll', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
131 |
'rasdlg.dll', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
132 |
'secur32.dll', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
133 |
'wininet.dll', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
134 |
'winspool.drv' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
135 |
] |
289
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
136 |
|
804 | 137 |
+OS_LIBS += sorted(CONFIG['NSSHELPER_LIBS']) |
779 | 138 |
+ |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
139 |
if CONFIG['MOZ_METRO']: |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
140 |
DELAYLOAD_DLLS += [ |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
141 |
'API-MS-WIN-CORE-WINRT-L' + CONFIG['CRTEXPDLLVERSION'] + '.DLL', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
142 |
'API-MS-WIN-CORE-WINRT-STRING-L' + CONFIG['CRTEXPDLLVERSION'] + '.DLL', |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
143 |
'uiautomationcore.dll' |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
144 |
] |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
145 |
|
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
146 |
if CONFIG['ACCESSIBILITY']: |