VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume
diff options
context:
space:
mode:
Diffstat (limited to 'src/Volume')
-rw-r--r--src/Volume/EncryptionAlgorithm.cpp18
-rw-r--r--src/Volume/EncryptionAlgorithm.h2
2 files changed, 17 insertions, 3 deletions
diff --git a/src/Volume/EncryptionAlgorithm.cpp b/src/Volume/EncryptionAlgorithm.cpp
index 3d854ae5..71bf332c 100644
--- a/src/Volume/EncryptionAlgorithm.cpp
+++ b/src/Volume/EncryptionAlgorithm.cpp
@@ -125,19 +125,33 @@ namespace VeraCrypt
return Mode;
}
- wstring EncryptionAlgorithm::GetName () const
+ wstring EncryptionAlgorithm::GetName (bool forGuiDisplay) const
{
if (Ciphers.size() < 1)
throw NotInitialized (SRC_POS);
wstring name;
+ int depth = 0;
foreach_reverse_ref (const Cipher &c, Ciphers)
{
if (name.empty())
name = c.GetName();
else
- name += wstring (L"-") + c.GetName();
+ {
+ depth++;
+ if (forGuiDisplay)
+ name += wstring (L"(");
+ else
+ name += wstring (L"-");
+ name += c.GetName();
+ }
+ }
+
+ if (forGuiDisplay && depth)
+ {
+ for (int i = 0; i < depth; i++)
+ name += wstring(L")");
}
return name;
diff --git a/src/Volume/EncryptionAlgorithm.h b/src/Volume/EncryptionAlgorithm.h
index 5a5666fe..4eebba4f 100644
--- a/src/Volume/EncryptionAlgorithm.h
+++ b/src/Volume/EncryptionAlgorithm.h
@@ -37,7 +37,7 @@ namespace VeraCrypt
static size_t GetLargestKeySize (const EncryptionAlgorithmList &algorithms);
virtual size_t GetKeySize () const;
virtual shared_ptr <EncryptionMode> GetMode () const;
- virtual wstring GetName () const;
+ virtual wstring GetName (bool forGuiDisplay = false) const;
bool IsDeprecated () const { return Deprecated; }
virtual bool IsModeSupported (const EncryptionMode &mode) const;
virtual bool IsModeSupported (const shared_ptr <EncryptionMode> mode) const;