From 09abc10635f7f2d5aa9d918386b8a34590b8443a Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 17 Mar 2020 13:33:03 +0100 Subject: Issue #1467 - Part 2: Make the PBKDF rounds adaptive to choice of NSS db --- toolkit/xre/nsAppRunner.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'toolkit') diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index e3705a5c2..1f3615a6a 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -2781,19 +2781,26 @@ XREMain::XRE_mainInit(bool* aExitFlag) #endif SetupErrorHandling(gArgv[0]); - - // Set up environment for NSS DBM database + // Set up environment for NSS database choice +#ifndef NSS_DISABLE_DBM // Allow iteration counts in DBM mode SaveToEnv("NSS_ALLOW_LEGACY_DBM_ITERATION_COUNT=1"); - // Set default Master Password rounds to a sane value for DBM which is slower - // than SQL for PBKDF. The NSS hard-coded default of 10,000 is too much. - // See also Bug 1606992 for perf issues. +#endif + #ifdef DEBUG + // Reduce the number of rounds for debug builds for perf/test reasons. SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=15"); #else +#ifdef NSS_SQLSTORE + // We're using SQL; NSS's defaults for rounds are fine. +#else + // Set default Master Password rounds to a sane value for DBM which is slower + // than SQL for PBKDF. The NSS hard-coded default of 10,000 is too much. + // See also Bug 1606992 for perf issues. SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=500"); #endif +#endif #ifdef CAIRO_HAS_DWRITE_FONT { -- cgit v1.2.3