summaryrefslogtreecommitdiff
path: root/toolkit/xre
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-03-17 13:33:03 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-03-17 13:33:03 +0100
commit09abc10635f7f2d5aa9d918386b8a34590b8443a (patch)
tree1911ad6478e78490f792b862c3df599c8a1c7684 /toolkit/xre
parent6b3fbe9ef069d15e52bd44c72d59325d7873127c (diff)
downloaduxp-09abc10635f7f2d5aa9d918386b8a34590b8443a.tar.gz
Issue #1467 - Part 2: Make the PBKDF rounds adaptive to choice of NSS db
Diffstat (limited to 'toolkit/xre')
-rw-r--r--toolkit/xre/nsAppRunner.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index e3705a5c24..1f3615a6a2 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
{