Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4d6dbdf

Browse files
committed
Backed out 2 changesets (bug 1562952) for causing mar-tools failures a=backout
Backed out changeset 6b09d4c0868c (bug 1562952) Backed out changeset 250696e18e7d (bug 1562952)
1 parent 20e91a0 commit 4d6dbdf

7 files changed

Lines changed: 71 additions & 28 deletions

File tree

browser/confvars.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ if test "$OS_ARCH" = "WINNT"; then
2828
fi
2929
fi
3030

31+
# Enable building ./signmar and running libmar signature tests
32+
MOZ_ENABLE_SIGNMAR=1
33+
3134
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
3235

3336
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh

build/moz.configure/old.configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def old_configure_options(*options):
205205
'--enable-pref-extensions',
206206
'--enable-readline',
207207
'--enable-sandbox',
208+
'--enable-signmar',
208209
'--enable-startup-notification',
209210
'--enable-startupcache',
210211
'--enable-strip',

modules/libmar/moz.build

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
with Files('**'):
88
BUG_COMPONENT = ('Toolkit', 'Application Update')
99

10-
DIRS += [
11-
'src',
12-
'sign',
13-
'tool',
14-
'verify',
15-
]
10+
DIRS += ['src']
11+
12+
if CONFIG['MOZ_ENABLE_SIGNMAR']:
13+
DIRS += ['sign']
14+
TEST_DIRS += ['tests']
15+
if CONFIG['MOZ_VERIFY_MAR_SIGNATURE']:
16+
DIRS += ['verify']
17+
18+
# If we are building ./sign and ./verify then ./tool must come after it
19+
DIRS += ['tool']
1620

17-
TEST_DIRS += ['tests']

modules/libmar/tests/moz.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# License, v. 2.0. If a copy of the MPL was not distributed with this
55
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

7-
if CONFIG['OS_TARGET'] != 'Android' and CONFIG['COMPILE_ENVIRONMENT']:
8-
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
7+
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
98

9+
if CONFIG['OS_TARGET'] != 'Android':
1010
TEST_HARNESS_FILES.xpcshell.modules.libmar.tests.unit += [
1111
'!/dist/bin/signmar%s' % CONFIG['BIN_SUFFIX'],
1212
]

modules/libmar/tool/mar.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,16 @@ static int mar_test(const char* path) {
124124
}
125125

126126
int main(int argc, char** argv) {
127+
char* NSSConfigDir = NULL;
127128
const char* certNames[MAX_SIGNATURES];
128129
char* MARChannelID = MAR_CHANNEL_ID;
129130
char* productVersion = MOZ_APP_VERSION;
130-
int rv = -1;
131-
#if !defined(NO_SIGN_VERIFY)
132-
char* NSSConfigDir = NULL;
133131
uint32_t k;
132+
int rv = -1;
134133
uint32_t certCount = 0;
135134
int32_t sigIndex = -1;
135+
136+
#if !defined(NO_SIGN_VERIFY)
136137
uint32_t fileSizes[MAX_SIGNATURES];
137138
const uint8_t* certBuffers[MAX_SIGNATURES];
138139
# if ((!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX)) || \
@@ -180,8 +181,8 @@ int main(int argc, char** argv) {
180181
argv += 2;
181182
argc -= 2;
182183
}
183-
#if !defined(NO_SIGN_VERIFY)
184-
#if (!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX)
184+
#if !defined(NO_SIGN_VERIFY) && \
185+
((!defined(MAR_NSS) && defined(XP_WIN)) || defined(XP_MACOSX))
185186
/* -D DERFilePath, also matches -D[index] DERFilePath
186187
We allow an index for verifying to be symmetric
187188
with the import and export command line arguments. */
@@ -222,9 +223,7 @@ int main(int argc, char** argv) {
222223
argv += 2;
223224
argc -= 2;
224225
}
225-
}
226-
#endif
227-
else if (argv[1][0] == '-' && argv[1][1] == 'H') { // MAR channel ID
226+
} else if (argv[1][0] == '-' && argv[1][1] == 'H') { // MAR channel ID
228227
MARChannelID = argv[2];
229228
argv += 2;
230229
argc -= 2;

modules/libmar/tool/moz.build

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,44 @@ HOST_USE_LIBS += [
1515
'hostmar',
1616
]
1717

18-
Program('signmar')
18+
if CONFIG['MOZ_ENABLE_SIGNMAR']:
19+
Program('signmar')
1920

20-
SOURCES += HOST_SOURCES
21+
SOURCES += HOST_SOURCES
2122

22-
USE_LIBS += [
23-
'mar',
24-
'nspr',
25-
'nss',
26-
'signmar',
27-
'verifymar',
28-
]
23+
USE_LIBS += [
24+
'mar',
25+
'signmar',
26+
]
27+
28+
if CONFIG['MOZ_VERIFY_MAR_SIGNATURE']:
29+
USE_LIBS += [
30+
'verifymar',
31+
]
2932

3033
for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
3134
DEFINES[var] = '"%s"' % CONFIG[var]
3235
HOST_DEFINES[var] = DEFINES[var]
3336

37+
if CONFIG['MOZ_ENABLE_SIGNMAR']:
38+
USE_LIBS += [
39+
'nspr',
40+
'nss',
41+
]
42+
else:
43+
DEFINES['NO_SIGN_VERIFY'] = True
44+
3445
if CONFIG['OS_ARCH'] == 'WINNT':
3546
USE_STATIC_LIBS = True
3647

3748
OS_LIBS += [
3849
'ws2_32',
39-
'crypt32',
40-
'advapi32',
4150
]
51+
if CONFIG['MOZ_ENABLE_SIGNMAR']:
52+
OS_LIBS += [
53+
'crypt32',
54+
'advapi32',
55+
]
4256
elif CONFIG['OS_ARCH'] == 'Darwin':
4357
OS_LIBS += [
4458
'-framework Security',

old-configure.in

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,28 @@ fi
21512151
AC_CHECK_PROGS(WGET, wget, "")
21522152
AC_SUBST(WGET)
21532153

2154+
dnl ========================================================
2155+
dnl Enable building the signmar program.
2156+
dnl This option is much different than the --enable-verify-mar option.
2157+
dnl --enable-verify-mar is for enabling the verification check on MAR
2158+
dnl files in the updater. The --enable-signmar option is for building
2159+
dnl the signmar program.
2160+
dnl ========================================================
2161+
2162+
MOZ_ARG_ENABLE_BOOL(signmar,
2163+
[ --enable-signmar Enable building the signmar program],
2164+
MOZ_ENABLE_SIGNMAR=1,
2165+
MOZ_ENABLE_SIGNMAR= )
2166+
2167+
if test -n "$MOZ_ENABLE_SIGNMAR"; then
2168+
if test -z "$COMPILE_ENVIRONMENT" ; then
2169+
AC_MSG_WARN([Cannot --enable-signmar with --disable-compile-environment])
2170+
MOZ_ENABLE_SIGNMAR=
2171+
else
2172+
AC_DEFINE(MOZ_ENABLE_SIGNMAR)
2173+
fi
2174+
fi
2175+
21542176
dnl ========================================================
21552177
dnl Updater
21562178
dnl ========================================================
@@ -2878,6 +2900,7 @@ AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
28782900
AC_SUBST(MOZ_CRASHREPORTER)
28792901
AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
28802902
AC_SUBST(MOZ_STUB_INSTALLER)
2903+
AC_SUBST(MOZ_ENABLE_SIGNMAR)
28812904
AC_SUBST(MOZ_UPDATER)
28822905

28832906
AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)

0 commit comments

Comments
 (0)