VirtualBox

Changeset 54591 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Mar 2, 2015 7:55:29 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98730
Message:

Add support to supply passwords for disk encryption while the VM is running

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r54340 r54591  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    664664    if (pThis->pIfSecKey)
    665665        rc = pThis->pIfSecKey->pfnKeyRelease(pThis->pIfSecKey, pszId);
     666    else
     667        rc = VERR_NOT_SUPPORTED;
     668
     669    return rc;
     670}
     671
     672static DECLCALLBACK(int) drvvdCryptoKeyStorePasswordRetain(void *pvUser, const char *pszId, const char **ppszPassword)
     673{
     674    PVBOXDISK pThis = (PVBOXDISK)pvUser;
     675    int rc = VINF_SUCCESS;
     676
     677    AssertPtr(pThis->pIfSecKey);
     678    if (pThis->pIfSecKey)
     679        rc = pThis->pIfSecKey->pfnPasswordRetain(pThis->pIfSecKey, pszId, ppszPassword);
     680    else
     681        rc = VERR_NOT_SUPPORTED;
     682
     683    return rc;
     684}
     685
     686static DECLCALLBACK(int) drvvdCryptoKeyStorePasswordRelease(void *pvUser, const char *pszId)
     687{
     688    PVBOXDISK pThis = (PVBOXDISK)pvUser;
     689    int rc = VINF_SUCCESS;
     690
     691    AssertPtr(pThis->pIfSecKey);
     692    if (pThis->pIfSecKey)
     693        rc = pThis->pIfSecKey->pfnPasswordRelease(pThis->pIfSecKey, pszId);
    666694    else
    667695        rc = VERR_NOT_SUPPORTED;
     
    29102938            pThis->VDIfCfg.pfnQueryBytes    = NULL;
    29112939
    2912             pThis->VDIfCrypto.pfnKeyRetain  = drvvdCryptoKeyRetain;
    2913             pThis->VDIfCrypto.pfnKeyRelease = drvvdCryptoKeyRelease;
     2940            pThis->VDIfCrypto.pfnKeyRetain               = drvvdCryptoKeyRetain;
     2941            pThis->VDIfCrypto.pfnKeyRelease              = drvvdCryptoKeyRelease;
     2942            pThis->VDIfCrypto.pfnKeyStorePasswordRetain  = drvvdCryptoKeyStorePasswordRetain;
     2943            pThis->VDIfCrypto.pfnKeyStorePasswordRelease = drvvdCryptoKeyStorePasswordRelease;
    29142944        }
    29152945
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette