- Timestamp:
- May 22, 2014 10:24:53 AM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r51340 r51342 5740 5740 return true; 5741 5741 } 5742 if (rc == VERR_VD_DEK_MISSING) 5743 { 5744 /* Error message already set. */ 5745 ASMAtomicCmpXchgBool(&pAhciPort->fRedo, true, false); 5746 return true; 5747 } 5748 5742 5749 return false; 5743 5750 } -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r50283 r51342 1541 1541 return true; 1542 1542 } 1543 if (rc == VERR_VD_DEK_MISSING) 1544 { 1545 /* Error message already set. */ 1546 pCtl->fRedoIdle = true; 1547 return true; 1548 } 1549 1543 1550 return false; 1544 1551 } -
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r50089 r51342 123 123 || rc == VERR_FILE_TOO_BIG 124 124 || rc == VERR_BROKEN_PIPE 125 || rc == VERR_NET_CONNECTION_REFUSED) 125 || rc == VERR_NET_CONNECTION_REFUSED 126 || rc == VERR_VD_DEK_MISSING) 126 127 return true; 127 128 -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r51103 r51342 186 186 /** The block cache handle if configured. */ 187 187 PPDMBLKCACHE pBlkCache; 188 189 /** Cryptographic support 190 * @{ */ 191 /** Used algorithm, NULL means no encryption. */ 192 char *pszEncryptionAlgorithm; 193 /** Config interface for the encryption filter. */ 194 VDINTERFACECONFIG VDIfCfg; 195 /** Flag whether the DEK was provided. */ 196 bool fDekProvided; 197 /** Pointer to the key material - temporary. */ 198 const uint8_t *pbKey; 199 /** Size of the key material in bytes. */ 200 size_t cbKey; 201 /** @} */ 188 202 } VBOXDISK, *PVBOXDISK; 189 203 … … 621 635 } 622 636 637 638 /******************************************************************************* 639 * VD Configuration interface implementation for the encryption support * 640 *******************************************************************************/ 641 642 static bool drvvdCfgEncAreKeysValid(void *pvUser, const char *pszValid) 643 { 644 return true; 645 } 646 647 static int drvvdCfgEncQuerySize(void *pvUser, const char *pszName, size_t *pcb) 648 { 649 PVBOXDISK pThis = (PVBOXDISK)pvUser; 650 int rc = VINF_SUCCESS; 651 652 if (!strcmp(pszName, "Algorithm")) 653 *pcb = strlen(pThis->pszEncryptionAlgorithm) + 1; 654 else if (!strcmp(pszName, "Key")) 655 *pcb = pThis->cbKey; 656 else 657 rc = VERR_NOT_SUPPORTED; 658 659 return rc; 660 } 661 662 static int drvvdCfgEncQuery(void *pvUser, const char *pszName, char *pszString, size_t cchString) 663 { 664 PVBOXDISK pThis = (PVBOXDISK)pvUser; 665 int rc = VINF_SUCCESS; 666 667 if (!strcmp(pszName, "Algorithm")) 668 rc = RTStrCopy(pszString, cchString, pThis->pszEncryptionAlgorithm); 669 else 670 rc = VERR_NOT_SUPPORTED; 671 672 return rc; 673 } 674 675 static int drvvdCfgEncQueryBytes(void *pvUser, const char *pszName, void *pvData, size_t cbData) 676 { 677 PVBOXDISK pThis = (PVBOXDISK)pvUser; 678 int rc = VINF_SUCCESS; 679 680 if (!strcmp(pszName, "Key")) 681 if (pThis->cbKey > cbData) 682 rc = VERR_BUFFER_OVERFLOW; 683 else 684 memcpy(pvData, pThis->pbKey, pThis->cbKey); 685 else 686 rc = VERR_NOT_SUPPORTED; 687 688 return rc; 689 690 } 623 691 624 692 #ifdef VBOX_WITH_INIP … … 1505 1573 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface); 1506 1574 1575 if ( pThis->pszEncryptionAlgorithm 1576 && !pThis->fDekProvided) 1577 { 1578 rc = PDMDrvHlpVMSetRuntimeError(pThis->pDrvIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DrvVD_DEKMISSING", 1579 N_("VD: The DEK for this disk is missing")); 1580 AssertRC(rc); 1581 return VERR_VD_DEK_MISSING; 1582 } 1583 1507 1584 if (!pThis->fBootAccelActive) 1508 1585 rc = VDRead(pThis->pDisk, off, pvBuf, cbRead); … … 1555 1632 Log2(("%s: off=%#llx pvBuf=%p cbWrite=%d\n%.*Rhxd\n", __FUNCTION__, 1556 1633 off, pvBuf, cbWrite, cbWrite, pvBuf)); 1634 1635 if ( pThis->pszEncryptionAlgorithm 1636 && !pThis->fDekProvided) 1637 { 1638 int rc = PDMDrvHlpVMSetRuntimeError(pThis->pDrvIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DrvVD_DEKMISSING", 1639 N_("VD: The DEK for this disk is missing")); 1640 AssertRC(rc); 1641 return VERR_VD_DEK_MISSING; 1642 } 1557 1643 1558 1644 /* Invalidate any buffer if boot acceleration is enabled. */ … … 1613 1699 } 1614 1700 1701 /** @copydoc PDMIMEDIA::pfnSetKey */ 1702 static DECLCALLBACK(int) drvvdSetKey(PPDMIMEDIA pInterface, const uint8_t *pbKey, 1703 size_t cbKey) 1704 { 1705 LogFlowFunc(("\n")); 1706 PVBOXDISK pThis = PDMIMEDIA_2_VBOXDISK(pInterface); 1707 int rc = VINF_SUCCESS; 1708 1709 if (pThis->pszEncryptionAlgorithm) 1710 { 1711 PVDINTERFACE pVDIfFilter = NULL; 1712 1713 pThis->pbKey = pbKey; 1714 pThis->cbKey = cbKey; 1715 1716 rc = VDInterfaceAdd(&pThis->VDIfCfg.Core, "DrvVD_Config", VDINTERFACETYPE_CONFIG, 1717 pThis, sizeof(VDINTERFACECONFIG), &pVDIfFilter); 1718 AssertRC(rc); 1719 1720 /* Load the crypt filter plugin. */ 1721 rc = VDFilterAdd(pThis->pDisk, "CRYPT", pVDIfFilter); 1722 if (RT_SUCCESS(rc)) 1723 pThis->fDekProvided = true; 1724 1725 pThis->pbKey = NULL; 1726 pThis->cbKey = 0; 1727 } 1728 else 1729 rc = VERR_NOT_SUPPORTED; 1730 1731 LogFlowFunc(("returns %Rrc\n", rc)); 1732 return rc; 1733 } 1734 1615 1735 /** @copydoc PDMIMEDIA::pfnGetSize */ 1616 1736 static DECLCALLBACK(uint64_t) drvvdGetSize(PPDMIMEDIA pInterface) … … 1774 1894 PVBOXDISK pThis = PDMIMEDIAASYNC_2_VBOXDISK(pInterface); 1775 1895 1896 if ( pThis->pszEncryptionAlgorithm 1897 && !pThis->fDekProvided) 1898 { 1899 rc = PDMDrvHlpVMSetRuntimeError(pThis->pDrvIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DrvVD_DEKMISSING", 1900 N_("VD: The DEK for this disk is missing")); 1901 AssertRC(rc); 1902 return VERR_VD_DEK_MISSING; 1903 } 1904 1776 1905 pThis->fBootAccelActive = false; 1777 1906 … … 1803 1932 PVBOXDISK pThis = PDMIMEDIAASYNC_2_VBOXDISK(pInterface); 1804 1933 1934 if ( pThis->pszEncryptionAlgorithm 1935 && !pThis->fDekProvided) 1936 { 1937 rc = PDMDrvHlpVMSetRuntimeError(pThis->pDrvIns, VMSETRTERR_FLAGS_SUSPEND | VMSETRTERR_FLAGS_NO_WAIT, "DrvVD_DEKMISSING", 1938 N_("VD: The DEK for this disk is missing")); 1939 AssertRC(rc); 1940 return VERR_VD_DEK_MISSING; 1941 } 1942 1805 1943 pThis->fBootAccelActive = false; 1806 1944 … … 1886 2024 int rc = VINF_SUCCESS; 1887 2025 PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK); 2026 2027 Assert (!pThis->pszEncryptionAlgorithm); 1888 2028 1889 2029 switch (enmXferDir) … … 2173 2313 pThis->pszBwGroup = NULL; 2174 2314 } 2315 if (pThis->pszEncryptionAlgorithm) 2316 { 2317 MMR3HeapFree(pThis->pszEncryptionAlgorithm); 2318 pThis->pszBwGroup = NULL; 2319 } 2175 2320 } 2176 2321 … … 2208 2353 pThis->uMergeSource = VD_LAST_IMAGE; 2209 2354 pThis->uMergeTarget = VD_LAST_IMAGE; 2355 pThis->pszEncryptionAlgorithm = NULL; 2356 pThis->fDekProvided = false; 2210 2357 2211 2358 /* IMedia */ … … 2214 2361 pThis->IMedia.pfnFlush = drvvdFlush; 2215 2362 pThis->IMedia.pfnMerge = drvvdMerge; 2363 pThis->IMedia.pfnSetKey = drvvdSetKey; 2216 2364 pThis->IMedia.pfnGetSize = drvvdGetSize; 2217 2365 pThis->IMedia.pfnGetSectorSize = drvvdGetSectorSize; … … 2612 2760 pCfgVDConfig, sizeof(VDINTERFACECONFIG), &pImage->pVDIfsImage); 2613 2761 AssertRC(rc); 2762 2763 /* Check VDConfig for encryption config. */ 2764 if (pCfgVDConfig) 2765 { 2766 rc = CFGMR3QueryStringAlloc(pCfgVDConfig, "EncryptionAlgorithm", &pThis->pszEncryptionAlgorithm); 2767 if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 2768 { 2769 rc = PDMDRV_SET_ERROR(pDrvIns, rc, 2770 N_("DrvVD: Configuration error: Querying \"EncryptionAlgorithm\" as string failed")); 2771 break; 2772 } 2773 else 2774 rc = VINF_SUCCESS; 2775 } 2776 2777 if (pThis->pszEncryptionAlgorithm) 2778 { 2779 /* Setup VDConfig interface for disk encryption support. */ 2780 pThis->VDIfCfg.pfnAreKeysValid = drvvdCfgEncAreKeysValid; 2781 pThis->VDIfCfg.pfnQuerySize = drvvdCfgEncQuerySize; 2782 pThis->VDIfCfg.pfnQuery = drvvdCfgEncQuery; 2783 pThis->VDIfCfg.pfnQueryBytes = drvvdCfgEncQueryBytes; 2784 } 2614 2785 2615 2786 /* Unconditionally insert the TCPNET interface, don't bother to check … … 2850 3021 && !pThis->fShareable 2851 3022 && !fDiscard 3023 && !pThis->pszEncryptionAlgorithm /* Disk encryption disables the block cache for security reasons */ 2852 3024 && RT_SUCCESS(rc)) 2853 3025 { -
trunk/src/VBox/Main/include/ConsoleImpl.h
r51217 r51342 320 320 321 321 EmulatedUSB *getEmulatedUSB(void) { return mEmulatedUSB; } 322 323 /** 324 * Sets the disk encryption keys. 325 * 326 * @returns COM status code. 327 * @þaram strCfg The config for the disks. 328 * 329 * @note: One line in the config string contains all required data for one disk. 330 * The format for one disk is some sort of comma separated value using 331 * key=value pairs. 332 * There are two keys defined at the moment: 333 * - uuid: The uuid of the base image the key is for (with or without) 334 * the curly braces. 335 * - dek: The data encryption key in base64 encoding 336 */ 337 HRESULT setDiskEncryptionKeys(const Utf8Str &strCfg); 322 338 323 339 private: … … 779 795 bool isResetTurnedIntoPowerOff(void); 780 796 797 /** @name Disk encryption support 798 * @{ */ 799 HRESULT consoleParseDiskEncryption(const char *psz, const char **ppszEnd); 800 HRESULT configureEncryptionForDisk(const char *pszUuid, const uint8_t *pbKey, size_t cbKey); 801 int consoleParseKeyValue(const char *psz, const char **ppszEnd, 802 char **ppszKey, char **ppszVal); 803 /** @} */ 804 781 805 /** @name Teleporter support 782 806 * @{ */ -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r51292 r51342 92 92 #include <iprt/string.h> 93 93 #include <iprt/system.h> 94 #include <iprt/base64.h> 94 95 95 96 #include <VBox/vmm/vmapi.h> … … 4442 4443 { 4443 4444 return mDisplay; 4445 } 4446 4447 /** 4448 * Parses one key value pair. 4449 * 4450 * @returns VBox status code. 4451 * @param psz Configuration string. 4452 * @param ppszEnd Where to store the pointer to the string following the key value pair. 4453 * @param ppszKey Where to store the key on success. 4454 * @param ppszVal Where to store the value on success. 4455 */ 4456 int Console::consoleParseKeyValue(const char *psz, const char **ppszEnd, 4457 char **ppszKey, char **ppszVal) 4458 { 4459 int rc = VINF_SUCCESS; 4460 const char *pszKeyStart = psz; 4461 const char *pszValStart = NULL; 4462 size_t cchKey = 0; 4463 size_t cchVal = 0; 4464 4465 while ( *psz != '=' 4466 && *psz) 4467 psz++; 4468 4469 /* End of string at this point is invalid. */ 4470 if (*psz == '\0') 4471 return VERR_INVALID_PARAMETER; 4472 4473 cchKey = psz - pszKeyStart; 4474 psz++; /* Skip = character */ 4475 pszValStart = psz; 4476 4477 while ( *psz != ',' 4478 && *psz != '\n' 4479 && *psz != '\r' 4480 && *psz) 4481 psz++; 4482 4483 cchVal = psz - pszValStart; 4484 4485 if (cchKey && cchVal) 4486 { 4487 *ppszKey = RTStrDupN(pszKeyStart, cchKey); 4488 if (*ppszKey) 4489 { 4490 *ppszVal = RTStrDupN(pszValStart, cchVal); 4491 if (!*ppszVal) 4492 { 4493 RTStrFree(*ppszKey); 4494 rc = VERR_NO_MEMORY; 4495 } 4496 } 4497 else 4498 rc = VERR_NO_MEMORY; 4499 } 4500 else 4501 rc = VERR_INVALID_PARAMETER; 4502 4503 if (RT_SUCCESS(rc)) 4504 *ppszEnd = psz; 4505 4506 return rc; 4507 } 4508 4509 /** 4510 * Configures the encryption support for the disk identified by the gien UUID with 4511 * the given key. 4512 * 4513 * @returns COM status code. 4514 * @param pszUuid The UUID of the disk to configure encryption for. 4515 * @param pbKey The key to use 4516 * @param cbKey Size of the key in bytes. 4517 */ 4518 HRESULT Console::configureEncryptionForDisk(const char *pszUuid, const uint8_t *pbKey, size_t cbKey) 4519 { 4520 HRESULT hrc = S_OK; 4521 SafeIfaceArray<IMediumAttachment> sfaAttachments; 4522 4523 AutoCaller autoCaller(this); 4524 AssertComRCReturnRC(autoCaller.rc()); 4525 4526 /* Get the VM - must be done before the read-locking. */ 4527 SafeVMPtr ptrVM(this); 4528 if (!ptrVM.isOk()) 4529 return ptrVM.rc(); 4530 4531 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 4532 4533 hrc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(sfaAttachments)); 4534 if (FAILED(hrc)) 4535 return hrc; 4536 4537 /* Find the correct attachment. */ 4538 for (unsigned i = 0; i < sfaAttachments.size(); i++) 4539 { 4540 const ComPtr<IMediumAttachment> &pAtt = sfaAttachments[i]; 4541 ComPtr<IMedium> pMedium; 4542 ComPtr<IMedium> pBase; 4543 Bstr uuid; 4544 4545 hrc = pAtt->COMGETTER(Medium)(pMedium.asOutParam()); 4546 if (FAILED(hrc)) 4547 break; 4548 4549 /* Skip non hard disk attachments. */ 4550 if (pMedium.isNull()) 4551 continue; 4552 4553 /* Get the UUID of the base medium and compare. */ 4554 hrc = pMedium->COMGETTER(Base)(pBase.asOutParam()); 4555 if (FAILED(hrc)) 4556 break; 4557 4558 hrc = pBase->COMGETTER(Id)(uuid.asOutParam()); 4559 if (FAILED(hrc)) 4560 break; 4561 4562 if (!RTUuidCompare2Strs(Utf8Str(uuid).c_str(), pszUuid)) 4563 { 4564 /* 4565 * Found the matching medium, query storage controller, port and device 4566 * to identify the correct driver. 4567 */ 4568 ComPtr<IStorageController> pStorageCtrl; 4569 Bstr storageCtrlName; 4570 LONG lPort, lDev; 4571 ULONG ulStorageCtrlInst; 4572 4573 hrc = pAtt->COMGETTER(Controller)(storageCtrlName.asOutParam()); 4574 if (FAILED(hrc)) 4575 break; 4576 4577 hrc = pAtt->COMGETTER(Port)(&lPort); 4578 if (FAILED(hrc)) 4579 break; 4580 4581 hrc = pAtt->COMGETTER(Device)(&lDev); 4582 if (FAILED(hrc)) 4583 break; 4584 4585 hrc = mMachine->GetStorageControllerByName(storageCtrlName.raw(), pStorageCtrl.asOutParam()); 4586 if (FAILED(hrc)) 4587 break; 4588 4589 hrc = pStorageCtrl->COMGETTER(Instance)(&ulStorageCtrlInst); 4590 if (FAILED(hrc)) 4591 break; 4592 4593 StorageControllerType_T enmCtrlType; 4594 hrc = pStorageCtrl->COMGETTER(ControllerType)(&enmCtrlType); 4595 AssertComRC(hrc); 4596 const char *pcszDevice = convertControllerTypeToDev(enmCtrlType); 4597 4598 StorageBus_T enmBus; 4599 hrc = pStorageCtrl->COMGETTER(Bus)(&enmBus); 4600 AssertComRC(hrc); 4601 4602 unsigned uLUN; 4603 hrc = Console::convertBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); 4604 AssertComRCReturnRC(hrc); 4605 4606 PPDMIBASE pIBase = NULL; 4607 PPDMIMEDIA pIMedium = NULL; 4608 int rc = PDMR3QueryDriverOnLun(ptrVM.rawUVM(), pcszDevice, ulStorageCtrlInst, uLUN, "VD", &pIBase); 4609 if (RT_SUCCESS(rc)) 4610 { 4611 if (pIBase) 4612 { 4613 pIMedium = (PPDMIMEDIA)pIBase->pfnQueryInterface(pIBase, PDMIMEDIA_IID); 4614 if (!pIMedium) 4615 return setError(E_FAIL, tr("could not query medium interface of controller")); 4616 } 4617 else 4618 return setError(E_FAIL, tr("could not query base interface of controller")); 4619 } 4620 4621 rc = pIMedium->pfnSetKey(pIMedium, pbKey, cbKey); 4622 if (RT_FAILURE(rc)) 4623 return setError(E_FAIL, tr("Failed to set the encryption key (%Rrc)"), rc); 4624 } 4625 } 4626 4627 return hrc; 4628 } 4629 4630 /** 4631 * Parses the encryption configuration for one disk. 4632 * 4633 * @returns Pointer to the string following encryption configuration. 4634 * @param psz Pointer to the configuration for the encryption of one disk. 4635 */ 4636 HRESULT Console::consoleParseDiskEncryption(const char *psz, const char **ppszEnd) 4637 { 4638 char *pszUuid = NULL; 4639 char *pszKeyEnc = NULL; 4640 int rc = VINF_SUCCESS; 4641 HRESULT hrc = S_OK; 4642 4643 while ( *psz 4644 && RT_SUCCESS(rc)) 4645 { 4646 char *pszKey = NULL; 4647 char *pszVal = NULL; 4648 const char *pszEnd = NULL; 4649 4650 rc = consoleParseKeyValue(psz, &pszEnd, &pszKey, &pszVal); 4651 if (RT_SUCCESS(rc)) 4652 { 4653 if (!RTStrCmp(pszKey, "uuid")) 4654 pszUuid = pszVal; 4655 else if (!RTStrCmp(pszKey, "dek")) 4656 pszKeyEnc = pszVal; 4657 else 4658 rc = VERR_INVALID_PARAMETER; 4659 4660 RTStrFree(pszKey); 4661 4662 if (*pszEnd == ',') 4663 psz = pszEnd + 1; 4664 else 4665 { 4666 /* 4667 * End of the configuration for the current disk, skip linefeed and 4668 * carriage returns. 4669 */ 4670 while ( *pszEnd == '\n' 4671 || *pszEnd == '\r') 4672 pszEnd++; 4673 4674 psz = pszEnd; 4675 break; /* Stop parsing */ 4676 } 4677 4678 } 4679 } 4680 4681 if ( RT_SUCCESS(rc) 4682 && pszUuid 4683 && pszKeyEnc) 4684 { 4685 ssize_t cbKey = 0; 4686 4687 /* Decode the key. */ 4688 cbKey = RTBase64DecodedSize(pszKeyEnc, NULL); 4689 if (cbKey != -1) 4690 { 4691 uint8_t *pbKey = (uint8_t *)RTMemLockedAlloc(cbKey); 4692 if (pbKey) 4693 { 4694 rc = RTBase64Decode(pszKeyEnc, pbKey, cbKey, NULL, NULL); 4695 if (RT_SUCCESS(rc)) 4696 hrc = configureEncryptionForDisk(pszUuid, pbKey, cbKey); 4697 else 4698 hrc = setError(E_FAIL, 4699 tr("Failed to decode the key (%Rrc)"), 4700 rc); 4701 4702 RTMemWipeThoroughly(pbKey, cbKey, 10 /* cMinPasses */); 4703 RTMemLockedFree(pbKey); 4704 } 4705 else 4706 hrc = setError(E_FAIL, 4707 tr("Failed to allocate secure memory for the key")); 4708 } 4709 else 4710 hrc = setError(E_FAIL, 4711 tr("The base64 encoding of the passed key is incorrect")); 4712 } 4713 else if (RT_SUCCESS(rc)) 4714 hrc = setError(E_FAIL, 4715 tr("The encryption configuration is incomplete")); 4716 4717 if (pszUuid) 4718 RTStrFree(pszUuid); 4719 if (pszKeyEnc) 4720 { 4721 RTMemWipeThoroughly(pszKeyEnc, strlen(pszKeyEnc), 10 /* cMinPasses */); 4722 RTStrFree(pszKeyEnc); 4723 } 4724 4725 if (ppszEnd) 4726 *ppszEnd = psz; 4727 4728 return hrc; 4729 } 4730 4731 HRESULT Console::setDiskEncryptionKeys(const Utf8Str &strCfg) 4732 { 4733 HRESULT hrc = S_OK; 4734 const char *pszCfg = strCfg.c_str(); 4735 4736 while ( *pszCfg 4737 && SUCCEEDED(hrc)) 4738 { 4739 const char *pszNext = NULL; 4740 hrc = consoleParseDiskEncryption(pszCfg, &pszNext); 4741 pszCfg = pszNext; 4742 } 4743 4744 return hrc; 4444 4745 } 4445 4746 … … 8654 8955 LogRel(("Console: VM runtime error: fatal=%RTbool, errorID=%s message=\"%s\"\n", 8655 8956 fFatal, pszErrorId, message.c_str())); 8957 8958 /* Set guest property if the reason of the error is a missing DEK for a disk. */ 8959 if (!RTStrCmp(pszErrorId, "DrvVD_DEKMISSING")) 8960 { 8961 that->mMachine->DeleteGuestProperty(Bstr("/VirtualBox/HostInfo/DekMissing").raw()); 8962 that->mMachine->SetGuestProperty(Bstr("/VirtualBox/HostInfo/DekMissing").raw(), 8963 Bstr("1").raw(), Bstr("RDONLYGUEST").raw()); 8964 that->mMachine->SaveSettings(); 8965 } 8966 8656 8967 8657 8968 that->onRuntimeError(BOOL(fFatal), Bstr(pszErrorId).raw(), Bstr(message).raw()); -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r51092 r51342 815 815 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 816 816 817 /* forward the information to the VMM device */ 818 VMMDev *pVMMDev = mParent->getVMMDev(); 819 if (pVMMDev) 820 { 821 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); 822 if (pVMMDevPort) 817 /* Check for magic domain names which are used to pass encryption keys to the disk. */ 818 if (Utf8Str(aDomain) == "@@disk") 819 return mParent->setDiskEncryptionKeys(Utf8Str(aPassword)); 820 else if (Utf8Str(aDomain) == "@@mem") 821 { 822 /** @todo */ 823 return E_NOTIMPL; 824 } 825 else 826 { 827 /* forward the information to the VMM device */ 828 VMMDev *pVMMDev = mParent->getVMMDev(); 829 if (pVMMDev) 823 830 { 824 uint32_t u32Flags = VMMDEV_SETCREDENTIALS_GUESTLOGON; 825 if (!aAllowInteractiveLogon) 826 u32Flags = VMMDEV_SETCREDENTIALS_NOLOCALLOGON; 827 828 pVMMDevPort->pfnSetCredentials(pVMMDevPort, 829 Utf8Str(aUserName).c_str(), 830 Utf8Str(aPassword).c_str(), 831 Utf8Str(aDomain).c_str(), 832 u32Flags); 833 return S_OK; 831 PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); 832 if (pVMMDevPort) 833 { 834 uint32_t u32Flags = VMMDEV_SETCREDENTIALS_GUESTLOGON; 835 if (!aAllowInteractiveLogon) 836 u32Flags = VMMDEV_SETCREDENTIALS_NOLOCALLOGON; 837 838 pVMMDevPort->pfnSetCredentials(pVMMDevPort, 839 Utf8Str(aUserName).c_str(), 840 Utf8Str(aPassword).c_str(), 841 Utf8Str(aDomain).c_str(), 842 u32Flags); 843 return S_OK; 844 } 834 845 } 835 846 }
Note:
See TracChangeset
for help on using the changeset viewer.