Index: /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 42211)
+++ /trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp	(revision 42212)
@@ -2041,6 +2041,6 @@
 {
     storeSettingsKey(aValue);
-    int vrc = decryptSettings();
-    return RT_SUCCESS(vrc) ? S_OK : E_FAIL;
+    decryptSettings();
+    return S_OK;
 }
 
@@ -2052,6 +2052,4 @@
     if (SUCCEEDED(hrc))
     {
-        Bstr bstrName;
-        pMedium->COMGETTER(Name)(bstrName.asOutParam());
         Utf8Str strPlaintext;
         int rc = decryptSetting(&strPlaintext, bstrCipher);
@@ -2181,7 +2179,7 @@
     {
         RTRandBytes(aBytes, aCiphertextSize - i);
-        for (; i < aCiphertextSize; i++)
-        {
-            aCiphertext[i] = aBytes[i] ^ m->SettingsCipherKey[j];
+        for (int k = 0; i < aCiphertextSize; i++, k++)
+        {
+            aCiphertext[i] = aBytes[k] ^ m->SettingsCipherKey[j];
             if (++j >= sizeof(m->SettingsCipherKey))
                 j = 0;
