Issue #1467 - Part 2: Make the PBKDF rounds adaptive to choice of NSS db

This commit is contained in:
wolfbeast 2020-03-17 13:33:03 +01:00 • committed by Roy Tam
commit 7e3528b551

View file

@ -2784,21 +2784,26 @@ XREMain::XRE_mainInit(bool* aExitFlag)
SetupErrorHandling(gArgv[0]);
#if 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");
#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.
#ifdef DEBUG
SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=15");
#else
SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=500");
#endif
#endif
#endif //0
#ifdef CAIRO_HAS_DWRITE_FONT
{