Changeset 54854 in vbox
- Timestamp:
- Mar 19, 2015 7:45:09 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99059
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
r54846 r54854 1821 1821 1822 1822 ComPtr<IProgress> progress; 1823 CHECK_ERROR(hardDisk, ChangeEncryption(Bstr(strPassword New).raw(), Bstr(strPasswordOld).raw(),1824 Bstr( pszCipher).raw(), Bstr(pszNewPasswordId).raw(),1823 CHECK_ERROR(hardDisk, ChangeEncryption(Bstr(strPasswordOld).raw(), Bstr(pszCipher).raw(), 1824 Bstr(strPasswordNew).raw(), Bstr(pszNewPasswordId).raw(), 1825 1825 progress.asOutParam())); 1826 1826 if (SUCCEEDED(rc)) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r54848 r54854 13489 13489 <interface 13490 13490 name="IMedium" extends="$unknown" 13491 uuid=" 41e09c4f-97bf-4a1a-bf5c-c5b87f58464b"13491 uuid="9fae9ea1-c57c-4a3d-8992-cbb2b9b4b4a3" 13492 13492 wsmap="managed" 13493 13493 > … … 14754 14754 </result> 14755 14755 </desc> 14756 <param name="currentPassword" type="wstring" dir="in"> 14757 <desc> 14758 The olcurrentd password the medium is protected with. Use an empty string to indicate 14759 that the medium isn't encrypted. 14760 </desc> 14761 </param> 14762 <param name="cipher" type="wstring" dir="in"> 14763 <desc> 14764 The cipher to use for encryption. An empty string indicates no encryption for the 14765 result. 14766 </desc> 14767 </param> 14756 14768 <param name="newPassword" type="wstring" dir="in"> 14757 14769 <desc> … … 14759 14771 to indicate that the result should not be encrypted. 14760 14772 </desc> 14761 </param>14762 <param name="oldPassword" type="wstring" dir="in">14763 <desc>14764 The old password the medium is protected with. Use an empty string to indicate14765 that the medium wasn't encrypted before.14766 </desc>14767 </param>14768 <param name="cipher" type="wstring" dir="in">14769 <desc>The cipher to use for encryption.</desc>14770 14773 </param> 14771 14774 <param name="newPasswordId" type="wstring" dir="in"> -
trunk/src/VBox/Main/include/MediumImpl.h
r54835 r54854 276 276 ComPtr<IProgress> &aProgress); 277 277 HRESULT reset(ComPtr<IProgress> &aProgress); 278 HRESULT changeEncryption(const com::Utf8Str &aNewPassword, const com::Utf8Str &aOldPassword, 279 const com::Utf8Str &aCipher, const com::Utf8Str &aNewPasswordId, ComPtr<IProgress> &aProgress); 278 HRESULT changeEncryption(const com::Utf8Str &aCurrentPassword, const com::Utf8Str &aCipher, 279 const com::Utf8Str &aNewPassword, const com::Utf8Str &aNewPasswordId, 280 ComPtr<IProgress> &aProgress); 280 281 HRESULT getEncryptionSettings(com::Utf8Str &aCipher, com::Utf8Str &aPasswordId); 281 282 -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r54847 r54854 676 676 EncryptTask(Medium *aMedium, 677 677 const com::Utf8Str &strNewPassword, 678 const com::Utf8Str &str OldPassword,678 const com::Utf8Str &strCurrentPassword, 679 679 const com::Utf8Str &strCipher, 680 680 const com::Utf8Str &strNewPasswordId, … … 683 683 : Medium::Task(aMedium, aProgress), 684 684 mstrNewPassword(strNewPassword), 685 mstr OldPassword(strOldPassword),685 mstrCurrentPassword(strCurrentPassword), 686 686 mstrCipher(strCipher), 687 687 mstrNewPasswordId(strNewPasswordId), … … 701 701 if (mstrNewPassword.length()) 702 702 RTMemWipeThoroughly(mstrNewPassword.mutableRaw(), mstrNewPassword.length(), 10 /* cPasses */); 703 if (mstr OldPassword.length())704 RTMemWipeThoroughly(mstr OldPassword.mutableRaw(), mstrOldPassword.length(), 10 /* cPasses */);703 if (mstrCurrentPassword.length()) 704 RTMemWipeThoroughly(mstrCurrentPassword.mutableRaw(), mstrCurrentPassword.length(), 10 /* cPasses */); 705 705 delete mpMediumLockList; 706 706 } 707 707 708 708 Utf8Str mstrNewPassword; 709 Utf8Str mstr OldPassword;709 Utf8Str mstrCurrentPassword; 710 710 Utf8Str mstrCipher; 711 711 Utf8Str mstrNewPasswordId; … … 3039 3039 } 3040 3040 3041 HRESULT Medium::changeEncryption(const com::Utf8Str &a NewPassword, const com::Utf8Str &aOldPassword,3042 const com::Utf8Str &a Cipher, const com::Utf8Str &aNewPasswordId,3041 HRESULT Medium::changeEncryption(const com::Utf8Str &aCurrentPassword, const com::Utf8Str &aCipher, 3042 const com::Utf8Str &aNewPassword, const com::Utf8Str &aNewPasswordId, 3043 3043 ComPtr<IProgress> &aProgress) 3044 3044 { … … 3146 3146 3147 3147 /* setup task object to carry out the operation asynchronously */ 3148 pTask = new Medium::EncryptTask(this, aNewPassword, a OldPassword,3148 pTask = new Medium::EncryptTask(this, aNewPassword, aCurrentPassword, 3149 3149 aCipher, aNewPasswordId, pProgress, pMediumLockList); 3150 3150 rc = pTask->rc(); … … 8940 8940 { 8941 8941 /* Set up disk encryption filters. */ 8942 if (task.mstr OldPassword.isEmpty())8942 if (task.mstrCurrentPassword.isEmpty()) 8943 8943 { 8944 8944 /* … … 8958 8958 tr("The image is not configured for encryption")); 8959 8959 8960 i_taskEncryptSettingsSetup(&CryptoSettingsRead, NULL, it->second.c_str(), task.mstr OldPassword.c_str(),8960 i_taskEncryptSettingsSetup(&CryptoSettingsRead, NULL, it->second.c_str(), task.mstrCurrentPassword.c_str(), 8961 8961 false /* fCreateKeyStore */); 8962 8962 vrc = VDFilterAdd(pDisk, "CRYPT", VD_FILTER_FLAGS_READ, CryptoSettingsRead.vdFilterIfaces); … … 8970 8970 } 8971 8971 8972 if (task.mstr NewPassword.isNotEmpty())8972 if (task.mstrCipher.isNotEmpty()) 8973 8973 { 8974 if (task.mstr Cipher.isEmpty())8974 if (task.mstrNewPassword.isEmpty()) 8975 8975 throw setError(VBOX_E_OBJECT_NOT_FOUND, 8976 tr(" No valid cipher identifier was given forencryption"));8976 tr("A password must be given for the image encryption")); 8977 8977 8978 8978 if (task.mstrNewPasswordId.isEmpty()) 8979 8979 throw setError(VBOX_E_INVALID_OBJECT_STATE, 8980 tr("A new password must always have a valid identifier"));8980 tr("A valid identifier for the password must be given")); 8981 8981 8982 8982 i_taskEncryptSettingsSetup(&CryptoSettingsWrite, task.mstrCipher.c_str(), NULL, … … 8988 8988 i_vdError(vrc).c_str()); 8989 8989 } 8990 else if (task.mstrNewPasswordId.isNotEmpty() )8990 else if (task.mstrNewPasswordId.isNotEmpty() || task.mstrNewPassword.isNotEmpty()) 8991 8991 throw setError(VBOX_E_INVALID_OBJECT_STATE, 8992 tr("The password identifier must be empty if there is no new password set for encryption"));8992 tr("The password and password identifier must be empty if there is the output shuld be unencrypted")); 8993 8993 8994 8994 /* Open all media in the chain. */
Note:
See TracChangeset
for help on using the changeset viewer.