Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 54808)
+++ /trunk/include/VBox/err.h	(revision 54809)
@@ -1541,4 +1541,6 @@
 /** The DEK for disk encryption is missing. */
 #define VERR_VD_DEK_MISSING                         (-3214)
+/** The provided password to decrypt the DEK was incorrect. */
+#define VERR_VD_PASSWORD_INCORRECT                  (-3215)
 /** Generic: Invalid image file header. Use this for plugins. */
 #define VERR_VD_GEN_INVALID_HEADER                  (-3220)
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 54808)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 54809)
@@ -423,4 +423,10 @@
     <desc>
       Object being in use prohibits operation.
+    </desc>
+  </result>
+
+  <result name="VBOX_E_PASSWORD_INCORRECT" value="0x80BB000D">
+    <desc>
+      A provided password was incorrect.
     </desc>
   </result>
@@ -8357,4 +8363,9 @@
       <desc>
         Adds a password used for hard disk encryption/decryption.
+
+        <result name="VBOX_E_PASSWORD_INCORRECT">
+          The password provided wasn't correct for at least one disk using the provided
+          ID.
+        </result>
       </desc>
       <param name="id" type="wstring" dir="in">
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 54808)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 54809)
@@ -4881,5 +4881,8 @@
                     {
                         rc = pIMedium->pfnSetSecKeyIf(pIMedium, mpIfSecKey, mpIfSecKeyHlp);
-                        if (RT_FAILURE(rc))
+                        if (rc == VERR_VD_PASSWORD_INCORRECT)
+                            return setError(VBOX_E_PASSWORD_INCORRECT, tr("The provided password for ID \"%s\" is not correct for at least one disk using this ID"),
+                                            strId.c_str());
+                        else if (RT_FAILURE(rc))
                             return setError(E_FAIL, tr("Failed to set the encryption key (%Rrc)"), rc);
                     }
