author | Wolfgang Rosenauer <wr@rosenauer.org> |
Fri, 28 Apr 2017 20:02:15 +0200 | |
branch | firefox52 |
changeset 973 | 28f802837a7a |
parent 935 | 9ae2b79d3bb1 |
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 |
||
916 | 7 |
diff --git a/old-configure.in b/old-configure.in |
8 |
--- a/old-configure.in |
|
9 |
+++ b/old-configure.in |
|
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
10 |
@@ -5358,16 +5358,31 @@ esac |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
11 |
|
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
12 |
AC_SUBST(MOZ_TREE_CAIRO) |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
13 |
AC_SUBST_LIST(MOZ_CAIRO_CFLAGS) |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
14 |
AC_SUBST_LIST(MOZ_CAIRO_LIBS) |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
15 |
AC_SUBST_LIST(MOZ_CAIRO_OSLIBS) |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
16 |
AC_SUBST(MOZ_TREE_PIXMAN) |
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 |
|
881 | 42 |
diff --git a/security/manager/ssl/moz.build b/security/manager/ssl/moz.build |
43 |
--- a/security/manager/ssl/moz.build |
|
44 |
+++ b/security/manager/ssl/moz.build |
|
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
45 |
@@ -160,16 +160,19 @@ if CONFIG['MOZ_XUL']: |
923 | 46 |
] |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
47 |
|
923 | 48 |
UNIFIED_SOURCES += [ |
49 |
'md4.c', |
|
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
50 |
] |
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
51 |
|
923 | 52 |
FINAL_LIBRARY = 'xul' |
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 |
+ |
904 | 57 |
LOCAL_INCLUDES += [ |
923 | 58 |
'/dom/base', |
59 |
'/dom/crypto', |
|
60 |
'/security/certverifier', |
|
61 |
'/security/pkix/include', |
|
881 | 62 |
] |
782
7c9b67ad12bb
preliminary rebase for mozilla-shared-nss-db.patch
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
63 |
|
923 | 64 |
LOCAL_INCLUDES += [ |
881 | 65 |
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp |
66 |
--- a/security/manager/ssl/nsNSSComponent.cpp |
|
67 |
+++ b/security/manager/ssl/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" |
923 | 86 |
#include "ScopedNSSTypes.h" |
904 | 87 |
#include "SharedSSLState.h" |
923 | 88 |
#include "cert.h" |
89 |
#include "certdb.h" |
|
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
90 |
@@ -1702,17 +1709,31 @@ nsNSSComponent::InitializeNSS() |
904 | 91 |
return rv; |
92 |
} |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
93 |
} |
904 | 94 |
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("inSafeMode: %u\n", inSafeMode)); |
881 | 95 |
|
96 |
if (!nocertdb && !profileStr.IsEmpty()) { |
|
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
97 |
// First try to initialize the NSS DB in read/write mode. |
904 | 98 |
// Only load PKCS11 modules if we're not in safe mode. |
1 | 99 |
+#ifdef MOZ_ENABLE_NSSHELPER |
100 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
904 | 101 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false, !inSafeMode); |
1 | 102 |
+ } else { |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
103 |
+ uint32_t flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
104 |
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), flags); |
1 | 105 |
+ |
106 |
+ if (init_rv != SECSuccess) { |
|
882 | 107 |
+ MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get())); |
904 | 108 |
+ init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false, !inSafeMode); |
1 | 109 |
+ } |
110 |
+ } |
|
111 |
+#else |
|
904 | 112 |
init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), false, !inSafeMode); |
1 | 113 |
+#endif |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
114 |
// If that fails, attempt read-only mode. |
1 | 115 |
if (init_rv != SECSuccess) { |
881 | 116 |
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("could not init NSS r/w in %s\n", profileStr.get())); |
904 | 117 |
init_rv = ::mozilla::psm::InitializeNSS(profileStr.get(), true, !inSafeMode); |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
118 |
} |
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
119 |
if (init_rv != SECSuccess) { |
881 | 120 |
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("could not init in r/o either\n")); |
716
cef565f1c325
update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
703
diff
changeset
|
121 |
} |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
122 |
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
|
123 |
--- a/toolkit/library/moz.build |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
124 |
+++ b/toolkit/library/moz.build |
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
125 |
@@ -220,16 +220,18 @@ OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS'] |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
126 |
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] |
289
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
127 |
|
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
128 |
if CONFIG['SERVO_TARGET_DIR']: |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
129 |
if CONFIG['_MSC_VER']: |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
130 |
OS_LIBS += ['%s/geckoservo' % CONFIG['SERVO_TARGET_DIR']] |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
131 |
else: |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
923
diff
changeset
|
132 |
OS_LIBS += ['-L%s' % CONFIG['SERVO_TARGET_DIR'], '-lgeckoservo'] |
916 | 133 |
|
804 | 134 |
+OS_LIBS += sorted(CONFIG['NSSHELPER_LIBS']) |
779 | 135 |
+ |
923 | 136 |
if CONFIG['MOZ_SYSTEM_JPEG']: |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
137 |
OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] |
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
138 |
|
923 | 139 |
if CONFIG['MOZ_SYSTEM_PNG']: |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
804
diff
changeset
|
140 |
OS_LIBS += CONFIG['MOZ_PNG_LIBS'] |
916 | 141 |
|
923 | 142 |
if CONFIG['MOZ_SYSTEM_HUNSPELL']: |
916 | 143 |
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] |