lists.torproject.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

tbb-commits

Thread Start a new thread
Threads by month
  • ----- 2026 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2015 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2014 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
tbb-commits@lists.torproject.org

  • 1 participants
  • 20633 discussions
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 23970: Printing to a file is broken with Linux content sandboxing enabled
by gk@torproject.org 15 Dec '17

15 Dec '17
commit e1e2517a187f7a867f819c7294e62d93ad32b1ba Author: Richard Pospesel <richard(a)torproject.org> Date: Mon Nov 27 15:04:21 2017 -0800 Bug 23970: Printing to a file is broken with Linux content sandboxing enabled Ported over firefox patch 997c6b961cd0 (Bug 1329835) --- gfx/thebes/gfxFcPlatformFontList.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 601e7a90cbd6..19471157ba84 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -768,18 +768,20 @@ PreparePattern(FcPattern* aPattern, bool aIsPrinterFont) FcPatternAddBool(aPattern, PRINTING_FC_PROPERTY, FcTrue); } else { #ifdef MOZ_WIDGET_GTK - ApplyGdkScreenFontOptions(aPattern); -#endif + ApplyGdkScreenFontOptions(aPattern); #ifdef MOZ_X11 FcValue value; int lcdfilter; - if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value) - == FcResultNoMatch && - GetXftInt(DefaultXDisplay(), "lcdfilter", &lcdfilter)) { - FcPatternAddInteger(aPattern, FC_LCD_FILTER, lcdfilter); + if (FcPatternGet(aPattern, FC_LCD_FILTER, 0, &value) == FcResultNoMatch) { + GdkDisplay* dpy = gdk_display_get_default(); + if (GDK_IS_X11_DISPLAY(dpy) && + GetXftInt(GDK_DISPLAY_XDISPLAY(dpy), "lcdfilter", &lcdfilter)) { + FcPatternAddInteger(aPattern, FC_LCD_FILTER, lcdfilter); + } } -#endif +#endif // MOZ_X11 +#endif // MOZ_WIDGET_GTK } FcDefaultSubstitute(aPattern);
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 23970: Printing to a file is broken with Linux content sandboxing enabled
by gk@torproject.org 15 Dec '17

15 Dec '17
commit 9dadb90813c148d623d3bd35b629eebf499d27c4 Author: Richard Pospesel <richard(a)torproject.org> Date: Mon Nov 27 13:57:32 2017 -0800 Bug 23970: Printing to a file is broken with Linux content sandboxing enabled Ported over firefox patch 5c25a123203a (Bug 1309205 Part 1) --- gfx/2d/2D.h | 12 ++++++++++++ gfx/2d/Factory.cpp | 25 +++++++++++++++++++++++++ gfx/thebes/gfxAndroidPlatform.h | 4 +--- gfx/thebes/gfxFT2FontList.cpp | 10 +++++----- gfx/thebes/gfxFontconfigFonts.h | 5 ++--- gfx/thebes/gfxPlatform.cpp | 4 ++++ gfx/thebes/gfxPlatform.h | 5 +++++ gfx/thebes/gfxPlatformGtk.cpp | 10 ++++++++++ gfx/thebes/gfxPlatformGtk.h | 2 ++ 9 files changed, 66 insertions(+), 11 deletions(-) diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index c1fba3463a8f..3d5fb52ad925 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -41,6 +41,9 @@ typedef _cairo_scaled_font cairo_scaled_font_t; struct _FcPattern; typedef _FcPattern FcPattern; +struct FT_LibraryRec_; +typedef FT_LibraryRec_* FT_Library; + struct ID3D11Texture2D; struct ID3D11Device; struct ID2D1Device; @@ -1483,6 +1486,15 @@ public: CreateCGGlyphRenderingOptions(const Color &aFontSmoothingBackgroundColor); #endif +#ifdef MOZ_ENABLE_FREETYPE + static void SetFTLibrary(FT_Library aFTLibrary); + static FT_Library GetFTLibrary(); + +private: + static FT_Library mFTLibrary; +public: +#endif + #ifdef WIN32 static already_AddRefed<DrawTarget> CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat); diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index 5cd5d14eaba1..ceebce690afb 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -156,6 +156,10 @@ namespace gfx { // In Gecko, this value is managed by gfx.logging.level in gfxPrefs. int32_t LoggingPrefs::sGfxLogLevel = LOG_DEFAULT; +#ifdef MOZ_ENABLE_FREETYPE +FT_Library Factory::mFTLibrary = nullptr; +#endif + #ifdef WIN32 ID3D11Device *Factory::mD3D11Device = nullptr; ID2D1Device *Factory::mD2D1Device = nullptr; @@ -192,6 +196,12 @@ Factory::ShutDown() delete sConfig; sConfig = nullptr; } + +#ifdef MOZ_ENABLE_FREETYPE + if (mFTLibrary) { + mFTLibrary = nullptr; + } +#endif } bool @@ -579,6 +589,21 @@ Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB) } +#ifdef MOZ_ENABLE_FREETYPE +void +Factory::SetFTLibrary(FT_Library aFTLibrary) +{ + mFTLibrary = aFTLibrary; +} + +FT_Library +Factory::GetFTLibrary() +{ + MOZ_ASSERT(mFTLibrary); + return mFTLibrary; +} +#endif + #ifdef WIN32 already_AddRefed<DrawTarget> Factory::CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat) diff --git a/gfx/thebes/gfxAndroidPlatform.h b/gfx/thebes/gfxAndroidPlatform.h index 30e7c89babeb..889928da86a7 100644 --- a/gfx/thebes/gfxAndroidPlatform.h +++ b/gfx/thebes/gfxAndroidPlatform.h @@ -19,8 +19,6 @@ namespace mozilla { }; using mozilla::dom::FontListEntry; -typedef struct FT_LibraryRec_ *FT_Library; - class gfxAndroidPlatform : public gfxPlatform { public: gfxAndroidPlatform(); @@ -60,7 +58,7 @@ public: virtual bool FontHintingEnabled() override; virtual bool RequiresLinearZoom() override; - FT_Library GetFTLibrary(); + FT_Library GetFTLibrary() override; virtual bool CanRenderContentToDataSurface() const override { return true; diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 8a652df0dd34..2d9e09efe1c0 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -13,7 +13,6 @@ #include "mozilla/UniquePtr.h" #include "mozilla/UniquePtrExtensions.h" #include "nsIInputStream.h" -#define gfxToolkitPlatform gfxAndroidPlatform #include "nsXULAppAPI.h" #include <dirent.h> @@ -85,7 +84,8 @@ public: NS_ASSERTION(!aFontEntry->mFilename.IsEmpty(), "can't use AutoFTFace for fonts without a filename"); - FT_Library ft = gfxToolkitPlatform::GetPlatform()->GetFTLibrary(); + FT_Library ft = gfxPlatform::GetPlatform()->GetFTLibrary(); + MOZ_ASSERT(ft); // A relative path (no initial "/") means this is a resource in // omnijar, not an installed font on the device. @@ -256,7 +256,7 @@ FT2FontEntry::CreateFontEntry(const nsAString& aFontName, // eventually deleted. FT_Face face; FT_Error error = - FT_New_Memory_Face(gfxToolkitPlatform::GetPlatform()->GetFTLibrary(), + FT_New_Memory_Face(gfxPlatform::GetPlatform()->GetFTLibrary(), aFontData, aLength, 0, &face); if (error != FT_Err_Ok) { free((void*)aFontData); @@ -974,7 +974,7 @@ gfxFT2FontList::AppendFacesFromFontFile(const nsCString& aFileName, return; } - FT_Library ftLibrary = gfxAndroidPlatform::GetPlatform()->GetFTLibrary(); + FT_Library ftLibrary = gfxPlatform::GetPlatform()->GetFTLibrary(); FT_Face dummy; if (FT_Err_Ok == FT_New_Face(ftLibrary, aFileName.get(), -1, &dummy)) { LOG(("reading font info via FreeType for %s", aFileName.get())); @@ -1126,7 +1126,7 @@ gfxFT2FontList::AppendFacesFromOmnijarEntry(nsZipArchive* aArchive, return; } - FT_Library ftLibrary = gfxAndroidPlatform::GetPlatform()->GetFTLibrary(); + FT_Library ftLibrary = gfxPlatform::GetPlatform()->GetFTLibrary(); FT_Face dummy; if (FT_Err_Ok != FT_New_Memory_Face(ftLibrary, buf.get(), bufSize, 0, &dummy)) { diff --git a/gfx/thebes/gfxFontconfigFonts.h b/gfx/thebes/gfxFontconfigFonts.h index cea9d0dbfaf2..cd59cfc68c62 100644 --- a/gfx/thebes/gfxFontconfigFonts.h +++ b/gfx/thebes/gfxFontconfigFonts.h @@ -55,6 +55,8 @@ public: const uint8_t* aFontData, uint32_t aLength); + static FT_Library GetFTLibrary(); + private: virtual gfxFont *GetFontAt(int32_t i, uint32_t aCh = 0x20); @@ -116,9 +118,6 @@ private: nsIAtom *aLanguage, nsTArray<nsString>& aGenericFamilies); - - friend class gfxSystemFcFontEntry; - static FT_Library GetFTLibrary(); }; #endif /* GFX_FONTCONFIG_FONTS_H */ diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 2e4ec990f8b3..4843554d655b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -752,6 +752,10 @@ gfxPlatform::Init() NS_RUNTIMEABORT("Could not initialize gfxFontCache"); } +#ifdef MOZ_ENABLE_FREETYPE + Factory::SetFTLibrary(gPlatform->GetFTLibrary()); +#endif + /* Create and register our CMS Override observer. */ gPlatform->mSRGBOverrideObserver = new SRGBOverrideObserver(); Preferences::AddWeakObserver(gPlatform->mSRGBOverrideObserver, GFX_PREF_CMS_FORCE_SRGB); diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 68bb99ea44e9..5ef792b67a40 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -39,6 +39,7 @@ class nsIAtom; class nsIObserver; class SRGBOverrideObserver; class gfxTextPerfMetrics; +typedef struct FT_LibraryRec_ *FT_Library; namespace mozilla { namespace gl { @@ -681,6 +682,10 @@ public: */ virtual void ImportGPUDeviceData(const mozilla::gfx::GPUDeviceData& aData); + virtual FT_Library GetFTLibrary() { + return nullptr; + } + protected: gfxPlatform(); virtual ~gfxPlatform(); diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 9d7f512f27a7..c8661a433111 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -348,6 +348,16 @@ gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName, aFontData, aLength); } +FT_Library +gfxPlatformGtk::GetFTLibrary() +{ + if (sUseFcFontList) { + return gfxFcPlatformFontList::GetFTLibrary(); + } + + return gfxPangoFontGroup::GetFTLibrary(); +} + bool gfxPlatformGtk::IsFontFormatSupported(nsIURI *aFontURI, uint32_t aFormatFlags) { diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h index 982390d1867b..d0c6079bd943 100644 --- a/gfx/thebes/gfxPlatformGtk.h +++ b/gfx/thebes/gfxPlatformGtk.h @@ -95,6 +95,8 @@ public: */ virtual void FlushContentDrawing() override; + FT_Library GetFTLibrary() override; + #if (MOZ_WIDGET_GTK == 2) static void SetGdkDrawable(cairo_surface_t *target, GdkDrawable *drawable);
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 23970: Printing to a file is broken with Linux content sandboxing enabled
by gk@torproject.org 15 Dec '17

15 Dec '17
commit b23c1c6e66cfca06fb3a3c9ad370fcd466ecb963 Author: Richard Pospesel <richard(a)torproject.org> Date: Mon Nov 27 14:49:53 2017 -0800 Bug 23970: Printing to a file is broken with Linux content sandboxing enabled Ported over firefox patch 5e7872cb3b5c (Bug 1364627) --- gfx/2d/ScaledFontFontconfig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/2d/ScaledFontFontconfig.cpp b/gfx/2d/ScaledFontFontconfig.cpp index 0695eebbeaa7..68c9a1a42c88 100644 --- a/gfx/2d/ScaledFontFontconfig.cpp +++ b/gfx/2d/ScaledFontFontconfig.cpp @@ -332,6 +332,7 @@ ScaledFontFontconfig::CreateFromInstanceData(const InstanceData& aInstanceData, RefPtr<ScaledFontFontconfig> scaledFont = new ScaledFontFontconfig(cairoScaledFont, pattern, aSize); + cairo_scaled_font_destroy(cairoScaledFont); FcPatternDestroy(pattern); return scaledFont.forget();
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 23970: Printing to a file is broken with Linux content sandboxing enabled
by gk@torproject.org 15 Dec '17

15 Dec '17
commit 8d7757dbd40f4619f84dc51853c81186a22b0160 Author: Richard Pospesel <richard(a)torproject.org> Date: Mon Nov 27 14:41:39 2017 -0800 Bug 23970: Printing to a file is broken with Linux content sandboxing enabled Ported over firefox patch 5b9702d8fe4e (Bug 1309205 Part 3) --- modules/libpref/init/all.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index dd78fec1ee75..198028eeb96c 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1106,7 +1106,7 @@ pref("print.print_edge_right", 0); pref("print.print_edge_bottom", 0); // Print via the parent process. This is only used when e10s is enabled. -#if defined(XP_WIN) || defined(XP_MACOSX) +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(XP_LINUX) pref("print.print_via_parent", true); #else pref("print.print_via_parent", false);
1 0
0 0
[tor-browser-build/master] Bug 24561: Add our scripts to check the authenticode/mar signing
by gk@torproject.org 14 Dec '17

14 Dec '17
commit c0915fc6a4b51418ace4d5a59f77bb63b57da3d2 Author: Georg Koppen <gk(a)torproject.org> Date: Wed Dec 13 10:53:26 2017 +0000 Bug 24561: Add our scripts to check the authenticode/mar signing --- tools/authenticode_check.sh | 96 +++++++++++++++++++++++++++++++++++++++ tools/marsigning_check.sh | 107 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) diff --git a/tools/authenticode_check.sh b/tools/authenticode_check.sh new file mode 100755 index 0000000..c94682d --- /dev/null +++ b/tools/authenticode_check.sh @@ -0,0 +1,96 @@ +#!/bin/sh + +# Copyright (c) 2017, The Tor Project, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: + +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# +# * Neither the names of the copyright owners nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Usage: +# 1) Let OSSLSIGNCODE point to your osslsigncode binary +# 2) Change into the directory containing the .exe files and the sha256sums-unsigned-build.txt +# 3) Run /path/to/authenticode_check.sh + +if [ -z "$OSSLSIGNCODE" ] +then + echo "The path to your osslsigncode binary is missing!" + exit 1 +fi + +UNSIGNED_BUNDLES=0 +BADSIGNED_BUNDLES=0 + +mkdir tmp + +for f in `ls *.exe`; do + SHA256_TXT=`grep "$f" sha256sums-unsigned-build.txt` + + # Test 1: Is the .exe file still unsigned? I.e. does its SHA-256 sum still + # match the one we had before we signed the .exe file? If so, notify us + # later and exit. + if [ "$SHA256_TXT" = "`sha256sum $f`" ] + then + echo "$f has still the SHA-256 sum of the unsigned bundle!" + UNSIGNED_BUNDLES=`expr $UNSIGNED_BUNDLES + 1` + fi + + # Test 2: Do we get the old SHA-256 sum after stripping the authenticode + # signature? If not, notify us later and exit. + if [ "$UNSIGNED_BUNDLES" = "0" ] + then + # At least we seem to have attempted to sign the bundle. Let's see if we + # succeeded by stripping the signature. This behavior is reproducible. + # Thus, we know if we don't get the same SHA-256 sum we did not sign the + # bundle correctly. + echo "Trying to strip the authenticode signature of $f..." + ${OSSLSIGNCODE} remove-signature $f tmp/$f + cd tmp + if ! [ "$SHA256_TXT" = "`sha256sum $f`" ] + then + echo "$f does not have the SHA-256 sum of the unsigned bundle!" + BADSIGNED_BUNDLES=`expr $BADSIGNED_BUNDLES + 1` + fi + cd .. + fi +done + +rm -rf tmp/ + +if ! [ "$UNSIGNED_BUNDLES" = "0" ] +then + echo "We got $UNSIGNED_BUNDLES unsigned bundle(s), exiting..." + exit 1 +fi + +if ! [ "$BADSIGNED_BUNDLES" = "0" ] +then + echo "We got $BADSIGNED_BUNDLES badly signed bundle(s), exiting..." + exit 1 +fi + +echo "The signatures are fine." +exit 0 diff --git a/tools/marsigning_check.sh b/tools/marsigning_check.sh new file mode 100755 index 0000000..41b3b4d --- /dev/null +++ b/tools/marsigning_check.sh @@ -0,0 +1,107 @@ +#!/bin/sh + +# Copyright (c) 2016, The Tor Project, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: + +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# +# * Neither the names of the copyright owners nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Usage: +# 1) Let SIGNMAR point to your signmar binary +# 2) Let LD_LIBRARY_PATH point to the mar-tools directory +# 3) Change into the directory containing the MAR files and the +# sha256sums-unsigned-build.txt/sha256sums-unsigned-build.incrementals.txt. +# 4) Run /path/to/marsigning_check.sh + +if [ -z "$SIGNMAR" ] +then + echo "The path to your signmar binary is missing!" + exit 1 +fi + +if [ -z "$LD_LIBRARY_PATH" ] +then + echo "The library search path to your mar-tools directory is missing!" + exit 1 +fi + +UNSIGNED_MARS=0 +BADSIGNED_MARS=0 + +mkdir tmp + +for f in `ls *.mar`; do + case $f in + *.incremental.mar) SHA256_TXT=`grep "$f" \ + sha256sums-unsigned-build.incrementals.txt`;; + *) SHA256_TXT=`grep "$f" sha256sums-unsigned-build.txt`;; + esac + + # Test 1: Is the .mar file still unsigned? I.e. does its SHA-256 sum still + # match the one we had before we signed it? If so, notify us later and exit. + if [ "$SHA256_TXT" = "`sha256sum $f`" ] + then + echo "$f has still the SHA-256 sum of the unsigned MAR file!" + UNSIGNED_MARS=`expr $UNSIGNED_MARS + 1` + fi + + # Test 2: Do we get the old SHA-256 sum after stripping the MAR signature? If + # not, notify us later and exit. + if [ "$UNSIGNED_MARS" = "0" ] + then + # At least we seem to have attempted to sign the MAR file. Let's see if we + # succeeded by stripping the signature. This behavior is reproducible. + # Thus, we know if we don't get the same SHA-256 sum we did not sign the + # bundle correctly. + echo "Trying to strip the MAR signature of $f..." + ${SIGNMAR} -r $f tmp/$f + cd tmp + if ! [ "$SHA256_TXT" = "`sha256sum $f`" ] + then + echo "$f does not have the SHA-256 sum of the unsigned MAR file!" + BADSIGNED_MARS=`expr $BADSIGNED_MARS + 1` + fi + cd .. + fi +done + +rm -rf tmp/ + +if ! [ "$UNSIGNED_MARS" = "0" ] +then + echo "We got $UNSIGNED_MARS unsigned MAR file(s), exiting..." + exit 1 +fi + +if ! [ "$BADSIGNED_MARS" = "0" ] +then + echo "We got $BADSIGNED_MARS badly signed MAR file(s), exiting..." + exit 1 +fi + +echo "The signatures are fine." +exit 0
1 0
0 0
[tor-launcher/master] Bug 24624: tbb-logo.svg may cause network access
by gk@torproject.org 14 Dec '17

14 Dec '17
commit c22a773ffaeb0398d8be0119f6e89f3c8161e4aa Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Thu Dec 14 10:14:15 2017 -0500 Bug 24624: tbb-logo.svg may cause network access Remove www.w3.org DTD, unused xlink namespace declaration, and "Generator" comment. --- src/chrome/skin/tbb-logo.svg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chrome/skin/tbb-logo.svg b/src/chrome/skin/tbb-logo.svg index 26cd158..8be32c2 100644 --- a/src/chrome/skin/tbb-logo.svg +++ b/src/chrome/skin/tbb-logo.svg @@ -1,7 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 328.6 66.3" enable-background="new 0 0 328.6 66.3" xml:space="preserve"> <g> <g>
1 0
0 0
[tor-launcher/master] Bug 24623: revise "country that censors Tor" text
by gk@torproject.org 14 Dec '17

14 Dec '17
commit 12baf2b089479b3e043dbfad8ac246a5226feeae Author: Kathy Brade <brade(a)pearlcrescent.com> Date: Thu Dec 14 09:51:11 2017 -0500 Bug 24623: revise "country that censors Tor" text List Egypt, China, Turkey as countries that may block Tor. This list was derived from data provided by OONI. --- src/chrome/locale/en/network-settings.dtd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chrome/locale/en/network-settings.dtd b/src/chrome/locale/en/network-settings.dtd index 240154c..85645d7 100644 --- a/src/chrome/locale/en/network-settings.dtd +++ b/src/chrome/locale/en/network-settings.dtd @@ -10,7 +10,7 @@ <!-- For "first run" wizard: --> <!ENTITY torSettings.connectPrompt "Click “Connect” to connect to Tor."> -<!ENTITY torSettings.configurePrompt "Click “Configure” to adjust network settings if you are in a country that censors Tor (such as China, Iran, Syria) or if you are connecting from a private network that requires a proxy."> +<!ENTITY torSettings.configurePrompt "Click “Configure” to adjust network settings if you are in a country that censors Tor (such as Egypt, China, Turkey) or if you are connecting from a private network that requires a proxy."> <!ENTITY torSettings.configure "Configure"> <!ENTITY torSettings.connect "Connect">
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 23016: "Print to File" does not create the expected file in non-English locales
by gk@torproject.org 14 Dec '17

14 Dec '17
commit 8ea9839478bfddd4f078f16c9268edf1755e9cb0 Author: Richard Pospesel <richard(a)torproject.org> Date: Wed Nov 15 10:48:38 2017 -0800 Bug 23016: "Print to File" does not create the expected file in non-English locales The Problem: During firefox and Web Content process startup, ::OverrideDefaultLocaleIfNeeded() is called which will conditionally ::setlocale() to "C.UTF-8" or "C" based off of the javascript.use_us_english_locale preference (to prevent fingerprinting based on how dates and what-not are formatted). Sometime after this call in the Web Content process the locale is set to the system's locale which effectively stomps over the work done by the ::OverrideDefaultLocaleIfNeeded() call. As a result, the firefox process and the Web Content process are configured to use different locales; firefox uses "C.UTF-8" while Web Content uses "" (system default). On Linux, the "Print to File" printer is a default GTK printer whose name is localized based off of the process's locale. The GTK print dialog is hosted in the firefox process and therefore the printer name will be 'Print to File.' This process sends this name over to the Web Content process, which iterates over the list of printers and finds one whose name matches. However, as the Web Content process's locale is set to system, its printer names will be localized and in the language of the system, so no printer with the name 'Print to File' will be found, and printing fails. This is why disabling javascript.use_us_english_locale fixes the issue. It also explains why disabling multi-process mode via the browser.tabs.remote.autostart.2 preference fixes the issue; one process means the printer-name is never used as a selector and also means no mismatched locale can happen. The Solution: The fix for this issue is to first check the javascript.use_us_english_locale preference each place in code where setlocale occurs, particularly in the nsLocaleService object which is the particular code path which overrides setlocale in the Web Content process. --- intl/locale/nsLocaleService.cpp | 72 +++++++++++++++++++++++++++------------ xpcom/build/XPCOMInit.cpp | 14 ++++++-- xpcom/io/nsNativeCharsetUtils.cpp | 14 ++++++-- 3 files changed, 73 insertions(+), 27 deletions(-) diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp index 6d45ec9afa2a..e89ff32346cd 100644 --- a/intl/locale/nsLocaleService.cpp +++ b/intl/locale/nsLocaleService.cpp @@ -12,6 +12,7 @@ #include "nsTArray.h" #include "nsString.h" #include "mozilla/UniquePtr.h" +#include "mozilla/Preferences.h" #include <ctype.h> @@ -93,12 +94,20 @@ protected: // nsLocaleService::nsLocaleService(void) { + // conditionally use us english locale when initialization locale objects + const auto use_us_english_locale = + mozilla::Preferences::GetBool("javascript.use_us_english_locale", false); + #ifdef XP_WIN nsAutoString xpLocale; + // 1033 is default english us locale LCID + // https://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx + const LCID en_US_lcid = 1033; + // // get the system LCID // - LCID win_lcid = GetSystemDefaultLCID(); + LCID win_lcid = use_us_english_locale ? en_US_lcid : GetSystemDefaultLCID(); NS_ENSURE_TRUE_VOID(win_lcid); nsWin32Locale::GetXPLocale(win_lcid, xpLocale); nsresult rv = NewLocale(xpLocale, getter_AddRefs(mSystemLocale)); @@ -107,7 +116,7 @@ nsLocaleService::nsLocaleService(void) // // get the application LCID // - win_lcid = GetUserDefaultLCID(); + win_lcid = use_us_english_locale ? en_US_lcid : GetUserDefaultLCID(); NS_ENSURE_TRUE_VOID(win_lcid); nsWin32Locale::GetXPLocale(win_lcid, xpLocale); rv = NewLocale(xpLocale, getter_AddRefs(mApplicationLocale)); @@ -118,7 +127,7 @@ nsLocaleService::nsLocaleService(void) NS_ENSURE_TRUE_VOID(resultLocale); // Get system configuration - const char* lang = getenv("LANG"); + const char* lang = use_us_english_locale ? "en-US" : getenv("LANG"); nsAutoString xpLocale, platformLocale; nsAutoString category, category_platform; @@ -127,7 +136,19 @@ nsLocaleService::nsLocaleService(void) for( i = 0; i < LocaleListLength; i++ ) { nsresult result; // setlocale( , "") evaluates LC_* and LANG - char* lc_temp = setlocale(posix_locale_category[i], ""); + const auto current_posix_locale_category = posix_locale_category[i]; + const char* lc_temp = nullptr; + + if (use_us_english_locale) { + lc_temp = setlocale(current_posix_locale_category, "C.UTF-8"); + if (lc_temp == nullptr) { + lc_temp = setlocale(current_posix_locale_category, "C"); + } + } + else { + lc_temp = setlocale(current_posix_locale_category, ""); + } + CopyASCIItoUTF16(LocaleList[i], category); category_platform = category; category_platform.AppendLiteral("##PLATFORM"); @@ -163,30 +184,37 @@ nsLocaleService::nsLocaleService(void) #endif // XP_UNIX #ifdef XP_MACOSX - // Get string representation of user's current locale - CFLocaleRef userLocaleRef = ::CFLocaleCopyCurrent(); - CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef); - ::CFRetain(userLocaleStr); - - AutoTArray<UniChar, 32> buffer; - int size = ::CFStringGetLength(userLocaleStr); - buffer.SetLength(size + 1); - CFRange range = ::CFRangeMake(0, size); - ::CFStringGetCharacters(userLocaleStr, range, buffer.Elements()); - buffer[size] = 0; - - // Convert the locale string to the format that Mozilla expects - nsAutoString xpLocale(reinterpret_cast<char16_t*>(buffer.Elements())); - xpLocale.ReplaceChar('_', '-'); + nsAutoString xpLocale; + + if (use_us_english_locale) { + xpLocale = NS_LITERAL_STRING("en-US").get(); + } + else { + // Get string representation of user's current locale + CFLocaleRef userLocaleRef = ::CFLocaleCopyCurrent(); + CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef); + ::CFRetain(userLocaleStr); + + AutoTArray<UniChar, 32> buffer; + int size = ::CFStringGetLength(userLocaleStr); + buffer.SetLength(size + 1); + CFRange range = ::CFRangeMake(0, size); + ::CFStringGetCharacters(userLocaleStr, range, buffer.Elements()); + buffer[size] = 0; + + // Convert the locale string to the format that Mozilla expects + xpLocale = reinterpret_cast<char16_t*>(buffer.Elements()); + xpLocale.ReplaceChar('_', '-'); + + ::CFRelease(userLocaleStr); + ::CFRelease(userLocaleRef); + } nsresult rv = NewLocale(xpLocale, getter_AddRefs(mSystemLocale)); if (NS_SUCCEEDED(rv)) { mApplicationLocale = mSystemLocale; } - ::CFRelease(userLocaleStr); - ::CFRelease(userLocaleRef); - NS_ASSERTION(mApplicationLocale, "Failed to create locale objects"); #endif // XP_MACOSX } diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index c72ea48d77c8..4fe9c93de2ec 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -11,6 +11,7 @@ #include "mozilla/Poison.h" #include "mozilla/SharedThreadPool.h" #include "mozilla/XPCOM.h" +#include "mozilla/Preferences.h" #include "nsXULAppAPI.h" #include "nsXPCOMPrivate.h" @@ -571,11 +572,18 @@ NS_InitXPCOM2(nsIServiceManager** aResult, } #ifndef ANDROID + // If the locale hasn't already been setup by our embedder, - // get us out of the "C" locale and into the system - if (strcmp(setlocale(LC_ALL, nullptr), "C") == 0) { - setlocale(LC_ALL, ""); + // get us out of the "C" locale and into the system, + // but only do so if we aren't force using english locale + if (mozilla::Preferences::GetBool("javascript.use_us_english_locale", false)) { + setlocale(LC_ALL, "C.UTF-8") || setlocale(LC_ALL, "C"); + } else { + if (strcmp(setlocale(LC_ALL, nullptr), "C") == 0) { + setlocale(LC_ALL, ""); + } } + #endif #if defined(XP_UNIX) diff --git a/xpcom/io/nsNativeCharsetUtils.cpp b/xpcom/io/nsNativeCharsetUtils.cpp index e53307af5628..f81c1179256b 100644 --- a/xpcom/io/nsNativeCharsetUtils.cpp +++ b/xpcom/io/nsNativeCharsetUtils.cpp @@ -48,6 +48,7 @@ NS_ShutdownNativeCharsetUtils() #include <stdlib.h> // mbtowc, wctomb #include <locale.h> // setlocale #include "mozilla/Mutex.h" +#include "mozilla/Preferences.h" #include "nscore.h" #include "nsAString.h" #include "nsReadableUtils.h" @@ -316,7 +317,12 @@ nsNativeCharsetConverter::LazyInit() // NS_StartupNativeCharsetUtils, assume we are called early enough that // we are the first to care about the locale's charset. if (!gLock) { - setlocale(LC_CTYPE, ""); + + if (mozilla::Preferences::GetBool("javascript.use_us_english_locale", false)) { + setlocale(LC_CTYPE, "C.UTF-8") || setlocale(LC_CTYPE, "C"); + } else { + setlocale(LC_CTYPE, ""); + } } const char* blank_list[] = { "", nullptr }; const char** native_charset_list = blank_list; @@ -884,7 +890,11 @@ NS_StartupNativeCharsetUtils() // XXX we assume that we are called early enough that we should // always be the first to care about the locale's charset. // - setlocale(LC_CTYPE, ""); + if (mozilla::Preferences::GetBool("javascript.use_us_english_locale", false)) { + setlocale(LC_CTYPE, "C.UTF-8") || setlocale(LC_CTYPE, "C"); + } else { + setlocale(LC_CTYPE, ""); + } nsNativeCharsetConverter::GlobalInit(); }
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 1372072 - Part 1: Spoofing network information API and blocking ontypechange event when 'privacy.resistFingerprinting' is true. r=arthuredelstein, baku
by gk@torproject.org 14 Dec '17

14 Dec '17
commit a1beadc5b70e1b6e4727506656723684cf3225bf Author: Tim Huang <tihuang(a)mozilla.com> Date: Wed Dec 13 15:29:00 2017 -0200 Bug 1372072 - Part 1: Spoofing network information API and blocking ontypechange event when 'privacy.resistFingerprinting' is true. r=arthuredelstein,baku This patch makes the network information API always returns the default type 'unknown' and blocking the ontypechange event while connection type changed when 'privacy. resistFingerprinting' is true. MozReview-Commit-ID: 4eOdHgAGtyY --HG-- extra : rebase_source : 78449fb4888b787062ff2139e36c219e0eac0b2c --- dom/network/Connection.cpp | 3 ++- dom/network/Connection.h | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dom/network/Connection.cpp b/dom/network/Connection.cpp index 3bf6f40384a6..cc06b5e14b6a 100644 --- a/dom/network/Connection.cpp +++ b/dom/network/Connection.cpp @@ -78,7 +78,8 @@ Connection::Notify(const hal::NetworkInformation& aNetworkInfo) UpdateFromNetworkInfo(aNetworkInfo); - if (previousType == mType) { + if (previousType == mType || + nsContentUtils::ShouldResistFingerprinting()) { return; } diff --git a/dom/network/Connection.h b/dom/network/Connection.h index 907aea144bc0..19e00d93c907 100644 --- a/dom/network/Connection.h +++ b/dom/network/Connection.h @@ -13,6 +13,7 @@ #include "mozilla/dom/NetworkInformationBinding.h" #include "nsCycleCollectionParticipant.h" #include "nsINetworkProperties.h" +#include "nsContentUtils.h" namespace mozilla { @@ -44,7 +45,11 @@ public: virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; - ConnectionType Type() const { return mType; } + ConnectionType Type() const + { + return nsContentUtils::ShouldResistFingerprinting() ? + static_cast<ConnectionType>(ConnectionType::Unknown) : mType; + } IMPL_EVENT_HANDLER(typechange)
1 0
0 0
[tor-browser/tor-browser-52.5.2esr-7.5-2] Bug 1372072 - Part 2: Add a test case for check whether network information API has been spoofed correctly when 'privacy.resistFingerprinting' is true. r=arthuredelstein, baku
by gk@torproject.org 14 Dec '17

14 Dec '17
commit a72faadea544a71ae5ca95ec816f2684c205b56a Author: Tim Huang <tihuang(a)mozilla.com> Date: Wed Dec 13 15:35:50 2017 -0200 Bug 1372072 - Part 2: Add a test case for check whether network information API has been spoofed correctly when 'privacy.resistFingerprinting' is true. r=arthuredelstein,baku This adds a test case to test that network information is correctly spoofed when 'privacy.resistFingerprinting' is true. Firefox ESR 52 does not have the navigation object inside workers. Thus, the worker test was removed. MozReview-Commit-ID: Lt6HZlFrcja --HG-- extra : rebase_source : 70d44115532549814af9fce3af9fe379e36bca80 --- .../resistfingerprinting/test/browser/browser.ini | 1 + .../test/browser/browser_netInfo.js | 32 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/browser/components/resistfingerprinting/test/browser/browser.ini b/browser/components/resistfingerprinting/test/browser/browser.ini index 4b81c91d8c6c..b596f437caa2 100644 --- a/browser/components/resistfingerprinting/test/browser/browser.ini +++ b/browser/components/resistfingerprinting/test/browser/browser.ini @@ -4,6 +4,7 @@ support-files = file_dummy.html head.js +[browser_netInfo.js] [browser_roundedWindow_dialogWindow.js] [browser_roundedWindow_newWindow.js] [browser_roundedWindow_open_max.js] diff --git a/browser/components/resistfingerprinting/test/browser/browser_netInfo.js b/browser/components/resistfingerprinting/test/browser/browser_netInfo.js new file mode 100644 index 000000000000..7c6114212ffd --- /dev/null +++ b/browser/components/resistfingerprinting/test/browser/browser_netInfo.js @@ -0,0 +1,32 @@ +/** + * Bug 1372072 - A test case for check whether network information API has been + * spoofed correctly when 'privacy.resistFingerprinting' is true; + */ + +const TEST_PATH = "http://example.net/browser/browser/" + + "components/resistfingerprinting/test/browser/" + +async function testWindow() { + // Open a tab to test network information in a content. + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, TEST_PATH + "file_dummy.html"); + + await ContentTask.spawn(tab.linkedBrowser, null, async function() { + ok("connection" in content.navigator, "navigator.connection should exist"); + + is(content.navigator.connection.type, "unknown", "The connection type is spoofed correctly"); + }); + + await BrowserTestUtils.removeTab(tab); +} + +add_task(async function runTest() { + await SpecialPowers.pushPrefEnv({"set": + [ + ["privacy.resistFingerprinting", true], + ["dom.netinfo.enabled", true] + ] + }); + + await testWindow(); +});
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1723
  • 1724
  • 1725
  • 1726
  • 1727
  • 1728
  • 1729
  • ...
  • 2064
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.