summaryrefslogtreecommitdiffstats
path: root/endpoints
diff options
context:
space:
mode:
authorroot (kid.am-soft.de) <root@kid.am-soft.de>2017-05-21 21:11:23 +0200
committerThorsten Schöning <tschoening@am-soft.de>2017-05-21 21:16:54 +0200
commitab7059433b7c7f7232d3e33435f02e920a9a2702 (patch)
tree1223ebb0f9b9efbb505149a1bfae30f27216d28e /endpoints
parent65ebcedd3079fd80a6359c7e10651b0d17cc55ed (diff)
downloadphpvirtualbox-ab7059433b7c7f7232d3e33435f02e920a9a2702.zip
phpvirtualbox-ab7059433b7c7f7232d3e33435f02e920a9a2702.tar.gz
phpvirtualbox-ab7059433b7c7f7232d3e33435f02e920a9a2702.tar.bz2
Make decryption of images/VMs work by not providing a password ID.
Diffstat (limited to 'endpoints')
-rw-r--r--endpoints/lib/vboxServiceWrappers.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/endpoints/lib/vboxServiceWrappers.php b/endpoints/lib/vboxServiceWrappers.php
index 7b33f0d..b9ff86b 100644
--- a/endpoints/lib/vboxServiceWrappers.php
+++ b/endpoints/lib/vboxServiceWrappers.php
@@ -7889,6 +7889,10 @@ class IMedium extends VBox_ManagedObject
public function changeEncryption($arg_currentPassword, $arg_cipher, $arg_newPassword, $arg_newPasswordId)
{
+ // No password ID in case of decryption and de-/encryption are both handled here.
+ $isDecryption = ($arg_cipher == '') && ($arg_newPassword == '');
+ $arg_newPasswordId = $isDecryption ? '' : $arg_newPasswordId;
+
$request = new stdClass();
$request->_this = $this->handle;
$request->currentPassword = $arg_currentPassword;