Bug 711139 - MOZ_VERIFY_MAR_SIGNATURE build option for verifying MAR signatures. r=rstrong. sr=khuey

This commit is contained in:
Brian R. Bondy 2012-02-24 16:29:41 -05:00
parent edd93a1353
commit 4ae40571d6
4 changed files with 24 additions and 0 deletions

View File

@ -42,6 +42,7 @@ MOZ_UPDATER=1
MOZ_PHOENIX=1
if test "$OS_ARCH" = "WINNT"; then
MOZ_VERIFY_MAR_SIGNATURE=1
if ! test "$HAVE_64BIT_OS"; then
MOZ_MAINTENANCE_SERVICE=1
fi

View File

@ -140,6 +140,7 @@ MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
XPCOM_USE_LEA = @XPCOM_USE_LEA@
MOZ_INSTALLER = @MOZ_INSTALLER@
MOZ_MAINTENANCE_SERVICE = @MOZ_MAINTENANCE_SERVICE@
MOZ_VERIFY_MAR_SIGNATURE = @MOZ_VERIFY_MAR_SIGNATURE@
MOZ_UPDATER = @MOZ_UPDATER@
MOZ_UPDATE_CHANNEL = @MOZ_UPDATE_CHANNEL@
MOZ_UPDATE_PACKAGING = @MOZ_UPDATE_PACKAGING@

View File

@ -6481,6 +6481,23 @@ if test -n "$MOZ_MAINTENANCE_SERVICE"; then
fi
fi
dnl ========================================================
dnl Verify MAR signatures
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(verify-mar,
[ --enable-verify-mar Enable verifying MAR signatures],
MOZ_VERIFY_MAR_SIGNATURE=1,
MOZ_VERIFY_MAR_SIGNATURE= )
if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
if test "$OS_ARCH" = "WINNT"; then
AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
else
AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target])
fi
fi
dnl ========================================================
dnl Updater
dnl ========================================================
@ -8589,6 +8606,7 @@ AC_SUBST(MOZ_ONLY_TOUCH_EVENTS)
AC_SUBST(MOZ_USER_DIR)
AC_SUBST(MOZ_CRASHREPORTER)
AC_SUBST(MOZ_MAINTENANCE_SERVICE)
AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
AC_SUBST(MOZ_UPDATER)
AC_SUBST(MOZ_ANGLE)
AC_SUBST(MOZ_DIRECTX_SDK_PATH)

View File

@ -1541,9 +1541,13 @@ UpdateThreadFunc(void *param)
NS_T("%s/update.mar"), gSourcePath);
rv = gArchiveReader.Open(dataFile);
#ifdef MOZ_VERIFY_MAR_SIGNATURE
if (rv == OK) {
rv = gArchiveReader.VerifySignature();
}
#endif
if (rv == OK) {
rv = DoUpdate();
gArchiveReader.Close();