Changeset 42210 in vbox
- Timestamp:
- Jul 18, 2012 2:11:35 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r42177 r42210 316 316 bool aSaveRegistry = true); 317 317 318 voiddecryptSettings();319 voiddecryptMediumSettings(Medium *pMedium);318 int decryptSettings(); 319 int decryptMediumSettings(Medium *pMedium); 320 320 int decryptSettingBytes(uint8_t *aPlaintext, const uint8_t *aCiphertext, 321 321 size_t aCiphertextSize) const; -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r42208 r42210 2041 2041 { 2042 2042 storeSettingsKey(aValue); 2043 decryptSettings();2044 return S_OK;2045 } 2046 2047 voidVirtualBox::decryptMediumSettings(Medium *pMedium)2043 int vrc = decryptSettings(); 2044 return RT_SUCCESS(vrc) ? S_OK : E_FAIL; 2045 } 2046 2047 int VirtualBox::decryptMediumSettings(Medium *pMedium) 2048 2048 { 2049 2049 Bstr bstrCipher; … … 2058 2058 if (RT_SUCCESS(rc)) 2059 2059 pMedium->setPropertyDirect("InitiatorSecret", strPlaintext); 2060 } 2060 else 2061 return rc; 2062 } 2063 return VINF_SUCCESS; 2061 2064 } 2062 2065 … … 2069 2072 * properties need to be null-terminated strings. 2070 2073 */ 2071 void VirtualBox::decryptSettings() 2072 { 2074 int VirtualBox::decryptSettings() 2075 { 2076 bool fFailure = false; 2073 2077 AutoReadLock al(m->allHardDisks.getLockHandle() COMMA_LOCKVAL_SRC_POS); 2074 2078 for (MediaList::const_iterator mt = m->allHardDisks.begin(); … … 2081 2085 continue; 2082 2086 AutoWriteLock mlock(pMedium COMMA_LOCKVAL_SRC_POS); 2083 decryptMediumSettings(pMedium); 2084 } 2087 int vrc = decryptMediumSettings(pMedium); 2088 if (RT_FAILURE(vrc)) 2089 fFailure = true; 2090 } 2091 return fFailure ? VERR_INVALID_PARAMETER : VINF_SUCCESS; 2085 2092 } 2086 2093
Note:
See TracChangeset
for help on using the changeset viewer.