VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/UserPreferences.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/UserPreferences.cpp')
-rwxr-xr-x[-rw-r--r--]src/Main/UserPreferences.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Main/UserPreferences.cpp b/src/Main/UserPreferences.cpp
index b8a4d704..f66d8bef 100644..100755
--- a/src/Main/UserPreferences.cpp
+++ b/src/Main/UserPreferences.cpp
@@ -104,6 +104,24 @@ namespace VeraCrypt
TC_CONFIG_SET (UseKeyfiles);
TC_CONFIG_SET (WipeCacheOnAutoDismount);
TC_CONFIG_SET (WipeCacheOnClose);
+
+ SetValue (configMap[L"DefaultTrueCryptMode"], DefaultMountOptions.TrueCryptMode);
+
+ wstring defaultPrf;
+ SetValue (configMap[L"DefaultPRF"], defaultPrf);
+
+ shared_ptr <Pkcs5Kdf> savedKdf;
+ try
+ {
+ if (defaultPrf != L"autodetection")
+ savedKdf = Pkcs5Kdf::GetAlgorithm (defaultPrf, DefaultMountOptions.TrueCryptMode);
+ }
+ catch (ParameterIncorrect&)
+ {
+ }
+
+ DefaultMountOptions.Kdf = savedKdf;
+ DefaultMountOptions.ProtectionKdf = savedKdf;
}
// Default keyfiles
@@ -200,6 +218,13 @@ namespace VeraCrypt
TC_CONFIG_ADD (UseKeyfiles);
TC_CONFIG_ADD (WipeCacheOnAutoDismount);
TC_CONFIG_ADD (WipeCacheOnClose);
+
+ formatter.AddEntry (L"DefaultTrueCryptMode", DefaultMountOptions.TrueCryptMode);
+
+ wstring defaultPrf = L"autodetection";
+ if (DefaultMountOptions.Kdf)
+ defaultPrf = DefaultMountOptions.Kdf->GetName ();
+ formatter.AddEntry (L"DefaultPRF", defaultPrf);
XmlWriter writer (Application::GetConfigFilePath (GetPreferencesFileName(), true));
writer.WriteNode (formatter.XmlConfig);